Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django rest framework tutorial

1. Create a new project

django-admin startproject core .

2. Create a new app

python manage.py startapp api

3. Add the app to the project

# tutorial/settings.py
INSTALLED_APPS = [
    ...
    'quickstart',
]

4. Create a view

# quickstart/views.py
from rest_framework.decorators import api_view
from rest_framework.response import Response

@api_view(['GET'])
def hello_world(request):
    return Response({'message': 'Hello, World!'})

5. Create a URL

# quickstart/urls.py
from django.urls import path
from .views import index

urlpatterns = [
    path('index', index),
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages