The API and the Postgres database acts as a content management system for the Detester website. The API itself is built with the Django Rest Framework while the database is hosted with Heroku Postgres.
/detester_api contains python files that handle the instantiation and defintion of models migrated in the database, serialization of data to JSON, viewsets, and routing (in urls.py). The /backend contains configuration and settings for Django and connection to the database.
/data contains csv files that were parsed when initially filling the database with data.
/utils contains several scripts used to scrape data from the old websit and load data into the database from the csv files
Note that uploaded images to the application are stored on an AWS S3 server.
The app is deployed with Heroku. The link to the application can also be found under the About section of the repository.
First, clone the repository (preferably using SSH) in a desired destination folder:
git clone git@github.com:hcs-t4sg/starter-project-2023-v2.git
Then open the project in your chosen code editor. To run the project, you'll need to activate a virtual environment. Depending on your machine, run the following commands:
sudo apt-get install python3-venv # If needed
python3 -m venv .venv
source .venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate
py -3 -m venv .venv
.venv\scripts\activate
Then, install all packages and dependencies:
pip install -r requirements.txt
To run the app, at the root of the directory, run python3 manage.py runserver
A superuser has write permissions to the database as well as other admin privileges. They can also access the admin portal via detesterapi.herokuapp.com/admin.
To create a new superuser, run the command python3 manage.py createsuperuser. From here,
you will prompted to provide an email and password for the superuser account.
Contact Jayden Personnat at jpersonnat@college.harvard.edu.