diff --git a/woven/project.py b/woven/project.py index c896678..27f8d96 100644 --- a/woven/project.py +++ b/woven/project.py @@ -42,7 +42,7 @@ def _make_local_sitesettings(overwrite=False): "domain":root_domain, "user":env, "MEDIA_URL":env.MEDIA_URL, - "STATICFILES_URL":env.STATICFILES_URL} + "STATIC_URL":env.STATIC_URL} ) f = open(settings_file_path,"w+") @@ -132,27 +132,27 @@ def deploy_static(): """ Deploy static (application) versioned media """ - if (not env.STATICFILES_ROOT and not env.ADMIN_MEDIA_PREFIX) or 'http://' in env.STATICFILES_URL: return + if (not env.STATIC_ROOT and not env.ADMIN_MEDIA_PREFIX) or 'http://' in env.STATIC_URL: return elif 'http://' in env.ADMIN_MEDIA_PREFIX: return remote_dir = '/'.join([deployment_root(),'env',env.project_fullname,'static']) #if app media is not handled by django-staticfiles we can install admin media by default - if 'django.contrib.admin' in env.INSTALLED_APPS and not env.STATICFILES_ROOT: + if 'django.contrib.admin' in env.INSTALLED_APPS and not env.STATIC_ROOT: if env.MEDIA_URL and env.MEDIA_URL in env.ADMIN_MEDIA_PREFIX: print "ERROR: Your ADMIN_MEDIA_PREFIX (Application media) must not be on the same path as your MEDIA_URL (User media)" sys.exit(1) - env.STATICFILES_URL = env.ADMIN_MEDIA_PREFIX + env.STATIC_URL = env.ADMIN_MEDIA_PREFIX admin = AdminMediaHandler('DummyApp') local_dir = admin.media_dir remote_dir = ''.join([remote_dir,env.ADMIN_MEDIA_PREFIX]) else: - if env.MEDIA_URL and env.MEDIA_URL in env.STATICFILES_URL: - print "ERROR: Your STATICFILES_URL (Application media) must not be on the same path as your MEDIA_URL (User media)" + if env.MEDIA_URL and env.MEDIA_URL in env.STATIC_URL: + print "ERROR: Your STATIC_URL (Application media) must not be on the same path as your MEDIA_URL (User media)" sys.exit(1) - elif env.STATICFILES_ROOT: - local_dir = env.STATICFILES_ROOT - static_url = env.STATICFILES_URL[1:] + elif env.STATIC_ROOT: + local_dir = env.STATIC_ROOT + static_url = env.STATIC_URL[1:] if static_url: remote_dir = '/'.join([remote_dir,static_url]) else: return diff --git a/woven/templates/woven/nginx-template.txt b/woven/templates/woven/nginx-template.txt index 3dcdcb0..768fd76 100644 --- a/woven/templates/woven/nginx-template.txt +++ b/woven/templates/woven/nginx-template.txt @@ -25,8 +25,8 @@ server { } {% endif %} - {% if STATICFILES_URL %} - location {{ STATICFILES_URL }} { + {% if STATIC_URL %} + location {{ STATIC_URL }} { root {{ deployment_root }}/env/{{ project_name }}/static/; } diff --git a/woven/templates/woven/sitesettings.txt b/woven/templates/woven/sitesettings.txt index bdca4ed..e8ce082 100644 --- a/woven/templates/woven/sitesettings.txt +++ b/woven/templates/woven/sitesettings.txt @@ -28,7 +28,7 @@ SITE_ID = {{ site_id }} #Normally you shouldn't amend these settings, unless you have changed your local media settings MEDIA_ROOT = '{{ deployment_root }}/public/{{ MEDIA_URL|slice:"1:" }}' -STATICFILES_ROOT = '{{ deployment_root }}/env/{{ project_name }}/static/{{ STATICFILES_URL|slice:"1:" }}' +STATIC_ROOT = '{{ deployment_root }}/env/{{ project_name }}/static/{{ STATIC_URL|slice:"1:" }}' #The default layout allows for global templates with local site override TEMPLATE_DIRS = ('{{ deployment_root }}/env/{{ project_name }}/templates/', diff --git a/woven/webservers.py b/woven/webservers.py index 1744fe3..e44ebd8 100644 --- a/woven/webservers.py +++ b/woven/webservers.py @@ -29,9 +29,9 @@ def _deploy_webconf(remote_dir,template): if not 'http:' in env.MEDIA_URL: media_url = env.MEDIA_URL else: media_url = '' - if not 'http:' in env.STATICFILES_URL: staticfiles_url = env.STATICFILES_URL - else: staticfiles_url = '' - if not staticfiles_url: staticfiles_url = env.ADMIN_MEDIA_PREFIX + if not 'http:' in env.STATIC_URL: static_url = env.STATIC_URL + else: static_url = '' + if not static_url: static_url = env.ADMIN_MEDIA_PREFIX log_dir = '/'.join([deployment_root(),'log']) deployed = [] domains = domain_sites() @@ -48,7 +48,7 @@ def _deploy_webconf(remote_dir,template): "user":env.user, "host_ip":socket.gethostbyname(env.host), "MEDIA_URL":media_url, - "STATICFILES_URL":staticfiles_url, + "STATIC_URL":static_url, } upload_template('/'.join(['woven',template]),