如何访问Django上的子目录?
我制作了django应用,其中包含2个视图,“ /”和“ / config”。 http://example.com/ http://example.com/config
它可以在“ python manage.py runserver”上使用。 因此,我尝试将其部署到Windows10上的Apache。
然后发生了问题。
应用程序可以查看“ http://example.com/”,但不能查看“ http://example.com/config”。 浏览器显示“禁止”。所以我认为这是访问权限问题。
首先,我检查它是目录的所有者/权限错误。但是操作系统是Windows。所以我认为这不是原因。
如何在Windows10的Apache上使用应用程序?
【环境】
【目录(httpd.conf)】
<Directory C:/apps/mysite/appname>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
【urlpatterns】
urlpatterns = [
path('', views.index, name='index'),
path('config', views.config, name='config'),
]