Cleaned up a little.

This commit is contained in:
Jannis Leidel 2010-06-24 11:43:41 +02:00
parent 982e6f2de7
commit 6536b73a16
3 changed files with 11 additions and 4 deletions

View file

@ -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):

View file

@ -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.

View file

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