Backend for personal website(drewdru.com) and fun
Frontend repository: https://github.com/drewdru/sitedrewdru
- Python >= 3.8.0
- requiremets.txt
- PostgreSql
- Redis
- Nginx
Create and configure .env file:
cp .env.example .env && cp .env.example .env.test && cp .env.example .env.ci
# if you use Docker: && cp .env.example .env.docker
To get a string for SECRET_KEY run:
openssl rand -hex 32
virtualenv env -p python3
source env/bin/activate
pip install -r requirements.txt
python manage.py migrations upgrade head
python manage.py run [--prod]
python manage.py test
python manage.py createapp microservice_name
python manage.py migrations -h [--prod]
# Autogenerate migrations
python manage.py migrations revision --autogenerate -m "Autogenerate migrations" [--prod]
cp .env.example .env.prod && cp .env.example .env.test
virtualenv env -p python3
source env/bin/activate
pip install -r requirements.txt
python manage.py migrations upgrade head
Configure paths in etc/fastDrewDru.service
sudo cp etc/fastDrewDru.service /etc/systemd/system/fastDrewDru.service
sudo systemctl daemon-reload
sudo systemctl start fastDrewDru.service
sudo systemctl enable fastDrewDru.service
sudo service fastDrewDru status # use restart on deploy
Configure paths in etc/nginx/sites-available/fastDrewDru.conf
sudo cp etc/nginx/sites-available/fastDrewDru.conf /etc/nginx/sites-available/fastDrewDru.conf
sudo ln -s /etc/nginx/sites-available/fastDrewDru.conf /etc/nginx/sites-enabled/fastDrewDru.conf
sudo service nginx reload