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
thingsfolder to the app name of your choice - Search through entire code base for
Thing,Thingsandthingsto modify code to use your resourceproject/settings.pyproject/urls.py- App's files
views.pyurls.pyadmin.pyserializers.pypermissions.py
- "Front" files
- if including a customer facing portion of the site then update/recreate:
urls_front.pyviews_front.py- template files
- Make sure to update project
urls.pyto 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.sampleto.envand 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
staticfilesfrom 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