Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.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不断加上“;app";即使DEBUG=True,也要在heroku中创建媒体URL_Python_Django_Heroku - Fatal编程技术网

Python Django不断加上“;app";即使DEBUG=True,也要在heroku中创建媒体URL

Python Django不断加上“;app";即使DEBUG=True,也要在heroku中创建媒体URL,python,django,heroku,Python,Django,Heroku,这是我在Heroku上运行应用程序时从未出现过的新错误。但是,我现在使用的是Heroku Postgres SQL,因此可能会导致问题 无论如何,我有我的媒体URL和媒体根集 STATIC_ROOT = os.path.join(BASE_DIR, "portfoliosite", "staticfiles") STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DI

这是我在Heroku上运行应用程序时从未出现过的新错误。但是,我现在使用的是Heroku Postgres SQL,因此可能会导致问题

无论如何,我有我的媒体URL和媒体根集

STATIC_ROOT = os.path.join(BASE_DIR,  "portfoliosite", "staticfiles")


STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "portfoliosite", "static"),
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
这在我的本地服务器上运行良好。然而,在生产模式下,Django一直在媒体URL的开头添加“app/”

有人知道这里会发生什么吗

这里是404错误

Request Method: GET
Request URL:    https://www.remosingh.ca/media/images/newlogo_1_TlcOlPh.png
Raised by:  django.views.static.serve
“/app/media/images/newlogo_1_TlcOlPh.png” does not exist

打印时BASE_DIR解析为什么?打印时BASE_DIR解析为什么?