A template repository for creating a web API using Django and Django REST framework.
At project root, perform the following.
- Use python 3.12
$ pyenv install 3.12 $ pyenv local 3.12
- Install poetry
$ brew install poetry
- Set up virtual environment
$ poetry env use 3.12 $ poetry install
- Apply migrations and create a superuser for testing purposes (use
password
for password)$ make migrate $ poetry run python manage.py createsuperuser --username admin --email [email protected]
- Create a personal config file (replace
<API_KEY>
and<URL>
with the appropriate values, this is to avoid having sensitive information in the codebase)$ touch web_api/config/local.py or $ make local
- Run the server
$ ENVIRONMENT=local make serve