Skip to content

Commit

Permalink
add fanstatic via middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 9, 2012
1 parent 56bf3d3 commit 6d71dad
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ckan/config/middleware.py
Expand Up @@ -17,6 +17,7 @@
from routes.middleware import RoutesMiddleware
from repoze.who.config import WhoConfig
from repoze.who.middleware import PluggableAuthenticationMiddleware
from fanstatic import Fanstatic

from ckan.plugins import PluginImplementations
from ckan.plugins.interfaces import IMiddleware
Expand Down Expand Up @@ -134,9 +135,31 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
if asbool(config.get('ckan.page_cache_enabled')):
app = PageCacheMiddleware(app, config)

# Fanstatic
if config.get('ckan.include_support', '').lower()[:3] == 'dev':
print 'dev'
fanstatic_config = {
'versioning' : True,
'recompute_hashes' : True,
'minified' : False,
'bottom' : True,
'bundle' : False,
}
else:
print 'prod'
fanstatic_config = {
'versioning' : True,
'recompute_hashes' : False,
'minified' : True,
'bottom' : True,
'bundle' : True,
}
app = Fanstatic(app, **fanstatic_config)

# Tracking
if asbool(config.get('ckan.tracking_enabled', 'false')):
app = TrackingMiddleware(app, config)

return app

class I18nMiddleware(object):
Expand Down

0 comments on commit 6d71dad

Please sign in to comment.