Skip to content

Commit

Permalink
change STATICFILES back to STATIC. Jumped the gun. Thanks Jezdez.
Browse files Browse the repository at this point in the history
  • Loading branch information
bretth committed Nov 17, 2010
1 parent 2aa016c commit 3ab2d47
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions woven/project.py
Expand Up @@ -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+")
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions woven/templates/woven/nginx-template.txt
Expand Up @@ -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/;

}
Expand Down
2 changes: 1 addition & 1 deletion woven/templates/woven/sitesettings.txt
Expand Up @@ -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/',
Expand Down
8 changes: 4 additions & 4 deletions woven/webservers.py
Expand Up @@ -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()
Expand All @@ -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]),
Expand Down

0 comments on commit 3ab2d47

Please sign in to comment.