contact-backend # <--- Project Root Directory
│
└───conf
│ │ redis # Redis config file
│ │ secrets # Secret keys file
│
└───python
| │ ... # Python interpeter and its virtual environment
|
└───repo
│ │ # <--- Clone Project here
│
└───database.db # File with sqlite3 database (will be created automatically after you first time launch the server).
-
Create virtual environment for python 3.8 (It is necessary to have python 3.8 installed on your local machine). In the project root directory:
python3 -m venv python
-
Clone project repository:
git clone https://github.com/fedorgrab/contact-backend.git repo
-
In the conf directory create 2 config files:
secrets:
SECRET_KEY = {randomly generated secret key}
redis:
REDIS_HOST = 127.0.0.1 REDIS_PORT = 6379 REDIS_DB = 1 REDIS_PASSWORD =
(In the example above default values are provided. If you did not apply any extra settings it should work fine)
-
Activate local environment from the root directory:
source python/bin/activate
-
While launching the server first time it is necessary to migrate a database. Run from the repo directory:
python manage.py migrate
-
Create superuser:
python manage.py createsuperuser
-
Launch django server from repo directory:
python manage.py runserver 0.0.0.0:8000
-
Go to the web-browser and check
localhost:8000/admin