Starting again with django
- To create a virtual enviroment
python -m venv env_name
- To activate virtual environment
source venv/bin/active # UNIX
venv\Scripts\activate # WINDOWS
- To install al dependencies from requirements.txt
pip install -r requirements.txt
- To put all dependencies in requirements.txt
pip freeze > requirements.txt
- To start a new project
django-admin startproject projname
- To start a new app
django-admin startapp apname
Then add this app to settings.py
.
- To create superuser
python manage.py createsuperuser
The email field can be left blank.
- Uses traditional django views
- No rest_framework involved
- Using
serializers.Serializer
andserailizers.ModelSerializer
- Using
@api_view()
function decorator andAPIView
class
- Generic Views and and Mixins
- Basic
permissions.isAuthenticated
andpermissions.isAuthenticatedOrReadOnly
and using the auth user model - Basic
PageNumberPagination
- Token Authentication
- Filtering (Both query_param and
rest_framework.filters
) - RestFramework Viewsets and Routers
- Django Model Signal (when a model is saved)
- Tests (with
rest_framework.test.APITestCase
andrest_framework.test.APIClient
)