0

Environment and version: Windows 8-64bit, Wamp Apache 2.4.9, Python 3.4.2, Django 1.8

Deploying Django with apache using wsgi.py

followed following post got mod_wsgi setup

WSGIScriptAlias /mysite/mysite/wsgi "C:/wamp/www/mysite/mysite/wsgi.py"
WSGIPythonPath "C:/wamp/www/mysite/mysite/"

<Directory "C:/wamp/www/mysite/mysite/">
<Files wsgi.py>
Order deny,allow
Require all granted
</Files>
</Directory>

Directory:

wamp | www | testweb1 manage.py | testweb1 - settings.py - urls.py - wsgi.py

Inside wsgi.py(original code):

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testweb1.settings")

application = get_wsgi_application()

The problem is when starting Wamp Apache server, the icon appear green. Server Online

But when I enter my ip address and port, for example 125.138.0.1:8080

The page only gives me this:

Apache/2.4.9 (Win64) mod_wsgi/4.4.2 Python/3.4.2 PHP/5.5.12 Server at 125.138.0.1 Port 8080

I had done so many research and followed the doc from https://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

tried many ways in wsgi.py , still couldn't get let Apache the deploy Django site from home IP address

By the way, in Apache httpd.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Also tried https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/

os.environ["DJANGO_SETTINGS_MODULE"] = "{{ project_name }}.settings"

1 Answer 1

2

Your WSGIScriptAlias setting is wrong. The first argument should be the path you want your application served at, which is usually the root. So:

WSGIScriptAlias / "C:/wamp/www/mysite/mysite/wsgi.py"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.