Apache handle the script as a text file, so you see the sourcecode in the browser.
There are several reasons for this:
The index.fcgi / index.cgi script is not executable. Do e.g.: chmod +x index.fcgi
Apache doesn't know to handle this file: Edit your .htaccess and uncomment the suitable AddHandler line
You haven't change in index.fcgi / index.cgi the path to the created
PyLucid environment. Please read the error page, there is the path to the file you must edit.
If you get this or a similar error:
The path to the static files (like "jquery.js" or "pylucid_js_tools.js" etc) is wrong
The Webserver didn't send the files
These settings are responsible for the path generation:
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 # Note: Every URL/path...
# ...must be a absolute path.
# ...must have a trailing slash.
# Absolute _local_filesystem_path_ to the directory that holds media.
# Example-1: ".../media/" (default)
# Example-2: "/home/foo/htdocs/media/"
MEDIA_ROOT = os . path . join ( PYLUCID_BASE_PATH , "media" ) + "/"
# URL that handles the media served from MEDIA_ROOT.
# Example-1: "/media/" (default)
# Examlpe-2: "http://other_domain.net/media/"
# Example-3: "http://media.your_domain.net/"
MEDIA_URL = "/media/"
# URL prefix for admin media -- CSS, JavaScript and images.
# Examples-1: "/django/contrib/admin/media/" (default)
# Examples-2: "http://other_domain.net/media/django/"
# Examples-3: "http://django.media.your_domain.net/"
ADMIN_MEDIA_PREFIX = "/django/contrib/admin/media/"
Note: PYLUCID_BASE_PATH is the absolute path to
PyLucid settings.py - You must change MEDIA_ROOT in your local_settings.py
Please note: New modules, installed in the normal python environment after the
PyLucid environment created, aren't accessible in the
PyLucid environment!
To install a new external module, you can do this (e.g. install MySQLdb):
Bash 1
2 .../PyLucidTest$ cd PyLucid_env/bin
.../PyLucidTest/PyLucid_env/bin$ ./easy_install MySQL-python
In some case the
PyLucid own login view can't work. You can use the django own plaintext login form:
enable debug mode (set DEBUG=True in local_settings.py)
Add any GET parameter to the admin url, e.g: yoursite.tld/admin/?foobar
If you get this error, this can have two causes:
The database is empty. You must insert the initial data with ./manage.sh loaddata
pylucid .json
The site ID doesn't exist. You have to change the ID in your local_settings.py file or add the site in the Django admin site (Use a other, working domain/site).
Traceback looks like: http://dpaste.com/186070/
If you get this error, this can have two causes:
A python package is outdated. This can happen, if you update a package via
SVN . In this case the python package meta information would not be updated.
You can update via pip. e.g. update django-tools:
Bash 1
2
3 ~$ cd /PyLucid_env/bin
~/PyLucid_env/bin$ source activate
( PyLucid_env) ~/PyLucid_env/bin$ pip install --upgrade --verbose --editable= svn+http://django-tools.googlecode.com/svn/trunk/#egg= django-tools
or use update script in /scripts/update_test_env.sh up upgrade all packages with pip.
There is no database connection info in the used settings. This can happens in different situation.
You didn't have a local_settings.py
You didn't insert database connection info in your local_settings.py
Your local_settings.py didn't used
To be sure whether your local_settings.py is being used do the following:
check your directory and file structure :
local_settings.py , manage.py and index.fcgi must be contained together, e.g. in: /var/www/YourSite/
your current work dir should be /var/www/YourSite/
(so manage.py from /var/www/YourSite/ would be used)
You can display your changed settings with diffsettings , e.g.:
Bash 1 /var/www/YourSite$ ./manage.py diffsettings