mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
Replace SITE_ROOT with DEPLOY_ROOT
Whereas `SITE_ROOT` referred to the directory where settings.py is located, *all* actual uses of `SITE_ROOT` were joining it with `..` to get the root of the git checkout, a much more useful value. `DEPLOY_ROOT` now represents the root of the git checkout. (imported from commit 351437f9a5801e5c7c08a3a97619e863144e5cc8)
This commit is contained in:
@@ -84,8 +84,8 @@ USE_L10N = True
|
|||||||
# If you set this to False, Django will not use timezone-aware datetimes.
|
# If you set this to False, Django will not use timezone-aware datetimes.
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
|
DEPLOY_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '..')
|
||||||
TEMPLATE_DIRS = ( os.path.join(SITE_ROOT, '..', 'templates'),)
|
TEMPLATE_DIRS = ( os.path.join(DEPLOY_ROOT, 'templates'), )
|
||||||
|
|
||||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||||
# trailing slash.
|
# trailing slash.
|
||||||
@@ -379,7 +379,7 @@ PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
|
|||||||
PIPELINE_YUI_BINARY = '/usr/bin/env yui-compressor'
|
PIPELINE_YUI_BINARY = '/usr/bin/env yui-compressor'
|
||||||
|
|
||||||
PIPELINE_JS_COMPRESSOR = 'zephyr.lib.minify.ClosureSourceMapCompressor'
|
PIPELINE_JS_COMPRESSOR = 'zephyr.lib.minify.ClosureSourceMapCompressor'
|
||||||
PIPELINE_CLOSURE_BINARY = os.path.join(SITE_ROOT, '../tools/closure-compiler/run')
|
PIPELINE_CLOSURE_BINARY = os.path.join(DEPLOY_ROOT, 'tools/closure-compiler/run')
|
||||||
PIPELINE_CLOSURE_SOURCE_MAP_DIR = 'prod-static/source-map'
|
PIPELINE_CLOSURE_SOURCE_MAP_DIR = 'prod-static/source-map'
|
||||||
|
|
||||||
# Disable stuffing the entire JavaScript codebase inside an anonymous function.
|
# Disable stuffing the entire JavaScript codebase inside an anonymous function.
|
||||||
|
|||||||
@@ -181,8 +181,8 @@ urlpatterns += patterns('zephyr.tornadoviews',
|
|||||||
|
|
||||||
if not settings.DEPLOYED:
|
if not settings.DEPLOYED:
|
||||||
use_prod_static = getattr(settings, 'PIPELINE', False)
|
use_prod_static = getattr(settings, 'PIPELINE', False)
|
||||||
static_root = os.path.join(settings.SITE_ROOT,
|
static_root = os.path.join(settings.DEPLOY_ROOT,
|
||||||
'../prod-static/serve' if use_prod_static else '../zephyr/static')
|
'prod-static/serve' if use_prod_static else 'zephyr/static')
|
||||||
|
|
||||||
urlpatterns += patterns('',
|
urlpatterns += patterns('',
|
||||||
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
|
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def memcached_stats_finish():
|
|||||||
memcached_total_time += (time.time() - memcached_time_start)
|
memcached_total_time += (time.time() - memcached_time_start)
|
||||||
|
|
||||||
def get_or_create_key_prefix():
|
def get_or_create_key_prefix():
|
||||||
filename = os.path.join(settings.SITE_ROOT, "..", "memcached_prefix")
|
filename = os.path.join(settings.DEPLOY_ROOT, "memcached_prefix")
|
||||||
try:
|
try:
|
||||||
fd = os.open(filename, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0444)
|
fd = os.open(filename, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0444)
|
||||||
prefix = base64.b16encode(hashlib.sha256(str(random.getrandbits(256))).digest())[:32].lower() + ':'
|
prefix = base64.b16encode(hashlib.sha256(str(random.getrandbits(256))).digest())[:32].lower() + ':'
|
||||||
|
|||||||
@@ -1901,7 +1901,7 @@ def json_get_active_statuses(request, user_profile):
|
|||||||
js_source_map = None
|
js_source_map = None
|
||||||
if not (settings.DEBUG or settings.TEST_SUITE):
|
if not (settings.DEBUG or settings.TEST_SUITE):
|
||||||
js_source_map = SourceMap(path.join(
|
js_source_map = SourceMap(path.join(
|
||||||
settings.SITE_ROOT, '../prod-static/source-map/app.js.map'))
|
settings.DEPLOY_ROOT, 'prod-static/source-map/app.js.map'))
|
||||||
|
|
||||||
@authenticated_json_post_view
|
@authenticated_json_post_view
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
|
|||||||
Reference in New Issue
Block a user