From 6536b73a16f786abc8725514b3caef793bfd15e4 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Jun 2010 11:43:41 +0200 Subject: [PATCH] Cleaned up a little. --- dbtemplates/cache.py | 10 +++++++--- dbtemplates/models.py | 3 +++ example/urls.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dbtemplates/cache.py b/dbtemplates/cache.py index 43b6a21..9d9de41 100644 --- a/dbtemplates/cache.py +++ b/dbtemplates/cache.py @@ -1,9 +1,8 @@ import os from django.conf import settings from django.core.cache import cache -from django.template import TemplateDoesNotExist from django.core.exceptions import ImproperlyConfigured -from django.utils.encoding import smart_unicode, force_unicode +from django.utils.encoding import force_unicode class BaseCacheBackend(object): """ @@ -65,7 +64,12 @@ class FileSystemBackend(BaseCacheBackend): if not os.path.isdir(self.cache_dir): pass except: - raise ImproperlyConfigured("You're using the dbtemplates file system cache backend without having set the DBTEMPLATES_CACHE_DIR setting to a valid value. Make sure the directory exists and is writeable for the user your Django instance is running with.") + raise ImproperlyConfigured( + "You're using the dbtemplates file system cache backend " + "without having set the DBTEMPLATES_CACHE_DIR setting to a " + "valid value. Make sure the directory exists and is writeable " + "for the user your Django instance is running with." + ) super(FileSystemBackend, self).__init__() def _filepath(self, name): diff --git a/dbtemplates/models.py b/dbtemplates/models.py index a28ee08..1d8ff2d 100644 --- a/dbtemplates/models.py +++ b/dbtemplates/models.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from datetime import datetime + from django.db import models from django.db.models import signals from django.utils.translation import gettext_lazy as _ @@ -11,6 +12,8 @@ from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from dbtemplates import settings + + class Template(models.Model): """ Defines a template model for use with the database template loader. diff --git a/example/urls.py b/example/urls.py index bac836e..b52a3a6 100644 --- a/example/urls.py +++ b/example/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls.defaults import patterns # Uncomment the next two lines to enable the admin: from django.contrib import admin