Installation
Getting started with DRF is straightforward.
Requirements
- Python (3.6+)
- Django (3.0+)
Step-by-step Guide
Install using pip:
bashpip install djangorestframeworkAdd to
INSTALLED_APPS: Open your project'ssettings.pyand add'rest_framework'to your installed apps.pythonINSTALLED_APPS = [ ... 'rest_framework', ]Global Settings (Optional): You can configure global DRF settings in
settings.pyusing theREST_FRAMEWORKdictionary.pythonREST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ] }
