コード例 #1
0
ファイル: settings.py プロジェクト: ManchesterIO/mancunia
MEDIA_URL = '/site-media/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'compiled_media/')
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
CACHE_DIR = os.path.join(PROJECT_ROOT, 'cache')
MARKER_DIR = os.path.join(CACHE_DIR, 'markers')

STATICFILES_DIRS = (
    ('', os.path.join(PROJECT_ROOT, 'mancunia', 'site_media')),
    ('', os.path.join(MOLLY_ROOT, 'media')),
    ('markers', MARKER_DIR),
)

PIPELINE_VERSION = True
PIPELINE_AUTO = False
PIPELINE_CSS, PIPELINE_JS = get_compress_groups(STATIC_ROOT)
PIPELINE_CSS_COMPRESSOR = 'molly.utils.compress.MollyCSSFilter'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.jsmin.JSMinCompressor'
PIPELINE = not DEBUG

SECRET_KEY = local_secrets.SECRET_KEY

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'molly.utils.template_loaders.MollyDefaultLoader'
)

TEMPLATE_DIRS = (
    os.path.join(PROJECT_ROOT, 'templates'),
    os.path.join(MOLLY_ROOT, 'templates'),
コード例 #2
0
ファイル: settings.py プロジェクト: MechanisM/mollyproject
# happens under the CACHE_DIR
#EXTERNAL_IMAGES_DIR = '/var/cache/molly-images'

# Additional locations of static files
# This defaults to your local site media folder with highest priority, then any
# default media that Molly comes with, as well as the markers used for slippy
# maps
STATICFILES_DIRS = (
    ('', os.path.join(PROJECT_ROOT, 'site_media')),
    ('', os.path.join(MOLLY_ROOT, 'media')),
    ('markers', MARKER_DIR),
)

# This uses a Molly convenience function to find the CSS and JS to be compressed
# and which should be concatenated together
PIPELINE_CSS, PIPELINE_JS = get_compress_groups(STATIC_ROOT)

# This determines how the CSS should be compressed
# CSS filter is custom-written since the provided one mangles it too much
PIPELINE_CSS_COMPRESSOR = 'molly.utils.compress.MollyCSSFilter'

# This determines how the JavaScript should be compressed
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.jsmin.JSMinCompressor'

# Make this unique, and don't share it with anybody. It's used to salt passwords
SECRET_KEY = ''

# This defines the places Django looks for templates, in order of priority
TEMPLATE_DIRS = (
    os.path.join(PROJECT_ROOT, 'templates'), # first look in the 'templates' folder in your local site
    os.path.join(MOLLY_ROOT, 'templates'), # secondly, look in Molly's default templates
コード例 #3
0
ファイル: settings.py プロジェクト: alexsdutton/mollyproject
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = MEDIA_URL + 'admin/' 

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = STATIC_ROOT = os.path.join(project_root, 'media')

STATICFILES_DIRS = (
    ('', os.path.join(project_root, 'site_media')),
    ('', os.path.join(molly_root, 'media')),
)
STATIC_URL = '/media/'
STATICFILES_PREPEND_LABEL_APPS = ('django.contrib.admin',) #+ extract_installed_apps(APPLICATIONS)

COMPRESS_CSS, COMPRESS_JS = get_compress_groups(STATIC_ROOT)

# CSS filter is custom-written since the provided one mangles it too much
COMPRESS_CSS_FILTERS = ('molly.utils.compress.MollyCSSFilter',)

COMPRESS_CSSTIDY_SETTINGS = {
    'remove_bslash': True, # default True
    'compress_colors': True, # default True
    'compress_font-weight': True, # default True
    'lowercase_s': False, # default False
    'optimise_shorthands': 0, # default 2, tries to merge bg rules together and makes a hash of things
    'remove_last_': False, # default False
    'case_properties': 1, # default 1
    'sort_properties': False, # default False
    'sort_selectors': False, # default False
    'merge_selectors': 0, # default 2, messes things up
コード例 #4
0
# This defines where files should be found to be compressed - this should be
# the folder all the collected media is stored in
COMPRESS_SOURCE = STATIC_ROOT

# This defines where all the compressed files should be stored. You'll want this
# to be in the same place as above
COMPRESS_ROOT = STATIC_ROOT

# This is the URL where the compressed files are expected to be served from. If
# you're saving them in the same place as your regular media (the recommended)
# default, then they're available in the same place
COMPRESS_URL = STATIC_URL

# This uses a Molly convenience function to find the CSS and JS to be compressed
# and which should be concatenated together
COMPRESS_CSS, COMPRESS_JS = get_compress_groups(STATIC_ROOT)

# This determines how the CSS should be compressed
# CSS filter is custom-written since the provided one mangles it too much
COMPRESS_CSS_FILTERS = ('molly.utils.compress.MollyCSSFilter',)

# This determines how the JavaScript should be compressed
COMPRESS_JS_FILTERS = ('compress.filters.jsmin.JSMinFilter',)

# This settings sets whether or not compression is enabled
# In order to help with debugging, then this is only enabled when debugging is
# off
COMPRESS = not DEBUG

# When set, then a version number is added to compressed files, this means
# changing a file also changes its URL - when combined with far future expires,