Skip to content

Mohammadreza-Rokni/toDoList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django REST framework is a powerful and flexible toolkit for building Web APIs.

Some reasons you might want to use REST framework:

The Web browsable API is a huge usability win for your developers.
Authentication policies including packages for OAuth1a and OAuth2.
Serialization that supports both ORM and non-ORM data sources.
Customizable all the way down - just use regular function-based views if you don't need the more powerful features.
Extensive documentation, and great community support.
Used and trusted by internationally recognised companies including Mozilla, Red Hat, Heroku, and Eventbrite.

create toDoList API drf;

step 1: Generated by ('django-admin startproject') using Django 4.0.5 in terminal.

step 2: Install using pip, including any optional packages you want...:

    pip install djangorestframework
    pip install markdown                # Markdown support for the browsable API.
    pip install django-filter           # Filtering support

step 3 : Create our own app with this command :('python manage.py startapp appname') in terminal, Add my app to the installed app in settings.py

step 4: Add 'rest_framework' & 'mainApp'to your INSTALLED_APPS setting.

        INSTALLED_APPS = [
            ...
            # apps
            'mainApp',
            # third party apps
            'rest_framework',
        ]

step 5: Create your toDo model(mainApp/models.py) and in terminal we enter makemigration and migrate with their commands (python manage.py makemigration , python manage.py migrate)

step 6: Create your serializers.py python file in (mainApp) and (from rest_framework import serializers) and create (class toDoSerializer) with my model fields

step 7: Create your class base views(mainApp/views.py)

step 8: Register your models(mainApp/admin.py) & in terminal Create super user with command (python manage.py createsuperuser)

step 9: mainApp URL Configuration(mainApp/urls.py)

step 10: toDoList URL Configuration(toDoList/urls.py) Add path of urls mainApp

        urlpatterns = [
            ...
            path('api/', include('mainApp.urls'))
        ]

step 11: Create your APITestCase(mainApp/tests.py)

Finished.

About

toDoList django rest framework web application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published