A dark theme for django rest framework browsable api
Project description
drf-dark-shade
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:
Installation:
- Install
drf-dark-shade
package using pip or poetry
pip install drf_dark_shade
- Add
drf_dark_shade
to yourINSTALLED_APPS
in your Django project's settings.
INSTALLED_APPS = [
# other packages
'rest_framework', # drf required
'drf_dark_shade',
]
- Add
drf_dark_shade
renderer toREST_FRAMEWORK
config
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'drf_dark_shade.renderers.DeepForestBrowsableAPIRenderer',
)
}
Override templates
To override providing templates:
- Configure root
templates
dir in your django app
TEMPLATES = [
{
...
# 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
All set! now run app and visit your API endpoint.
Enjoy Dark 🌃
Contribution
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!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file drf_dark_shade-0.1.5.tar.gz
.
File metadata
- Download URL: drf_dark_shade-0.1.5.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.0 CPython/3.11.6 Linux/6.1.71-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d48e5738f103e3a8b046ca62c6ce68086e782dce7a3f013264ada806155833bf |
|
MD5 | 8eb77eb38d25b0c576051e5f8d0f5662 |
|
BLAKE2b-256 | 72b7a484623b1b93544ed0933baf0e0a641369d20ca91c67a3cf584308ca642b |
File details
Details for the file drf_dark_shade-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: drf_dark_shade-0.1.5-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.0 CPython/3.11.6 Linux/6.1.71-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52dbe448b3ad17a7c33eebdf1f1e023b645e0532115b2b589f04721d04dba7d9 |
|
MD5 | 605f49356bd4d38d846e2d25c78e9a6f |
|
BLAKE2b-256 | 72b12ce00660767cd587b34143e516ac406fe2cd44a455d52ed69ca95f9d7451 |