django-dbtemplates/template
leidel 7c5c4b3b4c Further corrections
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@8 cfb8ba98-e953-0410-9cff-959ffddf5974

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

--HG--
extra : convert_revision : c96834e4636755e0267ea2d912c22729e96d780f
2007-02-23 19:53:06 +00:00
..
loaders Added README and LICENSE 2007-02-23 19:25:35 +00:00
__init__.py initial commit 2007-02-23 19:03:20 +00:00
LICENSE Added README and LICENSE 2007-02-23 19:25:35 +00:00
management.py initial commit 2007-02-23 19:03:20 +00:00
models.py initial commit 2007-02-23 19:03:20 +00:00
README Further corrections 2007-02-23 19:53:06 +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. Copy the "template" directory to your django project directory
2. Edit your settings.py:

    # Add ``myapp.template`` to the ``INSTALLED_APPS`` where "myapp" is the
      name 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',
            'myapp.blog',
            'myapp.template',
        )
    
    # Add ``myapp.template.loaders.database.load_template_source`` to the
      ``TEMPLATE_LOADERS`` where "myapp" is the name 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',
            'myapp.template.loaders.database.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

What? Hm, doesn't work here. || Aaah nice, BUT...
=================================================

Please leave your questions and messages on the designated Google Code site:

    http://code.google.com/p/django-databasetemplateloader/