PyLucid CMS Logo

test the site Framework

page message
  • Entry for this url doesn't exist.

You can test the site framwork support with the developer server. For this, edit/create a local settings file and insert this:

.../PyLucidTest/PyLucid_env/src/pylucid/pylucid_project/local_settings.py

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import os

_used_port = os.environ.get("USED_PORT")
if _used_port:
    try:
        SITE_ID = int(_used_port[-2:]) + 1 # Used the last two numbers to build the ID
    except ValueError, err:
        print "Error getting site ID from %r (error: %s)" % (_used_port, err)
    else:
        print "Used port is %r -> set SITE_ID: %s" % (_used_port, SITE_ID)
else:
    SITE_ID = 1

You can start more than one developer server, e.g.:

Start with SITE_ID == 1:

Bash
1
.../PyLucidTest/PyLucid_env$ ./manage.sh runserver 8000

After this you can start a second test server on different port. Open a second terminal and start the second test server:

Bash
1
.../PyLucidTest/PyLucid_env$ ./manage.sh runserver 8001

This starts a server with SITE_ID == 2.

Important: Before you can use a SITE ID > 1 you must login (on the site with ID==1) an create the site entries in the django admin panel.
The initial database fixtures does only create site ID 1!

↑ setup  #

↑ different languages  #

If sites should have different system default languages you can do something like this in your local_settings.py:

Python
1
2
3
4
if SITE_ID == 1:
    LANGUAGE_CODE = "en"
elif SITE_ID == 2:
    LANGUAGE_CODE = "de"
0 comments for 'test site Framework':
    there exist no comment for 'test site Framework'
Leave a comment
tag navi documentation | sites | v0.9

django-processinfo: 6.3 ms of 260.0 ms (2.4%)