Enhance your Django Rest Framework (DRF) browsing experience with the drf-dark-shade
package. This lightweight and easy-to-use extension bring a sleek dark theme to the DRF browsable API, reducing eye strain and providing a modern, visually appealing interface for developers.
Deep Forest Theme
-
Install
drf-dark-shade
package using pip or poetrypip install drf_dark_shade # or poetry add drf_dark_shade
-
Add
drf_dark_shade
to yourINSTALLED_APPS
in your Django project's settings.INSTALLED_APPS = [ # ... "rest_framework", # django-rest-framework required "drf_dark_shade", ]
-
Add
drf_dark_shade
renderer toREST_FRAMEWORK
configREST_FRAMEWORK = { "DEFAULT_RENDERER_CLASSES": ( "rest_framework.renderers.JSONRenderer", "drf_dark_shade.renderers.DeepForestBrowsableAPIRenderer", # configure custom renderer ), # ... }
To override providing templates:
- Configure root
templates
dir in your django appTEMPLATES = [ { # ... # configure root templates "DIRS": [os.path.join(BASE_DIR, "templates")], "APP_DIRS": True, # ... }, ]
- Create template to override with name of the theme you want, like:
templates/drf_dark_shade/deep-forest.html
Check /examples/
for example configuration with setup guide.
All set! now run app and visit your API endpoint.
Enjoy Dark 🌃
More themes will be added later. PRs are welcome ❤️
Contributions are welcome!
If you encounter issues or want to add new features, feel free to open pull requests.
Give a ⭐️ if you find this project interesting and useful!