Hi. Im trying to install django on my Dreamhost domain. I have followed
the dreamhost wiki and the guide on
http://www2.jeffcroft.com/2006/may/11/django-dreamhost/  about 4 times
now, and the last 3 times I get the same 503 error when I try to login
to admin.

Before I installed admin I get the "It worked, Congratulations on your
first Django-powered page" when I try to access my django.mydomain.com.


Then I try to install the admin and the .htaccess file. Now I get a
nice django 404 error on the django.mydomain.com. But when I try to
access django.mydomain.com/admin I get the username and password page
(without css) and I login with the superuser I created, but I only get
a regular 503 http error when I submit.

In the error log i get this error:

mod_security: Access denied with code 503. Pattern match
"(go\\.to|get\\.to|drop\\.to|hey\\.to|switch\\.to|dive\\.to|move\\.to|again\\.at)"
at HEADER. [hostname "django.mydomain.com"] [uri "/admin/"]

Can anyone check if my settings is correct?


settings.py:
===============================
# Django settings for myproject project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
     ('Tomas', '[EMAIL PROTECTED]'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'mysql'           # 'postgresql', 'mysql', 'sqlite3'
or 'ado_mssql'.
DATABASE_NAME = 'django_db'             # Or path to database file if
using sqlite3.
DATABASE_USER = 'tomas'             # Not used with sqlite3.
DATABASE_PASSWORD = '****'         # Not used with sqlite3.
DATABASE_HOST = 'djangodb.mydomain.com'             # Set to empty
string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. All choices can be found here:
#
http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/home/tomasjac/django.mydomain.com/media/'

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com";
MEDIA_URL = 'http://django.mydomain.com/media'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/admin_media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '***'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'myproject.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates".
    # Always use forward slashes, even on Windows
        "/home/tomasjac/django/django_templates"
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
)

===============================

django.fcgi:
===============================
#!/usr/bin/env python
import sys
sys.path += ['/home/tomasjac/django/django_src']
sys.path += ['/home/tomasjac/django/django_projects']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
WSGIServer(WSGIHandler()).run()

===============================

.htaccess:
===============================
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(django\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ django.fcgi/$1 [L]

===============================
I
Inside my django.mydomain.com I have a folder called "admin_media".

I have used the command:

ln -s $HOME/django/django_src/django/contrib/admin/media
$HOME/django.mydomain.com/admin_media

And when I look insidethe "admin_media" folder with ftp I see a another
folder called "media" with a shortcut icon on, but when I try to access
it I get a "550 media: No such file or directory". Is this normal?

I hope someone could help me. Im really stuck!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to