This backend repo was built off of the package Cookiecutter Django https://cookiecutter-django.readthedocs.io
- Make sure you have Python 3 and Pip installed
- Have Pipenv package as well to create virtual environments
- Clone or download this repo
- Run
pipenv shell
to start the virtual environment - Run
pip install -r requirements/local.txt
to download required packages into your virtual environment - Create a postgres database
createdb paper
- Set up postgres
export DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/paper
with your password as your regular administrator password - Apply migrations
python manage.py migrate
- Run the server
python manage.py runserver
to run at defaulthttp://127.0.0.1:8000/
- Open up
http://localhost:8000/
- Create a superuser for admin purposes
python manage.py createsuperuser
- Run the server and navigate to
http://localhost:8000/admin
- Loging using your superuser information
- Run
brew install postgres
- Examine database by running
psql
to open up to postgres terminal
- When editing the models, you must create a migration file and then run migrate to update the postgres database
- After editing, run
python manage.py makemigrations
and fix any errors - Run
python manage.py migrate
to migrate
- Run
pytest