mod_Wsgi Problem

13 views
Skip to first unread message

Hassan

unread,
Jan 4, 2012, 5:18:52 AM1/4/12
to Django users
Dear ALL,

i have my application in "C:/mysite"
and i created a wsgi file in "C:/mysite" , that has :

import os
import sys
path = 'C:/mysite'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

and i added this to httpd.conf :
WSGIScriptAlias / "C:/mysite/django.wsgi"

then i restarted my apache and open the local host and got nothing it
gives me the apache defualt page ....

what to do , help me please !!!

Anurag Chourasia

unread,
Jan 4, 2012, 6:32:51 AM1/4/12
to django...@googlegroups.com

Could you try changing your  WSGIScriptAlias in httpd.conf

From 
WSGIScriptAlias / "C:/mysite/django.wsgi"

To
WSGIScriptAlias /MYSITE "C:/mysite/django.wsgi"

And then access http:localhost:port/MYSITE and tell is the results.

Regards,
Anurag

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

kenneth gonsalves

unread,
Jan 4, 2012, 6:36:56 AM1/4/12
to django...@googlegroups.com
On Wed, 2012-01-04 at 17:02 +0530, Anurag Chourasia wrote:
> path = 'C:/mysite'

try putting path = 'C:' (this would work in linux - should work for
windows)
--
regards
Kenneth Gonsalves

Hassan

unread,
Jan 4, 2012, 8:22:11 AM1/4/12
to Django users
i tryed

WSGIScriptAlias /mysite1 "C:/mysite/django.wsgi"
and then http://localhost:8080/mysite1
but i keep geting this :



Forbidden

You don't have permission to access /mysite1 on this server.

what is this , how can i fix it :

Anurag Chourasia

unread,
Jan 4, 2012, 9:22:32 AM1/4/12
to django...@googlegroups.com
You will need to allow apache access to the folder where you have your wsgi script.

Please add this in your httpd.conf and restart apache and see if it helps.

<Directory " C:/mysite/ ">
Order deny,allow
Allow from all
</Directory>

Regards,
Anurag

Hassan

unread,
Jan 4, 2012, 9:45:42 AM1/4/12
to Django users
thnx now its working well , now i want to know how can i serve static
files using apache , and i really still dont understand what is
serving static files is ?

Hope you can help me ,

Guddu

unread,
Jan 4, 2012, 10:11:08 AM1/4/12
to django...@googlegroups.com
Glad that it helped.

For serving static files, you could read through the Django documentation at https://docs.djangoproject.com/en/1.3/howto/static-files/ 

Regards,
Guddu


Hassan

unread,
Jan 4, 2012, 10:17:03 AM1/4/12
to Django users
but now i have another problem , i cant get the admin interface to
work !!! whats missing ??

this is my httpd.conf :

WSGIScriptAlias /mysite "C:/mysite/apache/django.wsgi"
<Directory C:/mysite/apache>

Tom Evans

unread,
Jan 4, 2012, 12:17:24 PM1/4/12
to django...@googlegroups.com
On Wed, Jan 4, 2012 at 3:17 PM, Hassan <haln...@gardeniatelco.com> wrote:
> but now i have another problem , i cant get the admin interface to
> work !!! whats missing ??
>

Please raise a new thread for each separate issue, as this will allow
people to help you more effectively, and the problem/solution will be
more easily found when searching the list archive.

Cheers

Tom

Reply all
Reply to author
Forward
0 new messages