1

I got a forbidden message error when I type localhost/project on windows 10. Tried suggestions with

Order allow,deny
Allow from all

Tried also the solution suggested here, without success, conf file of the apache on wamp 2.5 already listens on

Listen 0.0.0.0:80
Listen [::0]:80

Could it be because of the WSGIScriptAlias or WSGIPythonPath? If so see how I've declared it:

WSGIScriptAlias /project "C:/project/project/code.py"
WSGIPythonPath "C:/project/"
<Directory "C:/project/project/">
    <Files code.py>
        Order deny,allow
        Require all granted
    </Files>
</Directory>

Thank you!

As I changed the Files code.py with wsgi.py it worked. The thing is that now I encounter rather different problem. Which I think is related to this one. difference between Apache and Django dev web server

The picture shows the difference between the apache and Django web server. On the left is the address localhost/admin on the right is localhost:8000/admin

could that be because of the mod_wsgi not working properly?

tried to put in settings file STATIC_ROOT and use the command python manage.py collectstatic but without success. Does anybody knows how to be done in django1.8?

Community
  • 1
  • 1
Nick
  • 677
  • 1
  • 11
  • 25
  • Please post the actual error from the Apache error log. – Daniel Roseman Aug 23 '15 at 19:08
  • And is your WSGI file really called `code.py`? Why? – Daniel Roseman Aug 23 '15 at 19:08
  • Thanks for the reply, will post the log later. About the code.py, just followed another 'solution' lost the count already, got confused.. Was it supposed to be wsgi.py ? Is the rest correct? Thanks – Nick Aug 23 '15 at 21:41
  • @DanielRoseman Please see the update of the question, couldn't post it as a comment with the picture. Thanks – Nick Aug 25 '15 at 16:37
  • Update your Apache configuration you give with what you added for hosting of the static files. There should be an Alias directive in there and another Directory block, as per the Django documentation, when hosting static files with Apache. – Graham Dumpleton Aug 26 '15 at 07:19

1 Answers1

0

According to the documentation

Alias /static/ C:/project/static/ <Directory C:/project/static> Require all granted </Directory>

that has been required along with change in the settings.py file

STATIC_ROOT = path to your projects folder (where manage.py is located)

WSGIScriptAlias / C:/project/webpage/wsgi.py WSGIPythonPath C:/project/ <Directory C:/project/webpage> <Files wsgi.py> Order deny,allow Allow from all Require all granted </Files> </Directory>

Thanks to @GrahamDumpleton and @DanielRoseman

Nick
  • 677
  • 1
  • 11
  • 25