Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 让django设置从中使用/django/pathhttp://localhost/django/_Python_Django_Apache_Wsgi - Fatal编程技术网

Python 让django设置从中使用/django/pathhttp://localhost/django/

Python 让django设置从中使用/django/pathhttp://localhost/django/,python,django,apache,wsgi,Python,Django,Apache,Wsgi,我在Apache2 virtualhost配置中有这个WSGIScriptAlias/django//path/to/app 我使用django admin startproject myapp创建项目。 但是当我去的时候,我通过Django得到一个404错误 如果我将virtualhost配置更改为just/并重新启动apache2。它可以工作,但我将其用于其他事情,因此需要使用virtualhost和/django/sub路径。但看起来Django的工作方式并不正确 Page not

我在Apache2 virtualhost配置中有这个WSGIScriptAlias/django//path/to/app

我使用django admin startproject myapp创建项目。 但是当我去的时候,我通过Django得到一个404错误 如果我将virtualhost配置更改为just/并重新启动apache2。它可以工作,但我将其用于其他事情,因此需要使用virtualhost和/django/sub路径。但看起来Django的工作方式并不正确

    Page not found (404)
    Request Method: GET
    Request URL:    http://localhost/django/
    Using the URLconf defined in djangoexamplecom.urls, Django tried 
    these URL patterns, in this order:

    ^admin/
    The empty path didn't match any of these.
    You're seeing this error because you have DEBUG = True in your 
    Django settings file. Change that to False, and Django will 
    display a standard 404 page.
我猜当运行django admin startproject时,它希望应用程序以默认URL运行,即没有子路径


我是否需要编辑url.py或settings.py以使用/django/?

是-是否希望/django/route成为存储项目目录的基本根目录?嗯,该路径实际上只是别名。所以我假设这意味着对项目来说,它是基本路径?如果是,那么是的。