39👍
Apparently this is an issue that is related to Apache 2.4 and older versions.
You need to replace in your apache configuration:
Allow from all
with
Require all granted
in the <Files wsgi.py>
section
👤Sdra
16👍
You can use the following:
<Directory /home/aettool/aet/apache>
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
- [Django]-Dynamically adding a form to a Django formset
- [Django]-How to mock python's datetime.now() in a class method for unit testing?
- [Django]-Django: Difference between using server through manage.py and other servers like gunicorn etc. Which is better?
4👍
This has been reported in Django ticket 19319:
https://code.djangoproject.com/ticket/19319
Your Apache config now needs the following for your file wsgi.py
.
<Directory /path/to/your/wsgi-script>
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
</Directory>
- [Django]-How to combine multiple QuerySets in Django?
- [Django]-Django Custom User Email Account Verification
- [Django]-ImportError: cannot import name 'six' from 'django.utils'
3👍
There is one other gotcha:
Check your httpd.conf file for the following configuration:
<IfModule mime_module>
AddHandler cgi-script .cgi .pl .py
</IfModule>
This will cause the error.
.py MUST NOT be configured as a CGI script
- [Django]-'function' object has no attribute 'as_view'
- [Django]-How can I turn Django Model objects into a dictionary and still have their foreign keys?
- [Django]-Django content-type : how do I get an object?
-1👍
Linux systems usually don’t allow other users to read inside the home directory, and as Apache runs as root, mod_wsgi will not be able to access the inside of the home directory.
Try:
sudo chmod 755 /home/<username>
- [Django]-Is there a function for generating settings.SECRET_KEY in django?
- [Django]-Django set field value after a form is initialized
- [Django]-Django: Redirect logged in users from login page
Source:stackexchange.com