def staticPrefix(request): """ STATIC_PREFIX: Prepends the BASE_URL to STATIC_URL when in the development environment only! This must be use for all static files rendered outsite request context. IE: bookmarklet & email Useage: {{STATIC_PREFIX}}{{STATIC_URL}} Development server: Set STATIC_URL = '/static/' Set COMPRESS_URL = STATIC_URL """ sp = '' if not settings.RACK_ENV: sp = safe_base_url(request) return {'STATIC_PREFIX': sp,}
def staticPrefix(request): """ STATIC_PREFIX: Prepends the BASE_URL to STATIC_URL when in the development environment only! This must be use for all static files rendered outsite request context. IE: bookmarklet & email Useage: {{STATIC_PREFIX}}{{STATIC_URL}} Development server: Set STATIC_URL = '/static/' Set COMPRESS_URL = STATIC_URL """ sp = '' if not settings.RACK_ENV: sp = safe_base_url(request) return { 'STATIC_PREFIX': sp, }
def urls(request): """ SITE_URL = base site url with automatic http/https. US_SITE_URL = http base site url SSL_SITE_URL = https base site url API_URL = http for now to avoid cross site requests if that is fixed then we can use auto http/https. """ SITE_URL = safe_base_url(request) US_SITE_URL = safe_usbase_url(request) SSL_SITE_URL = safe_sbase_url(request) return {'BASE_URL': SITE_URL, 'US_SITE_URL': US_SITE_URL, 'SSL_SITE_URL': SSL_SITE_URL, 'API_URL': US_SITE_URL + '/api/' + settings.API_NAME + '/', }
def urls(request): """ SITE_URL = base site url with automatic http/https. US_SITE_URL = http base site url SSL_SITE_URL = https base site url API_URL = http for now to avoid cross site requests if that is fixed then we can use auto http/https. """ SITE_URL = safe_base_url(request) US_SITE_URL = safe_usbase_url(request) SSL_SITE_URL = safe_sbase_url(request) return { 'BASE_URL': SITE_URL, 'US_SITE_URL': US_SITE_URL, 'SSL_SITE_URL': SSL_SITE_URL, 'API_URL': US_SITE_URL + '/api/' + settings.API_NAME + '/', }