troubleshooting
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
CGI execution are not allowed: Edit .htaccess and uncomment Options +ExecCGI
These low level Apache errors can have many causes:
Check: chmod, chown of the handler file (see above)
Check AddHandler , Options in .htaccess (see above)
Check shebang in handler file (e.g.: #!/usr/bin/env python or #!/usr/bin/python )
Check if mod_python is not used. (The default handlers used
fastCGI or
CGI and not mod_python)
You used a not allowed directive in .htaccess file (check apache log)
More tips:
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
SERVE_STATIC_FILES != True (used with developer server)
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 or installed via package management after
PyLucid environment created, aren't accessible in the
PyLucid environment!
To install a new external module into the environment, do this (e.g. install MySQLdb):
Bash .../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 didn't load the initial data with e.g.: ./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). See: setup 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 GIT or
SVN . In this case the python package meta information would not be updated.
You can update via pip. e.g. update django-tools:
Bash ~$ 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 /var/www/YourSite$ ./manage.py diffsettings
You should set settings.ADMINS (and settings.MANAGERS), e.g. use the same people for both:
Python MANAGERS = (( 'John' , 'john@example.com' ), ( 'Mary' , 'mary@example.com' ))
ADMINS = MANAGERS
see also: