0

I have got Ubuntu 10.04 (XEN) VPS. I want to set up Django server. I use apt-get to install django packages, apache, apache-mpm-prefork. Before using this configuration I saw "It works!" title, when I use ip/domain to get access to the server. After using configuration I saw:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. 

I found my django folder in this directory: /usr/local/lib/python2.7/dist-packages/django/ , while using find command to 'django-admin.py' (also, such file at /usr/local/bin) and put there folder from my development computer. So, this is my configuration:

<Location "/">
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE projectname.settings
  PythonDebug Off
  PythonAutoReload Off
  PythonPath "['/usr/local/lib/python2.7/dist-packages/django','/usr/local/lib/python2.7/sidt-packages/django/bin/projectname'] + sys.path"
</Location>

<Location "/media/">
  SetHandler None
</Location>

<Location "/static/">
  SetHandler None
</Location>

What is wrong with my configuration? And how can I found information about errors, I can't understand what I must search to fix.

Dracontis
  • 125
  • 1
  • 2
  • 7
  • Check the Apache error log, which should be in `/var/log/apache2/error.log` - that 500 error should be logging errors in that file. Edit your question with interesting lines. – Shane Madden Aug 15 '11 at 20:25
  • I thought python and mod_python debug isn't same thing. I enable it and got import error. – Dracontis Aug 15 '11 at 20:29
  • Fixed import error. Got 'template does not exist'. Also, I can get access to static files. – Dracontis Aug 15 '11 at 20:43

1 Answers1

1

Where's the Django project located? You'll need to point your PythonPath at the project, not necessarily the Django library files.

It's configured to look in /usr/local/lib/python2.7/sidt-packages/django/bin/projectname; that should be "site-packages" instead, but confirm that that's where the project files are located (is "projectname" correct?).

Shane Madden
  • 112,982
  • 12
  • 174
  • 248