Template loader for database stored templates
Project description
This is a basic database template loader for Django which uses a m2m relationship to provide a site centric template loading.
How to use it in your own Django application
Get the source from the subversion repository
Follow the instructions in the INSTALL file
Edit the settings.py of your Django project:
Add dbtemplates to the INSTALLED_APPS of your django project
Check if django.contrib.sites and django.contrib.admin are in INSTALLED_APPS and add if necessary.
It should look something like this:
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', 'dbtemplates', 'myapp.blog', )
Add dbtemplates.loader.load_template_source to the TEMPLATE_LOADERS list in the settings.py of your Django project
It should look something like this:
TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', 'dbtemplates.loader.load_template_source', )
Sync your database via shell (hint: “./manage.py syncdb” within project dir)
Restart your Django server
Go to the admin interface and add templates by filling the name field with filename like identifiers, for example “blog/entry_list.html”
Use it with Flatpages, Generic views and your own custom views
Support
Please leave your questions and messages on the designated Google Code site:
Project details
Release history Release notifications | RSS feed
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-dbtemplates-0.4.7.tar.gz
.
File metadata
- Download URL: django-dbtemplates-0.4.7.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03258a16b5c47224d0791af2c3e59b92a0398f11e4cf68d42f761054a6602b72 |
|
MD5 | ee78528dab580c8937b3b60149986d5e |
|
BLAKE2b-256 | bae1199a172455556f76f1d485f13ebde0bc20959627d63d355323d70dd50409 |