This project is a part of Udacity Full-Stack Developer Nanodegree.
It presents an application that provides a list of items (demonstrational resources related to Material Design in this case) within a variety of categories as well as provide a user registration (via Google+ and Facebook oAuth2) and authentication system.
Registered users have an ability to post, edit and delete their items.
This work is a RESTful web application built on Python framework Flask and SQLAlchemy ORM.
Assuming Ubuntu is used:
- Install Flask, PostgreSQL with its PL/Python extension, SQLAlchemy, and pip:
sudo apt-get -qqy update &&
sudo apt-get -qqy upgrade &&
sudo apt-get -qqy install postgresql python-psycopg2 postgresql-plpython &&
sudo apt-get -qqy install python-flask python-sqlalchemy &&
sudo apt-get -qqy install python-pip
- Required pip packages:
sudo pip install bleach &&
sudo pip install oauth2client &&
sudo pip install requests &&
sudo pip install httplib2 &&
sudo pip install redis &&
sudo pip install passlib &&
sudo pip install itsdangerous &&
sudo pip install flask-httpauth
- After copying files to the server, create a database and populate it:
sudo su postgres
psql
CREATE USER catalog WITH PASSWORD 'password';
CREATE DATABASE catalog;
\c catalog
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO catalog;
CREATE EXTENSION plpythonu;
UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'plpythonu';
\q
exit
./populate_db.py
alternatively, if some items are also required:
./populate_db.py -i
- Create
config.py
file with the content:
DEBUG = True # or False for production
SECRET_KEY = 'a-secret-key-of-your-choice-here'
- Create files
g_client_secrets.json
(must be generated and downloaded from Google Developer's Console) andfb_client_secrets.json
(generate credentials at Facebook for Developers).
nano fb_client_secrets.json
{
"web": {
"app_id": "your-app-id",
"app_secret": "your-app-secret"
}
}
- Run the project:
python project.py
This website requires the following information from the user: name, email address and profile picture. This information is used only for registration and authentication, and will never be aggregated and given to any third party (unless required by law).
It also will not be used to contact users by the website owner without asking for explicit consent.
Anton Kachurin, 2017, Apache License v2.0
Icon pack by Jurre Houtkamp