Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed all static use to use django-compressor instead, r=kumar

  • Loading branch information...
commit f525ab43b5f91f51f1083233e6dd3bcfedcdd28e 1 parent abafbf0
@peterbe peterbe authored
View
5 bin/update/deploy.py
@@ -43,8 +43,9 @@ def update_locales(ctx):
def update_assets(ctx):
with ctx.lcd(settings.SRC_DIR):
ctx.local("python2.6 manage.py collectstatic --noinput")
- # LANG=en_US.UTF-8 is sometimes necessary for the YUICompressor.
- ctx.local('LANG=en_US.UTF8 python2.6 manage.py compress_assets')
+ # un-comment if you haven't moved to django-compressor yet
+ ## LANG=en_US.UTF-8 is sometimes necessary for the YUICompressor.
+ #ctx.local('LANG=en_US.UTF8 python2.6 manage.py compress_assets')
@task
View
7 bin/update_site.py
@@ -29,8 +29,8 @@
'prod': ['prod', 'master'],
}
-# The URL of the SVN repository with the localization files (*.po). If you set
-# it to a non-empty value, remember to `git rm --cached -r locale` in the root
+# The URL of the SVN repository with the localization files (*.po). If you set
+# it to a non-empty value, remember to `git rm --cached -r locale` in the root
# of the project. Example:
# LOCALE_REPO_URL = 'https://svn.mozilla.org/projects/l10n-misc/trunk/playdoh/locale'
LOCALE_REPO_URL = ''
@@ -89,7 +89,8 @@ def update_site(env, debug):
(CHDIR, os.path.join(here)),
(EXEC, 'python2.6 vendor/src/schematic/schematic migrations/'),
(EXEC, 'python2.6 manage.py collectstatic --noinput'),
- (EXEC, 'python2.6 manage.py compress_assets'),
+ # un-comment if you haven't moved to django-compressor yet
+ #(EXEC, 'python2.6 manage.py compress_assets'),
]
for cmd, cmd_args in commands:
View
5 project/base/templates/example_base.html
@@ -5,7 +5,9 @@
<title>{% block page_title %}playdoh examples{% endblock %}</title>
{% block site_css %}
- {{ css('example_css') }}
+ {% compress css %}
+ <link href="{{ static('examples/css/main.css') }}" rel="stylesheet">
+ {% endcompress %}
{% endblock %}
</head>
<body data-mobile-cookie="{{ settings.MOBILE_COOKIE }}">
@@ -23,4 +25,3 @@
{% endblock %}
</body>
</html>
-
View
0  media/css/examples/main.css → ...ect/examples/static/examples/css/main.css
File renamed without changes
View
0  media/css/examples/mobile.css → ...t/examples/static/examples/css/mobile.css
File renamed without changes
View
0  media/js/examples/init.js → project/examples/static/examples/js/init.js
File renamed without changes
View
0  media/js/examples/libs/jquery-1.4.4.min.js → ...atic/examples/js/libs/jquery-1.4.4.min.js
File renamed without changes
View
0  media/js/examples/libs/jquery.cookie.js → .../static/examples/js/libs/jquery.cookie.js
File renamed without changes
View
6 project/examples/templates/examples/home.html
@@ -40,7 +40,11 @@
</ul>
{% endblock %}
{% block site_js %}
- {{ js('example_js') }}
+ {% compress js %}
+ <script src="{{ static('examples/js/libs/jquery-1.4.4.min.js') }}"></script>
+ <script src="{{ static('examples/js/libs/jquery.cookie.js') }}"></script>
+ <script src="{{ static('examples/js/init.js') }}"></script>
+ {% endcompress %}
{% if not request.user.is_active %}
{{ browserid_form.media }}
{% endif %}
View
4 project/examples/templates/examples/mobile/home.html
@@ -1,5 +1,7 @@
{% extends "examples/home.html" %}
{% block site_css %}
- {{ css('example_mobile_css') }}
+ {% compress css %}
+ <link href="{{ static('examples/css/mobile.css') }}" rel="stylesheet">
+ {% endcompress %}
{% endblock %}
View
20 project/settings/base.py
@@ -9,26 +9,6 @@
# clone.
PROJECT_MODULE = 'project'
-# Bundles is a dictionary of two dictionaries, css and js, which list css files
-# and js files that can be bundled together by the minify app.
-MINIFY_BUNDLES = {
- 'css': {
- 'example_css': (
- 'css/examples/main.css',
- ),
- 'example_mobile_css': (
- 'css/examples/mobile.css',
- ),
- },
- 'js': {
- 'example_js': (
- 'js/examples/libs/jquery-1.4.4.min.js',
- 'js/examples/libs/jquery.cookie.js',
- 'js/examples/init.js',
- ),
- }
-}
-
# Defines the views served for root URLs.
ROOT_URLCONF = '%s.urls' % PROJECT_MODULE
View
8 project/urls.py
@@ -1,5 +1,6 @@
from django.conf import settings
from django.conf.urls.defaults import patterns, include
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from .examples import urls
@@ -23,9 +24,4 @@
## In DEBUG mode, serve media files through Django.
if settings.DEBUG:
- # Remove leading and trailing slashes so the regex matches.
- media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
- urlpatterns += patterns('',
- (r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT}),
- )
+ urlpatterns += staticfiles_urlpatterns()
Please sign in to comment.
Something went wrong with that request. Please try again.