This Website allows you to store items in a database. The items are categorized by categories, which are also created by the user and saved in the database. The Website provides a Google Login system and has authorization control in place. This means that only the user who created an item is eligable to edit or delete the item. Without being logged in, a user cannot create a new item.
Note that the explanations given below are for Windows 7
- Python: The Python version used for this project is 2.7.12, which can be found here
- PostgreSQL: The PostgreSQL version used for this project is 9.5.9, which can be found here
- SQLAlchemy: Open a terminal (cmd) and type
pip install SQLAlchemy - Flask: Open a terminal (cmd) and type
pip install Flask - OAuth2: Open a terminal (cmd) and type
pip install oauth2client
- Navigate to the Google Developer Website here
- Select the Google API Console
- Create a new project
- Choose Credentials
- Add http://localhost:5000 to the authorized JavaScript sources
- Adjust the Consent screen accordingly
- After receiving your Client-ID and Client key, download JSON
- Rename the downloaded file to client_secrets.json
- Save the file in the same folder as the itemproject.py file
- Open a terminal (cmd) and type
psql -U postgresto use the default user in postgresql - Type
CREATE DATABASE items_db; - You can exit now by typing
CTRL+C
You can start this project with an empty database and can manually create Categories and Items. If you want to, however, you can load the starting_data.py file to load some categories and items initially. Note that you cannot edit or delet this items and categories via the web interface as they were created with fictive user credentials.
- Open a terminal and
cdinto the folder, in which you saved the file - Type
python starting_data.py
- Open a terminal and
cdinto the folder, in which you saved the file - Type
python itemproject.py - Open a browser and type
localhost:5000/index(Note: If you want to use a different port, you can change this in line 382 of the itemproject.py file)