the7chefs_backend is a provider of RESTful backend services for the mobile application CookTasty.
- Install postgres
- Install python
- Install pip
- Install virtual environment
1. Activate virtual environment and change directory to the7chefs
folder and install related packages using the following command on command prompt
$ pip install -r requirements.txt
# CREATE USER the7chefsapp WITH PASSWORD 'qwe123qwe123';
# CREATE DATABASE the7chefs OWNER the7chefsapp;
# ALTER ROLE the7chefsapp superuser;
# ALTER ROLE the7chefsapp SET client_encoding TO 'utf8';
# ALTER ROLE the7chefsapp SET default_transaction_isolation TO 'read committed';
# ALTER ROLE the7chefsapp SET timezone TO 'UTC';
# GRANT ALL PRIVILEGES ON DATABASE the7chefs TO the7chefsapp;
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py runserver
You might not be able to successfully run the server in step 4 as you will need an environment file containing the configuration variables required by the code. You the format of the environment file can be found in this dot.env file. You will need to rename dot.env
to .env
.
You can now create your database objects such as users manually from http://127.0.0.1:8000/admin after running the server instance with ur local machine through the command in step 4.