-
Notifications
You must be signed in to change notification settings - Fork 12
/
aldryn_config.py
executable file
·45 lines (40 loc) · 1.42 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
43
44
45
# -*- 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.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.contrib.modeladmin',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail',
'modelcluster',
'taggit',
])
settings['MIDDLEWARE'].extend([
'wagtail.contrib.legacy.sitemiddleware.SiteMiddleware',
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
])
# admin and cms urls need to be first, since we're overriding the
# default admin.
# These are non-translatable URLs
# see: https://docs.wagtail.io/en/stable/advanced_topics/i18n.html#adding-a-language-prefix-to-urls
settings['ADDON_URLS'].insert(
0,
'aldryn_wagtail.urls',
)
settings['ADDON_URLS_I18N_LAST'] = 'aldryn_wagtail.page_urls'
settings['WAGTAIL_SITE_NAME'] = data['wagtail_site_name']
return settings