Permalink
Browse files

Fix STATIC_ROOT and STATIC_URL

Removes remnants of MEDIA_URL and MEDIA_ROOT.
Also introduces MEMBERSHIP_STATIC_ROOT. Hrrr.
  • Loading branch information...
1 parent a13d9bc commit 8e63c9c5588d9de575f2b9c65146adaf16fd6a79 @guaq guaq committed Apr 14, 2012
View
@@ -26,3 +26,10 @@ source env/bin/activate
# Compile translations
./run-sikteeri.sh
+
+Static assets URLs
+==================
+
+* /static/ => sikteeri/static/
+* /static/membership/ => membership/static/
+* /static/admin/ => Django static root
@@ -2,7 +2,7 @@
{% load i18n %}
{% block extra_head %}
- <script type="text/javascript" src="{{ MEDIA_URL }}/membership/static/js/application.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}membership/js/application.js"></script>
{% endblock %}
{% block content %}
View
@@ -36,15 +36,13 @@
# to load the internationalization machinery.
USE_I18N = True
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = 'static/'
+# For development purposes, relative or absolute path to static assets
+STATIC_ROOT = 'static/'
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = ''
+# For development purposes
+MEMBERSHIP_STATIC_ROOT = '../membership/static/'
+# This is the path used in templates for asset URL
STATIC_URL = '/static/'
# Additional locations of static files
@@ -7,13 +7,13 @@
<meta content="Kapsi Internet-käyttäjät ry" name="Author">
<link href="http://www.kapsi.fi/favicon.ico" type="image/x-icon" rel="shortcut icon">
<style media="screen" type="text/css">
- @import "{{ MEDIA_URL }}/static/css/screen.css";
- @import "{{ MEDIA_URL }}/static/css/content.css";
- @import "{{ MEDIA_URL }}/static/css/form.css";{% if user.is_authenticated %}
- @import "{{ MEDIA_URL }}/static/css/blue.css";{% endif %}
+ @import "{{ STATIC_URL }}css/screen.css";
+ @import "{{ STATIC_URL }}css/content.css";
+ @import "{{ STATIC_URL }}css/form.css";{% if user.is_authenticated %}
+ @import "{{ STATIC_URL }}css/blue.css";{% endif %}
</style>
- <script type="text/javascript" src="{{ MEDIA_URL }}/static/js/jquery-1.4.2.min.js"></script>
- <script type="text/javascript" src="{{ MEDIA_URL }}/static/js/django-csrf.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.4.2.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/django-csrf.js"></script>
<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
{% block extra_head %}{% endblock %}
</head>
View
@@ -14,7 +14,10 @@
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^comments/', include('django.contrib.comments.urls')),
- url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
+
+ url(r'^static/membership/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEMBERSHIP_STATIC_ROOT}),
+ url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
+
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
url(r'^membership/', include('membership.urls')),

0 comments on commit 8e63c9c

Please sign in to comment.