On Aug 14, 12:52 pm, John Yeukhon Wong <gokoproj...@gmail.com> wrote: > Hi, Graham. > > I watched the video and your pdf up until the point you ran the wsgi > successfully. > > I restarted the apache and bottom of the apache monitor said "Apache/ > 2.2.16(Win32) mod_wsgi/3.3Python/2.7", and also I could see localhost > again. I can see the blue page. > > I am sorry if I sound too stupid, but I am pretty new... > > 1. Don't put the hello.wsgi and any wsgi app under the home directory. > Is it F:/public (where my django project testproject is located)? So I > should create a folder outside public right?
The example directories in the talk were based on a UNIX system being used, not Windows. The naming of the directories is not important. The lesson to be learnt from that part is that directories/files have access permissions. The Apache web server runs as a special user and that special user needs to have adequate privileges to access where you put stuff. How you change permissions on directories/files will be different on Windows to Linux, but it is still an issue you need to be mindful off. Anyway, you are missing the point. My original message said to look at the Apache error log file, which is possibly different to the Apache monitor you are using as I don't know what you are referring to there. In the Apache error log you would have found an error from Apache as to what caused the 403, on the basis that your original quoted message was from the browser and matched what Apache would produce. What was that error message? From that you would have a clue as to what you haven't configured properly. > 2. If so, do I add this following code to the wsgi conf file ? > <Directory f:/wsgiapp> > Order deny,allow > Allow from all > </Directory> You will something like that, but the directory path depends on where you are putting your files. That part of your original quoted configuration looked fine, yet problems with that can be the cause for a 403, which is why I asked you to go find the error message in the Apache error logs. > 3. I try to access to localhost/hello.wsgi but it's still giving me If you were following the configuration like in the talks, you wouldn't be accessing 'localhost/hello.wsgi'. This is because the examples did not use the name of the script file in the URL. > the same blue django default page.... Well, if you have blue Django default page then you must have something working, but can't say I know what or how cause you never responded with the details for why the 403 error occurred from the logs. You must have just lucked onto the right thing. Graham > Thank you for the help!!!! > > On Aug 13, 10:01 pm, Graham Dumpleton <graham.dumple...@gmail.com> > wrote: > > > > > On Aug 14, 11:26 am, John Yeukhon Wong <gokoproj...@gmail.com> wrote: > > > > Hi, I know most of you work on Linux, but I do need this to be done on > > > Windows for a very personal reason. > > > > I mainly followed this tutorial here, except that I use mod_wsgi over > > > mod_python.http://wiki.thinkhole.org/howto:django_on_windows > > > > I had my python 2.7, apache, mod_wsgi and postreg all installed under > > > my F drive. > > > This is the folder: F:/public, and I created a project called > > > testproject, so I have F:/public/testproject > > > > I am stuck at configuration Django with Apache (and mod_wsgi). > > > I spent 5 hours searching and reading the documentation and still > > > can't figure out how to do it right. > > > > I read thishttp://code.google.com/p/modwsgi/wiki/IntegrationWithDjango > > > > I created two files: apache_django_wsgi.conf and django.wsgi under F:/ > > > public/testproject/apache, where apache is a manual created folder. > > > The actual Apache is installed under F:/Apache Software Foundation/ > > > Apache2.2 > > > > I did these for Apache2.2/conf/httpd.conf > > > > LoadModule wsgi_module modules/mod_wsgi.so > > > Include "f:/public/testproject/apache/apache_django_wsgi.conf" > > > > So good so far. No error after restart ApACHE. > > > > Now, I have to setup those two files. > > > > I had this for the conf (I just copied it from the google doc....) > > > > # Code begin here > > > Alias /media/ f:/public/testproject/media/ > > > > <Directory f:/public/testproject/media> > > > Order deny,allow > > > Allow from all > > > </Directory> > > > > WSGIScriptAlias / "f:/public/testproject/apache/django.wsgi" > > > > <Directory "f:/public/testproject/apache"> > > > Order deny,allow > > > Allow from all > > > </Directory> > > > #Code ends here > > > > However, I was suspecting something bad to happen... > > > > OKay. For django.wsgi > > > > // code begins here > > > import os, sys > > > sys.path.append("f:/public") > > > > os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings' > > > > import django.core.handlers.wsgi > > > application = django.core.handlers.wsgi.WSGIHandler() > > > > // code ends here > > > > This one is better - I know the info is good and correct. > > > > Now I restarted the apache again, no error. > > > > But when I try to access to my localhost or localhost/testproject I > > > received this message > > > > Forbidden: You don't have permission to access /testproject/ on this > > > server. > > > > I was denied, I don't know why we need that script anyway... > > > > How should I set it up? How do I test if everything is working well? > > > Did you try and walk before you ran? ;-) > > > That is, did you try getting a WSGI hello world program working before > > you decided to try and get Django site to work? > > > Anyway, you need to look at the Apache error logs to find out the > > actual reason why Apache has given you a 403 error. > > > I suggest you also go watch my mod_wsgi talk where it references > > exactly why you get some of these problems, including Forbidden > > errors, with examples of the errors you will see in Apache error log. > > Links to talk at: > > > http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_... > > > Graham -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.