Reputation: 339
previous, i using "manage.py runserver" to run django, now, i want to use xampp. i copied mod_wsgi.so to xampp/apache/modules. project demo have: init.py, manage.py, settings.py, urls.py, views.py, django.wsgi django.wsgi:
import os
import os.path
import sys
sys.path.append('.../xampp/htdocs/demo')
os.environ['DJANGO_SETTINGS_MODULE'] = 'demo.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
views.py:
from django.shortcuts import render_to_response
from django.http import HttpResponse
def index(request):
return HttpResponse('hello world')
urls.py:
(r'^', views.index),
it isn't working?
Upvotes: 2
Views: 3796
Reputation: 58523
You need to also add:
sys.path.append('.../xampp/htdocs')
for a start.
BTW, very very bad to be putting Django site under htdocs (document root) of web server. This can make your source code include settings file with database password downloadable depending on other Apache configuration.
Also, make sure you Apache is working first by using a WSGI hello world program rather than Django site.
Upvotes: 2
Reputation: 31643
Have you configured mod_wsgi
in Apache configuration file ?
See: http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
Upvotes: 0