1. In setting file:
ROOT_PATH='/home/ronglian/project/taskschedule'
STATIC_URL = '/static/'
STATICFILES_DIRS=(
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
os.path.join(ROOT_PATH,'static'),
)
STATIC_ROOT= ''
2. In above of urls.py file : from django.contrib.staticfiles.urls import staticfiles_urlpatterns
3. Add urlpatterns in urls.py file:
urlpatterns +=staticfiles_urlpatterns() 4. In the project directory, make a new directory file named 'static', the add the css and jquery file in it.
相关文章
- maven编译报错File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
- Django处理文件上传File Uploads的实例
- Type Project has no default.properties file! Edit the project properties to set one.
- 问题1:Project has no default.properties file! Edit the project properties to set one.问题2:The type R is already defined
- django框架模板中定义变量(set variable in django template)的方法分析
- Django 出现 frame because it set X-Frame-Options to deny 错误
- My First Django Project (3) - Apache set up
- Windows下Apache+Django+mod_wsgi的static和media问题处理
- Django中static文件的引入