Django: STATIC_URL adds appname to the url

落爺英雄遲暮 提交于 2019-12-01 11:03:34

Since you're using the django built-in developement server, try to remove the following line from your urls.py:

urlpatterns += staticfiles_urlpatterns()

In production, you'de better not serve static files with django, so use the collectstatic command.

edit

If settings.py, try something like this:

STATIC_ROOT = os.path.join(os.path.dirname(__file__), '../../static')
STATIC_URL = '/static/'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!