Skip to main content

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

  1. Get the source from the subversion repository

  2. Follow the instructions in the INSTALL file

  3. 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',
    )
  4. Sync your database via shell (hint: “./manage.py syncdb” within project dir)

  5. Restart your Django server

  6. Go to the admin interface and add templates by filling the name field with filename like identifiers, for example “blog/entry_list.html”

  7. Use it with Flatpages, Generic views and your own custom views

Support

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-dbtemplates-0.4.6.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file django-dbtemplates-0.4.6.tar.gz.

File metadata

File hashes

Hashes for django-dbtemplates-0.4.6.tar.gz
Algorithm Hash digest
SHA256 e6fb8c3f36f938d7dd4932022702fbc794983681936dd1f0b7dbea39cff6ced2
MD5 3bfdf3b53c517af44dcb11996b73db99
BLAKE2b-256 5cfdc548477319afcdfe43a33b9e79771fa957c9d6b38c98e168a9024e070c80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page