User Account Management System API
If anything goes wrong, you can ask Victor N. for further assistance.
Database
This project is pre-configured with postgres. Follow this documentation on how to get started with postgres.
After creating user(s) and database for this project, create a DATABASE URL, and add it to the DATABASE_URL in settings.ini file.
The url must be formatted as this example bellow:
postgres://user:password@host:port/db_name
For localhost, host is localhost or 127.0.0.1, and default port is 5432
Create virtualenv
virtualenv -p python3 venv
Activate the virtualenv
source venv/bin/activate
Install requirements
pip install -r requirements-vps.txt
Generate settings.ini files (For windows users, create the file manually):
cat settings.ini.example > settings.ini
Open settings.ini files, and fill in all necessary values.
Apply database migrations
python manage.py migrate
Runserver
python manage.py runserver
Or specify your own host and port as follows:
python manage.py runserver 0.0.0.0:8000
replace 0.0.0.0 and 8000 with your host and port respectively
Open project in browser
http://localhost:8000/api-documentation
Running tests
python manage.py test
Documentation
By default, this project has a Swagger based documentation package called drf-yasg.
For full documentation on configurations, please follow the guide link.
Working with Celery
Celery is mainly used to perform background tasks which are usually not meant to be part of the request - response cycle.
To access the documentation:
Open project in browser
http://localhost:8000/api-documentation
Working with Celery Beat
Celery beat is used to perform periodic tasks automatically.
Deployment
Django applications can be deployed in many ways, and on many different servers. Here are some useful documentations for some popular servers.
Build project with docker compose
docker-compose build
Run project with docker compose
docker-compose up
Open project in browser
http://0.0.0.0:8000/api-documentation