📌  相关文章
📜  NameError: name 'MEDIA_URL' is not defined - 不管是什么代码示例

📅  最后修改于: 2022-03-11 14:57:58.506000             🧑  作者: Mango

代码示例1
from django.conf import settings

# ... your normal urlpatterns here

if settings.DEBUG:
    # static files (images, css, javascript, etc.)
    urlpatterns += patterns('',
        (r'^media/(?P.*)$', 'django.views.static.serve', {
        'document_root': settings.MEDIA_ROOT}))