python - Django自定义模板标签和过滤器
阿神
阿神 2017-04-18 09:32:41
0
1
705

通过官方手册来自定义了过滤器,自定义过滤器可以使用,但是发现自带的static 无法使用,js,css等没办法加载

阿神
阿神

闭关修行中......

reply all(1)
小葫芦

static is a separate problem
Take http://192.168.0.27:8000/stat... as an example
Project path (the folder where manage.py is located): c:/test/
app path: c: /test/app/

1. Add: STATIC_URL = '/static/' in the setting
That is, directly call the static file in the app path, such as: c:/test/app/static/bootstrap.min.css

2. Add: STATIC_ROOT = os.path.join(BASE_DIR,'static')
You need to execute python manage.py collectstatic
under the c:/test/ path and then call c:/test/static/ The file bootstrap.min.css

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template