You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Andy Byers edited this page Sep 11, 2017
·
2 revisions
The Theme Override Middleware is a piece of code that does the following:
Works out if there is a journal in the request object
Attempts to fetch the theme setting for a journal and add that theme to the list of settings.TEMPLATES['DIRS']
If no setting is found for the journal theme is set to default
If no journal is found in the request object we set the theme to the request.press.theme
Otherwise, set the theme to default as a failsafe
This means that for any given page request, we ensure the correct theme/templates are served so we don't get any mismatches (ie. Press theme showing for a Journal etc.)
This middleware is loaded in the settings.MIDDLEWARE_CLASSES variable and looks like: