zoukankan      html  css  js  c++  java
  • Django Static 配置

    BASE_DIR = os.path.dirname(os.path.dirname(__file__))

    SITE_ROOT=os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')
    STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
    MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
    STATIC_URL = '/static/'

    # Additional locations of static files
    STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    ("css", os.path.join(STATIC_ROOT,'css')),
    ("js", os.path.join(STATIC_ROOT,'js')),
    ("img", os.path.join(STATIC_ROOT,'img')),
    ("fonts", os.path.join(STATIC_ROOT,'fonts')),
    ("data", os.path.join(STATIC_ROOT,'data')),
    ("media", os.path.join(STATIC_ROOT,'media')),
    )
  • 相关阅读:
    The first appliaction for "Hello World!"
    zone
    learn to study
    深入理解 Angular 2 变化监测和 ngZone
    看看吧
    生命周期钩子
    一个简单的todo
    依赖注入
    @Output()
    @Input
  • 原文地址:https://www.cnblogs.com/hylinux/p/9504164.html
Copyright © 2011-2022 走看看