Skip to content

Commit

Permalink
support non root for fanstatic
Browse files Browse the repository at this point in the history
  • Loading branch information
fanjinfei authored and tino097 committed Sep 26, 2017
1 parent 3eff2fd commit df51499
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ckan/config/middleware/pylons_app.py
@@ -1,6 +1,7 @@
# encoding: utf-8

import os
import re

from pylons.wsgiapp import PylonsApp

Expand Down Expand Up @@ -87,6 +88,10 @@ def make_pylons_stack(conf, full_stack=True, static_files=True,
'bottom': True,
'bundle': True,
}
root_path = config.get('ckan.root_path', None)
if root_path:
root_path = re.sub('/{{LANG}}', '', root_path)
fanstatic_config['base_url'] = root_path
app = Fanstatic(app, **fanstatic_config)

for plugin in PluginImplementations(IMiddleware):
Expand Down

0 comments on commit df51499

Please sign in to comment.