forked from divio/aldryn-wagtail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aldryn_config.py
executable file
·42 lines (37 loc) · 1.3 KB
/
aldryn_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
wagtail_site_name = forms.CharField(
'Wagtail Sitename',
required=True,
initial='My Example Site',
)
def to_settings(self, data, settings):
settings['INSTALLED_APPS'].extend([
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
'wagtail.wagtailembeds',
'wagtail.wagtailsites',
'wagtail.wagtailusers',
'wagtail.wagtailsnippets',
'wagtail.wagtaildocs',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
'modelcluster',
'taggit',
])
settings['MIDDLEWARE_CLASSES'].extend([
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
])
# admin and cms urls need to be first, since we're overriding the
# default admin.
settings['ADDON_URLS_I18N'].insert(
0,
'aldryn_wagtail.urls',
)
settings['ADDON_URLS_I18N_LAST'] = 'aldryn_wagtail.page_urls'
settings['WAGTAIL_SITE_NAME'] = data['wagtail_site_name']
return settings