Django Setup Information
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Setup
Django is supported with our Python package.
- Firstly create a new directory in your "htdocs".
- Upload your Django files into this directory.
- Sync your online database with the new application.
mod_python handler
A ".htaccess" file needs to be created to run the Django application
handler. The contents of the file is similar to the following:
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/[yourusername]/htdocs'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE [yourappname]/settings
PythonDebug On
Please replace "[yourusername]" and "[yourappname]" with the your actual
account username and application directory. you will need to upload this file in UNIX format not Windows.
Configuration settings
Please use the values below in your application's "settings.py" file.
| ADMIN_MEDIA_PREFIX |
|
/django-admin-media/ |
| DATABASE_NAME |
|
db_[yourusername] |
| DATABASE_USER |
|
[yourusername] |
| DATABASE_PASSWORD |
|
[yourpassword] |
| DATABASE_HOST |
|
mysql.int.devisland.net |
URL patterns
Here is an example "urls.py", please take note of the missing "^" as
this allows you to upload multiple applications in different directories.
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
(r'[yourappname]/', include('[yourappname].foo.urls')),
# Uncomment this for admin:
(r'admin/', include('django.contrib.admin.urls')),
)
|