亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

python - py2.7.12 + django version 1.11 native static file configuration problem
伊謝爾倫
伊謝爾倫 2017-07-04 13:45:41
0
1
1131

win xp system python2.7.12 django 1.11 version

Configuration in

settings.py:
STATIC_URL = '/statics/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, "statics"),)

Static files are stored in: root directory/statics/bbs/ below

Root directory: templates/bbs/index.html inside
{% load static %} See someone using it in the template

<link rel="stylesheet" type="text/css" media="screen" href="{% static "bbs/style.css" %}">

<img src="{% static "bbs/aaa.png" %}">

Now open the homepage and find that jpg, png and other image files can be displayed normally on the homepage. It can be accessed normally through the URL: http://127.0.0.1:8000/statics...

But the homepage of .css, js and other files cannot be loaded normally. But it can be accessed and downloaded normally through the URL: http://127.0.0.1:8000/statics...

I saw some tutorials saying to create static files under the app application. But I don’t know what’s wrong with the settings above? How should it be handled?

Do not know what is the reasons of that? Not configured properly?

This is the console running diagram:

All 304 pictures can come out. css js does not work in front. But using a direct URL will work.

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學PHP伐。

reply all(1)
過去多啦不再A夢

Write like this

<link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_URL }}bbs/style.css">
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template