Integrate django_appcache to become an "installed" app

This commit is contained in:
Kumar McMillan 2012-05-21 11:01:40 -05:00
Родитель 0f07bc9f21
Коммит 201f266a6c
6 изменённых файлов: 38 добавлений и 2 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -13,6 +13,7 @@ lib/product_json/.last_update
lib/product_json/regions/*.json
lib/product_json/regions/.last_update
build.py
media/manifest.appcache
.DS_Store
/media/img/uploads
*-min.css

Просмотреть файл

@ -44,6 +44,7 @@ INSTALLED_APPS = tuple(INSTALLED_APPS)
INSTALLED_APPS += (
'devhub', # Put here so helpers.py doesn't get loaded first.
'django_appcache',
'mkt.site',
'mkt.account',
'mkt.browse',
@ -66,6 +67,7 @@ INSTALLED_APPS += (
SUPPORTED_NONLOCALES += (
'manifest.webapp',
'mozmarket.js',
'appcache',
'csrf',
)
@ -217,3 +219,29 @@ STATSD_RECORD_KEYS = [
]
PISTON_DISPLAY_ERRORS = False
# Link to the appcache manifest (activate it) when True.
USE_APPCACHE = False
# These are absolute paths to add to the cache. Wildcards are not allowed here.
# These paths will be added as-is to the cache section.
APPCACHE_TO_CACHE = [
'/favicon.ico',
'https://browserid.org/include.js'
]
# These are paths relative to MEDIA_ROOT that you want to explicitly
# cache. The browser will load *all* of these URLs when your app first loads
# so be mindful to only list essential media files. The actual URL of the path
# to cache will be determined using MEDIA_URL.
# If you use wildcards here the real paths to the file(s) will be
# expanded using glob.glob()
APPCACHE_MEDIA_TO_CACHE = [
'css/mkt-all.css',
'css/mkt/consumer-all.css',
'js/common-all.js',
'js/mkt-all.js',
'js/preload-all.js',
'js/mkt/consumer-all.js',
'js/lib/jquery-1.*.js',
]

Просмотреть файл

@ -3,7 +3,11 @@
{% endif %}
{% set logged = request.user.is_authenticated() %}
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}">
<html lang="{{ LANG }}" dir="{{ DIR }}"
{% if settings.USE_APPCACHE %}
{{ appcache_manifest_link()|safe }}
{% endif %}
>
<head>
<meta charset="utf-8">
{% if not settings.ENGAGE_ROBOTS %}

Просмотреть файл

@ -97,6 +97,8 @@ urlpatterns = patterns('',
url('^api/', include('mkt.api.urls')),
url('^appcache/', include('django_appcache.urls')),
# Try and keep urls without a prefix at the bottom of the list for
# minor performance reasons.

Просмотреть файл

@ -137,5 +137,6 @@ def update(ctx):
compress_assets(arg='--settings=settings_local_mkt')
schematic()
with ctx.lcd(settings.SRC_DIR):
ctx.local('python2.6 manage.py build_appcache')
ctx.local('python2.6 manage.py dump_apps')
ctx.local('python2.6 manage.py statsd_ping --key=update')

2
vendor

@ -1 +1 @@
Subproject commit 397233e69329da1e4b435cc1ce79f225f42125ff
Subproject commit 3093f7f891bb3b3c4ebb10ddddd0a2dda141eb6f