Author: Sameeran Bandishti -> Founder - Caronex Labs
A Django Rest Framework implementation that comes with a set of pre-implemented features commonly seen in most projects.
Features Implemented:
django-rest-auth
package implemented along with the common settings and instructions to change them.- Custom login and registration serializers for
django-rest-auth
along with instructions on how to modify them. drf-yasg
package implemented along with the common url patterns to provide Swagger documentation out of the box.- A
users_module
along with implementations ofAbstractUser
,CustomUserManager
and aUserAdmin
class for Django's Admin Panel. Along with instructions on how to modify all of the above. - Email configuration settings, preset to work with
Mailgun
but will work with any provider. python-dotenv
package implemented and imported intosettings.py
. Information that is commonly stored in an env file has already been moved to the same.- A environment file template along with instructions to modify it.
- A
.gitignore
file preset for Python projects, Visual Studio Code IDE, Jetbrains IDEs and other commonly ignored files. - The boilerplate is preconfigured to be ready to host on
Heroku
. It contains all the necessary packages and theProcfile
. Along with any settings that need to be configured inside ofsettings.py
. django-cors-headers
is implemented and theclickjacking
middleware has been removed to ensure proper performance.django-filters
is implemented and has been added to theREST_FRAMEWORK.DEFAULT_FILTER_BACKENDS
.- Both
AnonRateThrottle
andUserRateThrottle
have been implemented along with instructions on how to set theThrottling Rates
. DEBUG
set toFalse
by default butError Propagation
is set to allow logging of errors to the server console even if not in debug mode.- Coverage calculation is setup using coveralls.
- Pre-configured Dockerfiles for development and production.
- Pre-configured Nginx server.
- Pre-configured Travis-CI.
- Pre-configured GitHub Actions
- On the Github Repository of this project, you'll find an option to
Use this template
on the top right. - Follow the prompts to create your new repository using this one as a template.
- Clone your new repository to your local system.
- Create your virtual environment and install all requirements with
pip install -r requirements.txt
- Run the following command:
python manage.py configure
. Answer any questions it asks to interactively set the project up. - Prompt your IDE/Code-Editor to index the project. The easiest way to do so is to just restart the IDE/Editor.
- Go to the
settings.py
file and read through it. There are comments indicating any modifications you might want to make. - Go through every file inside of the
users_module
app and follow any instructions that apply to you. - Go through the templates provided, they contain instructions as well. These are generally the templates pertaining to the emails sent and the email confirmation pages.
- Make migrations with the command:
python manage.py makemigrations
and then the commandpython manage.py makemigrations users_module
and then apply them withpython manage.py migrate
- You then need to run the command:
python manage.py collectstatic
in order to collect and store the static files needed for the Admin panel. If you want to avoid doing this for some reason, you can also just setDEBUG=True
in thesettings.py
file. - Before you continue to build your project, check the
Admin Panel
('/admin/
') and theswagger documentation
('/docs/
') to ensure that the boilerplate has set up successfully. You will have to run the commandpython manage.py createsuperuser
in order to access the Admin Panel.
django-rest-auth
drf-yasg
django-cors-headers
python-dotenv
- Configuring Django apps for Heroku
- Configuring Mailgun for Django
- Secret Key Generator for Django
- How to setup a Custom User Model
django-rest-auth
OAuth implementation- A demo project inside the template
- Automating more of the setup using the custom management command.
- Running
collectstatic
as a part of the setup. - Creating the
virtual-environment
and installing therequirements
as a part of the setup. - Interactively setting up the User Model.
- Interactively setting up the registration process (Email confirmation, email required, username required, etc.)
- Running