Installing and Configuring DRF
Add DRF and the browsable API.
Installing and Configuring DRF is a free Django Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Django Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
A REST API, Quickly
Django REST Framework, or DRF, layers a clean toolkit on top of Django so you can turn your models into a JSON API fast. 🚀
Install the Package
You add DRF the same way you add any Python library: with pip, then pin it in requirements so teammates get the same version.
pip install djangorestframeworkRegister the App
DRF only wakes up once you add rest_framework to your INSTALLED_APPS list in settings.py, right alongside your own apps.
INSTALLED_APPS = [
# ...
'rest_framework',
]Why INSTALLED_APPS Matters
Adding it to INSTALLED_APPS lets Django discover DRF's templates, static files, and management commands automatically.
The REST_FRAMEWORK Dict
You configure DRF through a single REST_FRAMEWORK dictionary in settings.py, keeping all of its options in one tidy place.
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [],
}Default Renderers
By default DRF can return both raw JSON and a friendly HTML view, thanks to its built-in renderers you rarely have to touch.
The Browsable API
One reason DRF feels magical is the browsable API: open an endpoint in your browser and you get a clickable, documented page. ✨
Wire Up the URLs
DRF ships login views for the browsable API; you include them in your urls.py so you can sign in while testing endpoints.
urlpatterns = [
path('api-auth/', include('rest_framework.urls')),
]Verify the Install
A quick way to confirm DRF is wired in is to open the Django shell and import it without errors before writing any code.
python manage.py shell
>>> import rest_frameworkKeep Settings Minimal
Start with an almost empty config. You only add keys to REST_FRAMEWORK when you genuinely need a behavior changed, not before.
You Are API-Ready
With DRF installed, registered, and its URLs included, your project is now ready to expose endpoints that speak JSON to any client.
Quick Check
Where does DRF need to be listed to activate?
Recap: DRF Set Up
You pip-installed DRF, added it to INSTALLED_APPS, included its auth URLs, and confirmed the import. Your API foundation is solid. 🎉
Frequently asked questions
Is the “Installing and Configuring DRF” lesson free?
Yes — the full text of “Installing and Configuring DRF” is free to read here on the web, and the Django Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Django Academy course, upgrade to CoddyKit PRO.
What will I learn in “Installing and Configuring DRF”?
Add DRF and the browsable API. You practise Django Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Django Academy?
No prior experience is required. Django Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Installing and Configuring DRF” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Django Academy lesson?
Yes. Every Django Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Installing and Configuring DRF
- Serializers: Model to JSON
- APIView and Function @api_view
- The Browsable API and Status Codes