zoukankan      html  css  js  c++  java
  • Set a static file on django

        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.
  • 相关阅读:
    css3多列
    伪元素
    text文本样式二
    透明登录框
    透明度设置opacity
    超链接
    meta标签
    奇偶选择器
    OC跟Swift混编
    Swift中as as! as?的区别
  • 原文地址:https://www.cnblogs.com/allenz/p/4756189.html
Copyright © 2011-2022 走看看