Logo

dev-resources.site

for different kinds of informations.

Setting Up Django Rest Framework

Published at
11/27/2020
Categories
programming
django
drf
python
Author
blackpandan
Categories
4 categories in total
programming
open
django
open
drf
open
python
open
Author
11 person written this
blackpandan
open
Setting Up Django Rest Framework

Django Rest Framework (DRF)

Django framework is a powerful toolkit for building web API's

its comes with many interesting features which include:

  • a web_browsable_api
  • serialization that supports ORM

an API(application programming interface) gives us data when requests are sent to it.

this data is usually in the form of JSON(JavaScript Object Notation).

yes, it is not only for javascript

Django rest framework(DRF) helps us customize the requests handling and the outputs down to status codes.

to install it Django and python is required

python -m venv env
Enter fullscreen mode Exit fullscreen mode
  • to create a virtual environment
pip install django
Enter fullscreen mode Exit fullscreen mode
  • install django
pip install djangorestframework Markdown django-filter
Enter fullscreen mode Exit fullscreen mode
  • install django rest framework
django-admin startproject api
Enter fullscreen mode Exit fullscreen mode
  • start a django project

  • change directory to api/api

  • open settings.py

  • under installed apps

  • add the following lines to the end of the list

"rest_framework",
"rest_framework.authtoken"

Enter fullscreen mode Exit fullscreen mode

change directory to the root api

python manage.py migrate
Enter fullscreen mode Exit fullscreen mode
python manage.py runserver
Enter fullscreen mode Exit fullscreen mode
drf Article's
30 articles in total
Favicon
Djoser+SimpleJWT
Favicon
AssertionError: 403
Favicon
extra_kwargs arguments
Favicon
To Django or to DjangoREST?
Favicon
Django API | queryset & object, filter() & get()
Favicon
I just tried to compare values between model and serializer
Favicon
Customize Schema with @extend_schema_view
Favicon
Seperate serializers
Favicon
Leveraging Headers for Dynamic Localization in Django
Favicon
Django REST Framework warning: `UnorderedObjectListWarning`
Favicon
DRF create @property decorator in view and use property in serializer
Favicon
why Serializers used for? easy to understand
Favicon
Async API Calls Unleashed: Exploring Django 4 and Django Rest Framework
Favicon
# Comprehensive Security for Class-Based Views in Django Rest Framework
Favicon
HATEOAS Principle - Generating Full Paths for Objects in Django Rest Framework.
Favicon
Instance version control in DRF with Django Reversion
Favicon
Django News #171 - DjangoCon US 2023 Preview
Favicon
How to create thumbnails programmatically in Django
Favicon
Automatically Add Logged In User Under 'created_by' and 'updated_by' to Model in Django Rest Framework
Favicon
how to fix raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
Favicon
CSRF verification failed. Request aborted. in django rest framework
Favicon
CSRF verification failed. Request aborted. in django rest framework
Favicon
How to fix "Must supply api_key"
Favicon
Updating A Many-To-Many Relationship In Django
Favicon
Excluding Fields in Django Rest Framework Serializers
Favicon
JWT Authentication with Django REST Framework - What? Why? How?
Favicon
How to implement Auto Expiring Token in Django Rest Framework
Favicon
Building web applications with Django, Django REST Framework and Nuxt
Favicon
How to use Postman to authenticate to Django Rest Framework
Favicon
Setting Up Django Rest Framework

Featured ones: