Django template loader for database stored templates with extensible cache backend
Find a file
leidel d984b45540 Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket.
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@65 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 49af8f284937e75d0878354684fb1ce9addb04a0
2008-11-09 13:55:20 +00:00
dbtemplates Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket. 2008-11-09 13:55:20 +00:00
docs Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket. 2008-11-09 13:55:20 +00:00
INSTALL Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket. 2008-11-09 13:55:20 +00:00
LICENSE new management command 'sync_templates' for syncing the templates bidirectional 2008-05-13 22:34:38 +00:00
MANIFEST.in Changed extension of README to use Github's formatting 2008-08-23 23:31:22 +00:00
README.rst Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket. 2008-11-09 13:55:20 +00:00
setup.py Removed old sync_templates.py script, use the django-admin.py sync_templates please. Removes unneeded code that registers the model with django-reversion manually. Updated docs after move from Google Code to Bitbucket. 2008-11-09 13:55:20 +00:00

===================================
Database template loader for Django
===================================

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
============================================

0. Get the source from the subversion repository
1. Follow the instructions in the INSTALL file
2. 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',
       )

3. Sync your database via shell (hint: "./manage.py syncdb" within project dir)
4. Restart your Django server
5. Go to the admin interface and add templates by filling the ``name`` field
   with filename like identifiers, for example "blog/entry_list.html"
6. Use it with ``Flatpages``, ``Generic views`` and your own custom views

Support
=======

Please leave your questions and messages on the designated site:

http://www.bitbucket.org/jezdez/django-dbtemplates/issues/