A Django app to make minor changes to your templates on the fly.
Project description
Templates Admin is a tiny, nifty application for your Django project to edit your templates, that are stored on your disk, via an admin interface.
Originally this app was inspired by dbtemplates.
Installation:
Put templatesadmin into your INSTALLED_APPS setting.
Add this line to your urlconf:
(r'^templatesadmin/', include('templatesadmin.urls')),
Create a group TemplateAdmins and put all users in there, who should been able to edit templates. You don’t need to grant any permissions to that group. Just call it TemplateAdmins.
Keep in mind that also Superusers (is_admin flag) must belong to this group, if they should been able to edit templates. The group name is case-sensitive!
Point your webbrowser to http://localhost/templatesadmin/ and start editing.
Optional Settings:
There are some settings that you can override in your settings.py:
TEMPLATESADMIN_GROUP: The name of your group of your TemplatesAdmin Users.
Default: TemplateAdmins
TEMPLATESADMIN_VALID_FILE_EXTENSIONS: A tuple of file-extensions (without the leading dot) that are editable by TemplatesAdmin.
Default:
TEMPLATESADMIN_VALID_FILE_EXTENSIONS = ( 'html', 'htm', 'txt', 'css', 'backup' )
TEMPLATESADMIN_TEMPLATE_DIRS: A tuple of directories you want your users to edit, instead of all templates.
Default: All user-defined and application template-dirs.
TEMPLATESADMIN_HIDE_READONLY: A boolean to wether enable or disable displaying of read-only templates.
Default: False
TEMPLATESADMIN_EDITHOOKS: A tuple of callables edithooks. Edithooks are a way to interact with changes made on a template. Think of a plugin system.
There are two builtin edithooks:
dotbackupfiles.DotBackupFilesHook: Creates a copy of the original file before overwriting, naming it <oldname>.backup.
gitcommit.GitCommitHook: Commits your templates after saving via git version control.
hgcommit.HgCommitHook: Creates a mercurial commit after saving.
You can define your own edithooks, see above hooks as example.
Default:
TEMPLATESADMIN_EDITHOOKS = ( 'templatesadmin.edithooks.dotbackupfiles.DotBackupFilesHook', )
Dependencies:
There are no external dependencies required for this app. Even if it looks like django-admin, it just needs it Stylesheets. So make sure you have set the settings.ADMIN_MEDIA_PREFIX url.
You have to enable django.contrib.auth and django.contrib.sessions in your INSTALLED_APPS settings.
LICENSE:
This application is licensed under the Beerware License. See LICENSE for details.
Changelog:
v0.5.5 (2009-02-13)
Documented that there is a edithook for mercurial repositories.
Bugfix in GitCommitHook: Allow non-ascii characters.
v0.5.4 (2009-02-13)
Fixed missing templatetags in pypi release.
v0.5.3 (2009-02-03)
Edit-Views now have an optional argument “base_form” to overwrite the default form.
Removed shorten-path functions. They didn’t work under some conditions.
List of templates in the admin overview are shorter.
v0.5.2 (2008-12-12)
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
File details
Details for the file django-templatesadmin-0.5.5.tar.gz
.
File metadata
- Download URL: django-templatesadmin-0.5.5.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61f276d937912a99c8a3a7e40ba041120bea1f15c6d9a2444e27ebfbc91d7fe1 |
|
MD5 | 1ca5f6e77b13b624ad778361674e267b |
|
BLAKE2b-256 | d2a52975f25fbb8f6774c9595cf2476378395b8bf958c00253bcc780791b6e12 |