Lecture 31:
-
Customizing filtering
-
searching
-
Sorting capabilities
-
Configuring throttling policies
-
Testing throttling policies
-
Understanding filtering, searching and ordering classes
-
Configuring filtering, searching and ordering for views
-
Testing filtering, searching and ordering
Lecture 26: Configured permission policies
Lecture 25:
- Customizing permission class
- Listing all users
- Retrieving details for single user
- Designed RESTFul API to Interact with simple SQLite database
- Defined requirements for our API
- Set up a virtual environment with Django REST Framework
- Created model to represent and persist game information
- Executed migrations in Django
- Managed serialization and de-serialization of game instances
- pip freeze > requirements.txt
- python manage.py test -v 2
- coverage report -m
- coverage html
- psql -U postgres
- create database <NAME_OF_DATABASE>
- create role <NAME_OF_USER> with login password '<PASSWORD_FOR_USER>';
- to list users : use command '\du'
- to grant privileges to user 'grant all privileges on database games to test1;'
- Use '\l' to verify privileges
- python
- python
- to check tables use 'psql --username=test1 --dbname=games --command="\dt"'
- Create Folder
- Navigate to folder in command prompt/terminal
- Create virtual environment with the command 'python -m venv'
- Navigate to /Scripts created in step 3 above
- Execute activate/activate.bat to start virtual environment
- Execute command 'pip install django' to install django
- Execute command 'pip install djangorestframework' to install Django REST framework
- Execute command 'python /Scripts/django-admin.py startproject <NAME_OF_PROJECT_HERE>'
- Navigate to the <NAME_OF_PROJECT> folder generated in step 9
- Execute command 'python manage.py startapp <NAME_OF_APP>' this will create <NAME_OF_PROJECT>/<NAME_OF_APP> and rest of framework files and folders