Django-cmstemplates is efficient templates-in-db implementation.
Application is aimed to support python 3.4+ and django 1.9+.
Features
Template blocks can be edited in your admin
Django’s cache machinery is actively used
Template group autocreation (if group is not exist)
Codemirror widget support
Ability to view template only for superuser, useful when editing in production.
Installation
Add cmstemplates to INSTALLED_APPS
Run ./manage.py migrate cmstemplates
Go to admin and create new group template with name test-group You can skip this step for now, if you want template to be auto-created.
Add this group to your template with following tag:
{% load cmstemplates_tags %} {% cms_group "test-group" %}If you skipped step three, then template group test-group will be created automatically.
Create some templates for this group in admin.
Refresh target site page and see your templates content.
Using codemirror widget
Add to your settings:
CMSTEMPLATES_USE_CODEMIRROR = True
Install codemirror widget:
source env/bin/activate
pip install django-codemirror-widget
cd project_name/static/vendor
unzip codemirror.zip
mv codemirror-4.2 codemirror
Add to settings:
CODEMIRROR_PATH = 'vendor/codemirror' CODEMIRROR_THEME = 'default' CODEMIRROR_CONFIG = {'lineNumbers': True}
Final settings should look like this:
# cmstemplates
CMSTEMPLATES_USE_CODEMIRROR = True
# codemirror
CODEMIRROR_PATH = 'vendor/codemirror'
CODEMIRROR_THEME = 'default'
CODEMIRROR_CONFIG = {'lineNumbers': True}
Metadata
Release files for django-cmstemplates 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-cmstemplates-0.3.3.tar.gz | 11.4 kB | Without provenance | Details |
Release files / django-cmstemplates-0.3.3.tar.gz
| Download URL | django-cmstemplates-0.3.3.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d0233745689ed129a0ddd559a531c2536959173760b559bfcc11199ca518a4a
|
|
BLAKE2b-256 checksum How to use checksums |
56a91aaf705a7c3f010ee8178ba22bc9d13105c210f0aabe22f91f610c264290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-cmstemplates 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.