By Lavanya Chennampalli This web app is a project for the Udacity FSND Course.
This project is a RESTful web application utilizing the Flask framework which accesses a SQL database that populates movie categories and their movies. OAuth2 provides authentication for further CRUD functionality on the application. Currently OAuth2 is implemented for Google Accounts.
This project has one main Python module project.py
which runs the Flask application. A SQL database is created using the database_setup.py
module and you can populate the database with test data using lotsofitems.py
.
The Flask application uses stored HTML templates in the templates folder to build the front-end of the application.
- Python
- HTML
- CSS
- OAuth
- Flask Framework
There are some dependancies and a few instructions on how to run the application. Seperate instructions are provided to get GConnect working also.
- Install Vagrant & VirtualBox
- Clone the Udacity Vagrantfile
- Go to Vagrant directory and either clone this repo or download and place zip here
- Launch the Vagrant VM (
vagrant up
) - Log into Vagrant VM (
vagrant ssh
) - Navigate to
cd /vagrant
as instructed in terminal - The app imports requests which is not on this vm. Run pip install requests
Or you can simply Install the dependency libraries (Flask, sqlalchemy, requests,psycopg2 and oauth2client) by running
pip install -r requirements.txt
- Setup application database
python /movie-catalogue-application/database_setup.py
- *Insert sample data
python /movie-catalogue-application/lotsofitems.py
- Run application using
python /movie-catalogue-application/project.py
- Access the application locally using http://localhost:5000
*Optional step(s)
To get the Google login working there are a few additional steps:
- Go to Google Dev Console
- Sign up or Login if prompted
- Go to Credentials
- Select Create Crendentials > OAuth Client ID
- Select Web application
- Enter name 'Movie-Catalogue-App'
- Authorized JavaScript origins = 'http://localhost:5000'
- Authorized redirect URIs = 'http://localhost:5000/login' && 'http://localhost:5000/gconnect'
- Select Create
- Copy the Client ID and paste it into the
data-clientid
in login.html - On the Dev Console Select Download JSON
- Rename JSON file to client_secrets.json
- Place JSON file in project3 directory that you cloned from here
- Run application using
python /Movie-catalogue-app/project.py
The following are open to the public:
Movie Catalog JSON: /category/JSON
- Displays the whole movie catalog.
Categoryitems JSON: '/category/items/JSON' - Displays the whole category items
Category items JSON: '/category/int:categories_id/items/JSON' - Displays Categoryitems for a specific category
Specific Category items JSON: '/category/int:categories_id/item/int:categoryitem_id/JSON' - Displays a specific category items in a specific category
This project is inspiration from Shaik Badulla.