Django,Mod_WSGI和Apache2.4返回403,并要求全部授予

时间:2019-02-01 04:52:52

标签: django mod-wsgi apache2.4

对不起,我是服务器配置的新手,我上个月一直在尝试让django项目在WWW上实时运行。

我已经解决了403错误;

我搜索堆栈溢出;

  1. Apache2 mod_wsgi 403 forbidden error
  2. Django + wsgi = Forbidden 403
  3. Django with mod_wsgi returns 403 error
  4. 403 Forbidden error with Django and mod_wsgi
  5. Django, mod_wsgi and apache2.4 = problems
  6. Django + mod_wsgi + Apache = 403 Forbidden

但是我得到的唯一答案就是编写以下代码;

<Directory C:\Frontier_Website\FrounterWebApp\FronterWeb>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

允许访问,但仍显示错误403。

我尝试使用虚拟环境,但是出现配置问题并导致错误500

这是我的代码: 仅mod_wsgi区域的httpd Apache代码

##setting of the Apache httpd config for mod_wsgi
LoadModule wsgi_module "C:\users\user\appdata\local\programs\python\python37\lib\site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIScriptAlias / "C:\Frontier_Website\FrounterWebApp\FrounterWeb\wsgi.py"
WSGIPythonPath "C:\Frontier_Website\FrontierWebApp\zigview"
WSGIPythonHome "C:\Users\user\AppData\Local\Programs\Python\Python37"

<Directory C:\Frontier_Website\FrounterWebApp\zigview\static>
Require all granted
</Directory>

<Directory C:\Frontier_Website\FrounterWebApp\FronterWeb>
<Files wsgi.py>
Require all granted
</Files>
</Directory> 

wsgi.py代码;

#wsgi in my poject
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FrounterWeb.settings')

application = get_wsgi_application()

如果您能帮助我的话,我真的是徒弟,因为我想用不同的形式问这个问题的乘法时间,然后答复。

0 个答案:

没有答案