Problems linking to static files in Django 1.3

亡梦爱人 提交于 2019-12-03 07:59:26

I bet you have your app running at http://localhost:8000, not http://localhost :)

Change

STATIC_URL = 'http://localhost/static/'

to

STATIC_URL = '/static/'

No need for absolute URL there.

I created a folder:

C:\root\workspace\mysite\src\mysite\common

And in my settings, I have:

STATIC_ROOT = 'C:/root/workspace/mysite/src/mysite/static/'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
    "C:/root/workspace/mysite/src/mysite/common/static",
)

This seems to work.

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