PyLucid CMS Logo

Some advanced setup steps

Here you can find some advanced setup stuff.

↑ Cache  #

It's strongly recommended that you setup the cache backend!

PyLucid can cache all CMS Pages for anonymous users. For this you must setup the django CACHE_BACKEND variable in your settings.py Information about this is here: http://www.djangoproject.com/documentation/cache/

The easiest way is to use Filesystem caching. In the _install section use "Available cache backend test".

↑ Multiple Webpages  #

You can serve more than one webpage with only one PyLucid "installation"... PyLucid uses one database per site, but you can easy switch the database based on the host:

Python
1
2
3
4
5
6
7
8
host = os.environ.get("HTTP_HOST", "")

if "domain1.tld" in host:
    DATABASE_NAME = "db_1"
elif "domain2.tld" in host:
    DATABASE_NAME = "db_2"
else:
    DATABASE_NAME = "db_3"

If you used the filesystem cache you must use a unique cache per host. You can use this:

Python
1
CACHE_BACKEND = 'file:///tmp/PyLucid_cache_%s' % os.environ.get("HTTP_HOST", "")

Note: This example code only works with CGI! Not in a fastCGI environment! For fastCGI you can set HTTP_HOST in the dispacter files.

0 comments for 'advanced steps':
    there exist no comment for 'advanced steps'
Leave a comment

django-processinfo: 5.7 ms of 274.9 ms (2.1%)