Template Project for starting up CRUD API with Django Rest Framework
- DO NOT migrate yet
- add additional dependencies as needed
- Re-export requirements.txt as needed
- change
things
folder to the app name of your choice - Search through entire code base for
Thing
,Things
andthings
to modify code to use your resourceproject/settings.py
project/urls.py
- App's files
views.py
urls.py
admin.py
serializers.py
permissions.py
- "Front" files
- if including a customer facing portion of the site then update/recreate:
urls_front.py
views_front.py
- template files
- Make sure to update project
urls.py
to add routes to the "front".
- if including a customer facing portion of the site then update/recreate:
- Update ThingModel with fields you need
- Make sure to update other modules that would be affected by Model customizations. E.g. serializers, tests, etc.
- Rename
project/.env.sample
to.env
and update as needed- To generate secret key use
python3 -c "import secrets; print(secrets.token_urlsafe())"
- To generate secret key use
- Run makemigrations and migrate commands when ready.
- Run
python manage.py collectstatic
- This repository includes static assets in repository. If you are using a Content Delivery Network then remove
staticfiles
from repository.
- This repository includes static assets in repository. If you are using a Content Delivery Network then remove
- Optional: Update
api_tester.py
NOTE: If you are using Postgres instead of SQLite then make sure to install psycopg2-binary
and include in requirements.txt