| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Make sure you refer to the django version you are using. A quick way to start a new django project is to run the following command:
pip install djangopip install pipenvdjango-admin startproject Codemonk && cd Codemonkpipenv install djangopip install requirements.txtpipenv shellpython manage.py startproject BooksINSTALLED_APPS = [
...,
'Books',
...,
]python manage.py migratepython manage.py createsuperuserpython manage.py runserverOfficial Django REST framework documentation: https://www.django-rest-framework.org/
The Django REST framework is a powerful and flexible toolkit for building web APIs in Django applications. It provides a set of utilities and serializers to easily create RESTful APIs that can handle various data formats, authentication, permissions, and more.
The documentation covers all aspects of DRF, including installation, configuration, serializers, views, authentication, permissions, pagination, versioning, filtering, and more. It's a comprehensive resource that helps developers understand and leverage the features provided by DRF efficiently.
pip install djangorestframeworkINSTALLED_APPS = [
...,
'rest_framework',
'django_filters',
...,
]REST_FRAMEWORK = {...}from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('your_app.urls')), # Include your app's API URLs
]# your_app/urls.py
from django.urls import path
from . import views
from rest_framework import routers
urlpatterns = [ ]
router =routers.SimpleRouter()
router.register('api',YOUR_API_VIEW)
urlpatterns+=router.urlsfrom rest_framework import viewsets
class ViewSet(viewsets.ModelViewSet):
...URL : http://127.0.0.1:8000/api/
Assuming you are running your development server on the default port (8000) and the base URL is set to 'api/' in your project's urls.py file. You should see an interactive API documentation page showing your API endpoints, their methods (GET, POST, etc.), and the parameters they accept. The browsable API documentation allows you to test your API endpoints directly from the browser, making it convenient for both development and exploration.
| Back | FazBrowse Home | New Git URL |