-
Book Overview & Buying
-
Table Of Contents
Django 1.0 Template Development
Now that you've seen the various cache backends that Django offers, we can now start implementing the code to work with them. Regardless of the backend you chose, the code will be identical.
To tell Django which backend we intend to use, we will set a variable called CACHE_BACKEND in our mycompany/settings.py file. Each backend uses a slightly different value, so we'll run through each separately.
In order to use the database caching backend, you also have to run the createcachetable command from the manage.py file. This example uses my_cache_table as the name of the table, but you're free to use whatever you like:
$ python manage.py createcachetable my_cache_tableOnce you have your cache table set up, add the backend to your mycompany/settings.py file:
CACHE_BACKEND = 'db://my_cache_table'
Filesystem caching requires very little setup, and the backend points to an absolute directory path on your filesystem...
Change the font size
Change margin width
Change background colour