如何清除“连接路径位于基本路径组件之外”?

时间:2019-01-31 05:40:01

标签: django

我尝试在python manage.py collectstatic中添加静态填充,但不起作用

settings.py

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'yuvaraj/static/')
]
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

MEDIA_URL = '/media/'

urls.py

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', jobs.views.home, name='home'),
    path('blogs/', include('blogs.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 

0 个答案:

没有答案