Developed an application that provides a list of items within a variety of categories as well as provide a user registration and authentication system. Registered users will have the ability to post, edit and delete their own items.
- Python module project.py runs the Flask application.
- A SQL database is created using the database_setup.py module and it was populated the with test data using lotsofbookswithuser.py.
- The Flask application uses the stored HTML templates in the templates folder & & CSS file in the static folder to build the front-end of the application.
- Go to https://console.developers.google.com/project and login with Google.
- Create a new project
- Name the project
- Select "API's and Auth-> Credentials-> Create a new OAuth client ID" from the project menu
- Select Web Application
- On the consent screen, type in a product name and save.
- In Authorized javascript origins add
http://localhost:8000
- Click create client ID
- Click download JSON and save it into the root directory of this project.
- Rename the JSON file "client_secret.json"
- In login.html replace the 'data-clientid' value so that it uses your Client ID from the web applciation.
- Create an APP ID
- Go to your app on the Facebook Developers Page.
- Click + Add Product in the left column.
- Find Facebook Login in the Recommended Products list and click Set Up.
- Click Facebook Login that now appears in the left column.
- Add
http://localhost:8000/
to the Valid OAuth redirect URIs section. - Create a file called fb_client_secrets.json file in the root directory of the repository.
- Paste the following into the fb_client_secrets.json file:
{ "web": { "app_id": "ENTER_APP_ID_HERE", "app_secret": "ENTER_APP_SECRET_HERE" } }
- Install Python, Vagrant, and VirtualBox.
- Clone this repository.
- From your terminal, go to the root directory of this repository.
- Run the command
vagrant up
. - Once you got the shell prompt back, run the command
vagrant ssh
to log in to the Linux VM. - Run the command
python database_setup.py
. - Use the command
python lotsofbookswithuser.py
to load the data. - To execute the program, run the command
python project.py
. - Access and test the application by visiting
http://localhost:8000
.