Edit contents directly on your page with Django
Project description
DjSuperAdmin
![GitHub](https://pypi-camo.freetls.fastly.net/4484e9172802ca95c25f8e0f198d5fe3dcdb9262/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6f7472656b6167656e63792f63616d6f6d696c6c613f7374796c653d666c61742d737175617265)
✍🏻 Edit contents directly on your page with Django
Here how it works!
Installation
pip install djsuperadmin
Setup
Add djsuperadmin
to your INSTALLED_APPS
in settings.py
INSTALLED_APPS = [
# ...
'djsuperadmin'
]
And import all the required js files in the footer
{% load djsuperadmintag %}
{% djsuperadminjs %}
Usage
Define your custom Content
model using DjSuperAdminMixin
and provide an endpoint to GET/PATCH your content
from django.db import models
from djsuperadmin.mixins import DjSuperAdminMixin
class GenericContent(models.Model, DjSuperAdminMixin):
identifier = models.CharField(max_length=200, unique=True)
content = models.TextField()
@property
def superadmin_get_url(self):
return f'/api/content/{self.pk}'
@property
def superadmin_patch_url(self):
return f'/api/content/{self.pk}'
Then in your template
{% load djsuperadmintag %}
...
<body>
<p>
{% superadmin_content your_object 'your_object_attribute' %}
</p>
</body>
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
djsuperadmin-0.11.3.tar.gz
(12.3 kB
view hashes)
Built Distribution
Close
Hashes for djsuperadmin-0.11.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6496f9720de78f2ece57949131dc02b143a78b5b8dd1ec73ca87de78129a05af |
|
MD5 | acb2d8b033d8bdef33a58fe7c90306a8 |
|
BLAKE2b-256 | 684e2ef5853c06f9f837e17ef41b55cd8592245075e37150c94b6807cc6b1913 |