We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Login with username
It is currently not possible to login with username, only with email. This *was* possible with the old meinberlin that was based on a3. So the login flow of established users breaks even though we migrated all accounts.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `meinberlin/settings/base.py`
Content:
```
1 """
2 Django settings for meinberlin project.
3 
4 Generated by 'django-admin startproject' using Django 1.8.17.
5 
6 For more information on this file, see
7 https://docs.djangoproject.com/en/1.8/topics/settings/
8 
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/1.8/ref/settings/
11 """
12 
13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 import os
15 
16 PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 BASE_DIR = os.path.dirname(PROJECT_DIR)
18 
19 # Application definition
20 
21 INSTALLED_APPS = (
22     'django.contrib.sites',
23     'django.contrib.admin',
24     'django.contrib.auth',
25     'django.contrib.contenttypes',
26     'django.contrib.sessions',
27     'django.contrib.messages',
28     'django.contrib.staticfiles',
29     'django.contrib.humanize',
30 
31     'wagtail.wagtailforms',
32     'wagtail.wagtailredirects',
33     'wagtail.wagtailembeds',
34     'wagtail.wagtailsites',
35     'wagtail.wagtailusers',
36     'wagtail.wagtailsnippets',
37     'wagtail.wagtaildocs',
38     'wagtail.wagtailimages',
39     'wagtail.wagtailsearch',
40     'wagtail.wagtailadmin',
41     'wagtail.wagtailcore',
42     'wagtail.contrib.wagtailstyleguide',
43 
44     'taggit',  # wagtail dependency
45     'widget_tweaks',
46     'rest_framework',
47     'allauth',
48     'allauth.account',
49     'allauth.socialaccount',
50     'rules.apps.AutodiscoverRulesConfig',
51     'easy_thumbnails',
52     'ckeditor',
53     'ckeditor_uploader',
54     'capture_tag',
55 
56     'adhocracy4.organisations.apps.OrganisationsConfig',
57     'adhocracy4.projects.apps.ProjectsConfig',
58     'adhocracy4.images.apps.ImagesConfig',
59     'adhocracy4.phases.apps.PhasesConfig',
60     'adhocracy4.modules.apps.ModulesConfig',
61     'adhocracy4.ratings.apps.RatingsConfig',
62     'adhocracy4.reports.apps.ReportsConfig',
63     'adhocracy4.comments.apps.CommentsConfig',
64     'adhocracy4.categories.apps.CategoriesConfig',
65     'adhocracy4.maps.apps.MapsConfig',
66     'adhocracy4.actions.apps.ActionsConfig',
67     'adhocracy4.follows.apps.FollowsConfig',
68 
69     'apps.contrib.apps.Config',
70     'apps.cms.apps.Config',
71     'apps.users.apps.Config',
72     'apps.projects.apps.Config',
73     'apps.organisations.apps.Config',
74     'apps.embed.apps.Config',
75     'apps.moderatorfeedback.apps.Config',
76     'apps.maps.apps.Config',
77     'apps.notifications.apps.Config',
78 
79     'apps.account.apps.Config',
80     'apps.dashboard.apps.Config',
81 
82     'apps.bplan.apps.Config',
83     'apps.budgeting.apps.Config',
84     'apps.documents.apps.Config',
85     'apps.extprojects.apps.Config',
86     'apps.ideas.apps.Config',
87     'apps.kiezkasse.apps.Config',
88     'apps.mapideas.apps.Config',
89     'apps.polls.apps.Config',
90     'apps.topicprio.apps.Config',
91 )
92 
93 MIDDLEWARE_CLASSES = (
94     'django.contrib.sessions.middleware.SessionMiddleware',
95     'django.middleware.common.CommonMiddleware',
96     'django.middleware.csrf.CsrfViewMiddleware',
97     'django.contrib.auth.middleware.AuthenticationMiddleware',
98     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
99     'django.contrib.messages.middleware.MessageMiddleware',
100     'django.middleware.clickjacking.XFrameOptionsMiddleware',
101     'django.middleware.security.SecurityMiddleware',
102     'django.middleware.locale.LocaleMiddleware',
103 
104     'wagtail.wagtailcore.middleware.SiteMiddleware',
105     'wagtail.wagtailredirects.middleware.RedirectMiddleware',
106 
107     'apps.embed.middleware.AjaxPathMiddleware',
108 )
109 
110 SITE_ID = 1
111 
112 ROOT_URLCONF = 'meinberlin.urls'
113 
114 LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
115 
116 TEMPLATES = [
117     {
118         'BACKEND': 'django.template.backends.django.DjangoTemplates',
119         'DIRS': [
120             os.path.join(PROJECT_DIR, 'templates'),
121         ],
122         'APP_DIRS': True,
123         'OPTIONS': {
124             'context_processors': [
125                 'django.template.context_processors.debug',
126                 'django.template.context_processors.request',
127                 'django.contrib.auth.context_processors.auth',
128                 'django.contrib.messages.context_processors.messages',
129             ],
130         },
131     },
132 ]
133 
134 WSGI_APPLICATION = 'meinberlin.wsgi.application'
135 
136 
137 # Database
138 # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
139 
140 DATABASES = {
141     'default': {
142         'ENGINE': 'django.db.backends.sqlite3',
143         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
144         'TEST': {
145             'NAME': os.path.join(BASE_DIR, 'test_db.sqlite3'),
146         }
147     }
148 }
149 
150 
151 # Internationalization
152 # https://docs.djangoproject.com/en/1.8/topics/i18n/
153 
154 LANGUAGE_CODE = 'en-us'
155 
156 TIME_ZONE = 'Europe/Berlin'
157 
158 USE_I18N = True
159 
160 USE_L10N = True
161 
162 USE_TZ = True
163 
164 
165 # Static files (CSS, JavaScript, Images)
166 # https://docs.djangoproject.com/en/1.8/howto/static-files/
167 
168 STATICFILES_DIRS = [
169     os.path.join(PROJECT_DIR, 'static'),
170 ]
171 
172 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
173 STATIC_URL = '/static/'
174 
175 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
176 MEDIA_URL = '/media/'
177 
178 IMAGE_ALIASES = {
179     '*': {
180         'max_size': 5*10**6,
181         'fileformats': ('image/png', 'image/jpeg', 'image/gif')
182     },
183     'heroimage': {'min_resolution': (1300, 600)},
184     'logo': {'min_resolution': (200, 200), 'aspect_ratio': (1, 1)},
185     'avatar': {'min_resolution': (200, 200)},
186     'idea_image': {'min_resolution': (800, 200)},
187 }
188 
189 THUMBNAIL_ALIASES = {
190     '': {
191         'heroimage': {'size': (1500, 500), 'crop': 'smart'},
192         'heroimage_preview': {'size': (880, 220), 'crop': 'smart'},
193         'project_thumbnail': {'size': (520, 330), 'crop': 'smart'},
194         'idea_image': {'size': (800, 0), 'crop': 'scale'},
195         'idea_thumbnail': {'size': (240, 240), 'crop': 'smart'},
196     }
197 }
198 
199 ALLOWED_UPLOAD_IMAGES = ('png', 'jpeg', 'gif')
200 
201 
202 # Wagtail settings
203 
204 WAGTAIL_SITE_NAME = 'meinberlin'
205 
206 # Base URL to use when referring to full URLs within the Wagtail admin backend -
207 # e.g. in notification emails. Don't include '/admin' or a trailing slash
208 BASE_URL = 'http://localhost:8000'
209 
210 # Authentication
211 
212 AUTH_USER_MODEL = 'meinberlin_users.User'
213 
214 AUTHENTICATION_BACKENDS = (
215     'rules.permissions.ObjectPermissionBackend',
216     'django.contrib.auth.backends.ModelBackend',
217     'allauth.account.auth_backends.AuthenticationBackend',
218 )
219 
220 ACCOUNT_ADAPTER = 'apps.users.adapters.AccountAdapter'
221 ACCOUNT_AUTHENTICATION_METHOD = 'email'
222 ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
223 ACCOUNT_EMAIL_REQUIRED = True
224 ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
225 ACCOUNT_USERNAME_REQUIRED = True
226 ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10
227 ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300  # seconds
228 ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True
229 ACCOUNT_LOGIN_ON_PASSWORD_RESET = True
230 ACCOUNT_SIGNUP_FORM_CLASS = 'apps.users.forms.TermsSignupForm'
231 
232 LOGIN_URL = 'account_login'
233 LOGIN_REDIRECT_URL = '/'
234 
235 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
236 
237 PASSWORD_HASHERS = [
238     'django.contrib.auth.hashers.PBKDF2PasswordHasher',
239     'django.contrib.auth.hashers.BCryptPasswordHasher',  # a3
240     'apps.users.hashers.A2PasswordHasher',
241 ]
242 
243 
244 # ckeditor
245 
246 CKEDITOR_UPLOAD_PATH = "uploads/"
247 CKEDITOR_RESTRICT_BY_USER = True
248 CKEDITOR_ALLOW_NONIMAGE_FILES = False
249 
250 CKEDITOR_CONFIGS = {
251     'default': {
252         'width': '100%',
253         'toolbar': 'Custom',
254         'toolbar_Custom': [
255             ['Bold', 'Italic', 'Underline'],
256             ['NumberedList', 'BulletedList'],
257             ['Link', 'Unlink']
258         ]
259     },
260     'image-editor': {
261         'width': '100%',
262         'toolbar': 'Custom',
263         'toolbar_Custom': [
264             ['Bold', 'Italic', 'Underline'],
265             ['Image'],
266             ['NumberedList', 'BulletedList'],
267             ['Link', 'Unlink']
268         ]
269     }
270 }
271 
272 BLEACH_LIST = {
273     'default' : {
274         'tags': ['p','strong','em','u','ol','li','ul','a'],
275         'attributes': {
276             'a': ['href', 'rel'],
277         },
278     },
279     'image-editor': {
280         'tags': ['p','strong','em','u','ol','li','ul','a','img'],
281         'attributes': {
282             'a': ['href', 'rel'],
283             'img': ['src', 'alt', 'style']
284         },
285         'styles': [
286             'float',
287             'margin',
288             'padding',
289             'width',
290             'height',
291             'margin-bottom',
292             'margin-top',
293             'margin-left',
294             'margin-right',
295         ],
296     }
297 }
298 
299 
300 # adhocracy4
301 
302 A4_ORGANISATIONS_MODEL = 'meinberlin_organisations.Organisation'
303 
304 A4_RATEABLES = (
305     ('a4comments', 'comment'),
306     ('meinberlin_ideas', 'idea'),
307     ('meinberlin_mapideas', 'mapidea'),
308     ('meinberlin_budgeting', 'proposal'),
309     ('meinberlin_topicprio', 'topic'),
310     ('meinberlin_kiezkasse', 'proposal'),
311 )
312 
313 A4_COMMENTABLES = (
314     ('a4comments', 'comment'),
315     ('meinberlin_ideas', 'idea'),
316     ('meinberlin_documents', 'document'),
317     ('meinberlin_documents', 'paragraph'),
318     ('meinberlin_mapideas', 'mapidea'),
319     ('meinberlin_budgeting', 'proposal'),
320     ('meinberlin_topicprio', 'topic'),
321     ('meinberlin_polls', 'poll'),
322     ('meinberlin_kiezkasse', 'proposal'),
323 )
324 
325 A4_REPORTABLES = (
326     ('a4comments', 'comment'),
327     ('meinberlin_ideas', 'idea'),
328     ('meinberlin_mapideas', 'mapidea'),
329     ('meinberlin_budgeting', 'proposal'),
330     ('meinberlin_topicprio', 'topic'),
331     ('meinberlin_kiezkasse', 'proposal'),
332 )
333 A4_AUTO_FOLLOWABLES = (('a4comments', 'comment'),)
334 
335 A4_ACTIONABLES = (
336     ('a4comments', 'comment'),
337     ('meinberlin_ideas', 'idea'),
338     ('meinberlin_mapideas', 'mapidea'),
339     ('meinberlin_budgeting', 'proposal'),
340     ('meinberlin_kiezkasse', 'proposal'),
341 )
342 
343 A4_AUTO_FOLLOWABLES = (
344     ('a4comments', 'comment'),
345     ('meinberlin_ideas', 'idea'),
346     ('meinberlin_mapideas', 'mapidea'),
347     ('meinberlin_budgeting', 'proposal'),
348     ('meinberlin_kiezkasse', 'proposal'),
349     ('meinberlin_polls', 'vote'),  # TODO: really?
350 )
351 
352 A4_MAP_BASEURL = 'https://maps.berlinonline.de/tile/bright/'
353 A4_MAP_ATTRIBUTION = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors'
354 A4_MAP_BOUNDING_BOX = ([[52.3517, 13.8229], [52.6839, 12.9543]])
355 
356 CONTACT_EMAIL = 'support-berlin@liqd.de'
357 EMAIL_DEFAULT_LANGUAGE = 'de'
358
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/meinberlin/settings/base.py b/meinberlin/settings/base.py
--- a/meinberlin/settings/base.py
+++ b/meinberlin/settings/base.py
@@ -218,7 +218,7 @@
 )
 
 ACCOUNT_ADAPTER = 'apps.users.adapters.AccountAdapter'
-ACCOUNT_AUTHENTICATION_METHOD = 'email'
+ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
 ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
 ACCOUNT_EMAIL_REQUIRED = True
 ACCOUNT_EMAIL_VERIFICATION = 'mandatory'

{"golden_diff": "diff --git a/meinberlin/settings/base.py b/meinberlin/settings/base.py\n--- a/meinberlin/settings/base.py\n+++ b/meinberlin/settings/base.py\n@@ -218,7 +218,7 @@\n )\n \n ACCOUNT_ADAPTER = 'apps.users.adapters.AccountAdapter'\n-ACCOUNT_AUTHENTICATION_METHOD = 'email'\n+ACCOUNT_AUTHENTICATION_METHOD = 'username_email'\n ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3\n ACCOUNT_EMAIL_REQUIRED = True\n ACCOUNT_EMAIL_VERIFICATION = 'mandatory'\n", "issue": "Login with username\nIt is currently not possible to login with username, only with email. This *was* possible with the old meinberlin that was based on a3. So the login flow of established users breaks even though we migrated all accounts.\n", "before_files": [{"content": "\"\"\"\nDjango settings for meinberlin project.\n\nGenerated by 'django-admin startproject' using Django 1.8.17.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.8/ref/settings/\n\"\"\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nimport os\n\nPROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nBASE_DIR = os.path.dirname(PROJECT_DIR)\n\n# Application definition\n\nINSTALLED_APPS = (\n    'django.contrib.sites',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n\n    'wagtail.wagtailforms',\n    'wagtail.wagtailredirects',\n    'wagtail.wagtailembeds',\n    'wagtail.wagtailsites',\n    'wagtail.wagtailusers',\n    'wagtail.wagtailsnippets',\n    'wagtail.wagtaildocs',\n    'wagtail.wagtailimages',\n    'wagtail.wagtailsearch',\n    'wagtail.wagtailadmin',\n    'wagtail.wagtailcore',\n    'wagtail.contrib.wagtailstyleguide',\n\n    'taggit',  # wagtail dependency\n    'widget_tweaks',\n    'rest_framework',\n    'allauth',\n    'allauth.account',\n    'allauth.socialaccount',\n    'rules.apps.AutodiscoverRulesConfig',\n    'easy_thumbnails',\n    'ckeditor',\n    'ckeditor_uploader',\n    'capture_tag',\n\n    'adhocracy4.organisations.apps.OrganisationsConfig',\n    'adhocracy4.projects.apps.ProjectsConfig',\n    'adhocracy4.images.apps.ImagesConfig',\n    'adhocracy4.phases.apps.PhasesConfig',\n    'adhocracy4.modules.apps.ModulesConfig',\n    'adhocracy4.ratings.apps.RatingsConfig',\n    'adhocracy4.reports.apps.ReportsConfig',\n    'adhocracy4.comments.apps.CommentsConfig',\n    'adhocracy4.categories.apps.CategoriesConfig',\n    'adhocracy4.maps.apps.MapsConfig',\n    'adhocracy4.actions.apps.ActionsConfig',\n    'adhocracy4.follows.apps.FollowsConfig',\n\n    'apps.contrib.apps.Config',\n    'apps.cms.apps.Config',\n    'apps.users.apps.Config',\n    'apps.projects.apps.Config',\n    'apps.organisations.apps.Config',\n    'apps.embed.apps.Config',\n    'apps.moderatorfeedback.apps.Config',\n    'apps.maps.apps.Config',\n    'apps.notifications.apps.Config',\n\n    'apps.account.apps.Config',\n    'apps.dashboard.apps.Config',\n\n    'apps.bplan.apps.Config',\n    'apps.budgeting.apps.Config',\n    'apps.documents.apps.Config',\n    'apps.extprojects.apps.Config',\n    'apps.ideas.apps.Config',\n    'apps.kiezkasse.apps.Config',\n    'apps.mapideas.apps.Config',\n    'apps.polls.apps.Config',\n    'apps.topicprio.apps.Config',\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n    'django.middleware.locale.LocaleMiddleware',\n\n    'wagtail.wagtailcore.middleware.SiteMiddleware',\n    'wagtail.wagtailredirects.middleware.RedirectMiddleware',\n\n    'apps.embed.middleware.AjaxPathMiddleware',\n)\n\nSITE_ID = 1\n\nROOT_URLCONF = 'meinberlin.urls'\n\nLOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [\n            os.path.join(PROJECT_DIR, 'templates'),\n        ],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = 'meinberlin.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/1.8/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n        'TEST': {\n            'NAME': os.path.join(BASE_DIR, 'test_db.sqlite3'),\n        }\n    }\n}\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.8/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'Europe/Berlin'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.8/howto/static-files/\n\nSTATICFILES_DIRS = [\n    os.path.join(PROJECT_DIR, 'static'),\n]\n\nSTATIC_ROOT = os.path.join(BASE_DIR, 'static')\nSTATIC_URL = '/static/'\n\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\nMEDIA_URL = '/media/'\n\nIMAGE_ALIASES = {\n    '*': {\n        'max_size': 5*10**6,\n        'fileformats': ('image/png', 'image/jpeg', 'image/gif')\n    },\n    'heroimage': {'min_resolution': (1300, 600)},\n    'logo': {'min_resolution': (200, 200), 'aspect_ratio': (1, 1)},\n    'avatar': {'min_resolution': (200, 200)},\n    'idea_image': {'min_resolution': (800, 200)},\n}\n\nTHUMBNAIL_ALIASES = {\n    '': {\n        'heroimage': {'size': (1500, 500), 'crop': 'smart'},\n        'heroimage_preview': {'size': (880, 220), 'crop': 'smart'},\n        'project_thumbnail': {'size': (520, 330), 'crop': 'smart'},\n        'idea_image': {'size': (800, 0), 'crop': 'scale'},\n        'idea_thumbnail': {'size': (240, 240), 'crop': 'smart'},\n    }\n}\n\nALLOWED_UPLOAD_IMAGES = ('png', 'jpeg', 'gif')\n\n\n# Wagtail settings\n\nWAGTAIL_SITE_NAME = 'meinberlin'\n\n# Base URL to use when referring to full URLs within the Wagtail admin backend -\n# e.g. in notification emails. Don't include '/admin' or a trailing slash\nBASE_URL = 'http://localhost:8000'\n\n# Authentication\n\nAUTH_USER_MODEL = 'meinberlin_users.User'\n\nAUTHENTICATION_BACKENDS = (\n    'rules.permissions.ObjectPermissionBackend',\n    'django.contrib.auth.backends.ModelBackend',\n    'allauth.account.auth_backends.AuthenticationBackend',\n)\n\nACCOUNT_ADAPTER = 'apps.users.adapters.AccountAdapter'\nACCOUNT_AUTHENTICATION_METHOD = 'email'\nACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3\nACCOUNT_EMAIL_REQUIRED = True\nACCOUNT_EMAIL_VERIFICATION = 'mandatory'\nACCOUNT_USERNAME_REQUIRED = True\nACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10\nACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300  # seconds\nACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True\nACCOUNT_LOGIN_ON_PASSWORD_RESET = True\nACCOUNT_SIGNUP_FORM_CLASS = 'apps.users.forms.TermsSignupForm'\n\nLOGIN_URL = 'account_login'\nLOGIN_REDIRECT_URL = '/'\n\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\nPASSWORD_HASHERS = [\n    'django.contrib.auth.hashers.PBKDF2PasswordHasher',\n    'django.contrib.auth.hashers.BCryptPasswordHasher',  # a3\n    'apps.users.hashers.A2PasswordHasher',\n]\n\n\n# ckeditor\n\nCKEDITOR_UPLOAD_PATH = \"uploads/\"\nCKEDITOR_RESTRICT_BY_USER = True\nCKEDITOR_ALLOW_NONIMAGE_FILES = False\n\nCKEDITOR_CONFIGS = {\n    'default': {\n        'width': '100%',\n        'toolbar': 'Custom',\n        'toolbar_Custom': [\n            ['Bold', 'Italic', 'Underline'],\n            ['NumberedList', 'BulletedList'],\n            ['Link', 'Unlink']\n        ]\n    },\n    'image-editor': {\n        'width': '100%',\n        'toolbar': 'Custom',\n        'toolbar_Custom': [\n            ['Bold', 'Italic', 'Underline'],\n            ['Image'],\n            ['NumberedList', 'BulletedList'],\n            ['Link', 'Unlink']\n        ]\n    }\n}\n\nBLEACH_LIST = {\n    'default' : {\n        'tags': ['p','strong','em','u','ol','li','ul','a'],\n        'attributes': {\n            'a': ['href', 'rel'],\n        },\n    },\n    'image-editor': {\n        'tags': ['p','strong','em','u','ol','li','ul','a','img'],\n        'attributes': {\n            'a': ['href', 'rel'],\n            'img': ['src', 'alt', 'style']\n        },\n        'styles': [\n            'float',\n            'margin',\n            'padding',\n            'width',\n            'height',\n            'margin-bottom',\n            'margin-top',\n            'margin-left',\n            'margin-right',\n        ],\n    }\n}\n\n\n# adhocracy4\n\nA4_ORGANISATIONS_MODEL = 'meinberlin_organisations.Organisation'\n\nA4_RATEABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_COMMENTABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_documents', 'document'),\n    ('meinberlin_documents', 'paragraph'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_polls', 'poll'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_REPORTABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\nA4_AUTO_FOLLOWABLES = (('a4comments', 'comment'),)\n\nA4_ACTIONABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_AUTO_FOLLOWABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_kiezkasse', 'proposal'),\n    ('meinberlin_polls', 'vote'),  # TODO: really?\n)\n\nA4_MAP_BASEURL = 'https://maps.berlinonline.de/tile/bright/'\nA4_MAP_ATTRIBUTION = '&copy; <a href=\"http://openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\nA4_MAP_BOUNDING_BOX = ([[52.3517, 13.8229], [52.6839, 12.9543]])\n\nCONTACT_EMAIL = 'support-berlin@liqd.de'\nEMAIL_DEFAULT_LANGUAGE = 'de'\n", "path": "meinberlin/settings/base.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for meinberlin project.\n\nGenerated by 'django-admin startproject' using Django 1.8.17.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.8/ref/settings/\n\"\"\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nimport os\n\nPROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nBASE_DIR = os.path.dirname(PROJECT_DIR)\n\n# Application definition\n\nINSTALLED_APPS = (\n    'django.contrib.sites',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n\n    'wagtail.wagtailforms',\n    'wagtail.wagtailredirects',\n    'wagtail.wagtailembeds',\n    'wagtail.wagtailsites',\n    'wagtail.wagtailusers',\n    'wagtail.wagtailsnippets',\n    'wagtail.wagtaildocs',\n    'wagtail.wagtailimages',\n    'wagtail.wagtailsearch',\n    'wagtail.wagtailadmin',\n    'wagtail.wagtailcore',\n    'wagtail.contrib.wagtailstyleguide',\n\n    'taggit',  # wagtail dependency\n    'widget_tweaks',\n    'rest_framework',\n    'allauth',\n    'allauth.account',\n    'allauth.socialaccount',\n    'rules.apps.AutodiscoverRulesConfig',\n    'easy_thumbnails',\n    'ckeditor',\n    'ckeditor_uploader',\n    'capture_tag',\n\n    'adhocracy4.organisations.apps.OrganisationsConfig',\n    'adhocracy4.projects.apps.ProjectsConfig',\n    'adhocracy4.images.apps.ImagesConfig',\n    'adhocracy4.phases.apps.PhasesConfig',\n    'adhocracy4.modules.apps.ModulesConfig',\n    'adhocracy4.ratings.apps.RatingsConfig',\n    'adhocracy4.reports.apps.ReportsConfig',\n    'adhocracy4.comments.apps.CommentsConfig',\n    'adhocracy4.categories.apps.CategoriesConfig',\n    'adhocracy4.maps.apps.MapsConfig',\n    'adhocracy4.actions.apps.ActionsConfig',\n    'adhocracy4.follows.apps.FollowsConfig',\n\n    'apps.contrib.apps.Config',\n    'apps.cms.apps.Config',\n    'apps.users.apps.Config',\n    'apps.projects.apps.Config',\n    'apps.organisations.apps.Config',\n    'apps.embed.apps.Config',\n    'apps.moderatorfeedback.apps.Config',\n    'apps.maps.apps.Config',\n    'apps.notifications.apps.Config',\n\n    'apps.account.apps.Config',\n    'apps.dashboard.apps.Config',\n\n    'apps.bplan.apps.Config',\n    'apps.budgeting.apps.Config',\n    'apps.documents.apps.Config',\n    'apps.extprojects.apps.Config',\n    'apps.ideas.apps.Config',\n    'apps.kiezkasse.apps.Config',\n    'apps.mapideas.apps.Config',\n    'apps.polls.apps.Config',\n    'apps.topicprio.apps.Config',\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n    'django.middleware.locale.LocaleMiddleware',\n\n    'wagtail.wagtailcore.middleware.SiteMiddleware',\n    'wagtail.wagtailredirects.middleware.RedirectMiddleware',\n\n    'apps.embed.middleware.AjaxPathMiddleware',\n)\n\nSITE_ID = 1\n\nROOT_URLCONF = 'meinberlin.urls'\n\nLOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [\n            os.path.join(PROJECT_DIR, 'templates'),\n        ],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = 'meinberlin.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/1.8/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),\n        'TEST': {\n            'NAME': os.path.join(BASE_DIR, 'test_db.sqlite3'),\n        }\n    }\n}\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.8/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'Europe/Berlin'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.8/howto/static-files/\n\nSTATICFILES_DIRS = [\n    os.path.join(PROJECT_DIR, 'static'),\n]\n\nSTATIC_ROOT = os.path.join(BASE_DIR, 'static')\nSTATIC_URL = '/static/'\n\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\nMEDIA_URL = '/media/'\n\nIMAGE_ALIASES = {\n    '*': {\n        'max_size': 5*10**6,\n        'fileformats': ('image/png', 'image/jpeg', 'image/gif')\n    },\n    'heroimage': {'min_resolution': (1300, 600)},\n    'logo': {'min_resolution': (200, 200), 'aspect_ratio': (1, 1)},\n    'avatar': {'min_resolution': (200, 200)},\n    'idea_image': {'min_resolution': (800, 200)},\n}\n\nTHUMBNAIL_ALIASES = {\n    '': {\n        'heroimage': {'size': (1500, 500), 'crop': 'smart'},\n        'heroimage_preview': {'size': (880, 220), 'crop': 'smart'},\n        'project_thumbnail': {'size': (520, 330), 'crop': 'smart'},\n        'idea_image': {'size': (800, 0), 'crop': 'scale'},\n        'idea_thumbnail': {'size': (240, 240), 'crop': 'smart'},\n    }\n}\n\nALLOWED_UPLOAD_IMAGES = ('png', 'jpeg', 'gif')\n\n\n# Wagtail settings\n\nWAGTAIL_SITE_NAME = 'meinberlin'\n\n# Base URL to use when referring to full URLs within the Wagtail admin backend -\n# e.g. in notification emails. Don't include '/admin' or a trailing slash\nBASE_URL = 'http://localhost:8000'\n\n# Authentication\n\nAUTH_USER_MODEL = 'meinberlin_users.User'\n\nAUTHENTICATION_BACKENDS = (\n    'rules.permissions.ObjectPermissionBackend',\n    'django.contrib.auth.backends.ModelBackend',\n    'allauth.account.auth_backends.AuthenticationBackend',\n)\n\nACCOUNT_ADAPTER = 'apps.users.adapters.AccountAdapter'\nACCOUNT_AUTHENTICATION_METHOD = 'username_email'\nACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3\nACCOUNT_EMAIL_REQUIRED = True\nACCOUNT_EMAIL_VERIFICATION = 'mandatory'\nACCOUNT_USERNAME_REQUIRED = True\nACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10\nACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300  # seconds\nACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True\nACCOUNT_LOGIN_ON_PASSWORD_RESET = True\nACCOUNT_SIGNUP_FORM_CLASS = 'apps.users.forms.TermsSignupForm'\n\nLOGIN_URL = 'account_login'\nLOGIN_REDIRECT_URL = '/'\n\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\nPASSWORD_HASHERS = [\n    'django.contrib.auth.hashers.PBKDF2PasswordHasher',\n    'django.contrib.auth.hashers.BCryptPasswordHasher',  # a3\n    'apps.users.hashers.A2PasswordHasher',\n]\n\n\n# ckeditor\n\nCKEDITOR_UPLOAD_PATH = \"uploads/\"\nCKEDITOR_RESTRICT_BY_USER = True\nCKEDITOR_ALLOW_NONIMAGE_FILES = False\n\nCKEDITOR_CONFIGS = {\n    'default': {\n        'width': '100%',\n        'toolbar': 'Custom',\n        'toolbar_Custom': [\n            ['Bold', 'Italic', 'Underline'],\n            ['NumberedList', 'BulletedList'],\n            ['Link', 'Unlink']\n        ]\n    },\n    'image-editor': {\n        'width': '100%',\n        'toolbar': 'Custom',\n        'toolbar_Custom': [\n            ['Bold', 'Italic', 'Underline'],\n            ['Image'],\n            ['NumberedList', 'BulletedList'],\n            ['Link', 'Unlink']\n        ]\n    }\n}\n\nBLEACH_LIST = {\n    'default' : {\n        'tags': ['p','strong','em','u','ol','li','ul','a'],\n        'attributes': {\n            'a': ['href', 'rel'],\n        },\n    },\n    'image-editor': {\n        'tags': ['p','strong','em','u','ol','li','ul','a','img'],\n        'attributes': {\n            'a': ['href', 'rel'],\n            'img': ['src', 'alt', 'style']\n        },\n        'styles': [\n            'float',\n            'margin',\n            'padding',\n            'width',\n            'height',\n            'margin-bottom',\n            'margin-top',\n            'margin-left',\n            'margin-right',\n        ],\n    }\n}\n\n\n# adhocracy4\n\nA4_ORGANISATIONS_MODEL = 'meinberlin_organisations.Organisation'\n\nA4_RATEABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_COMMENTABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_documents', 'document'),\n    ('meinberlin_documents', 'paragraph'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_polls', 'poll'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_REPORTABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_topicprio', 'topic'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\nA4_AUTO_FOLLOWABLES = (('a4comments', 'comment'),)\n\nA4_ACTIONABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_kiezkasse', 'proposal'),\n)\n\nA4_AUTO_FOLLOWABLES = (\n    ('a4comments', 'comment'),\n    ('meinberlin_ideas', 'idea'),\n    ('meinberlin_mapideas', 'mapidea'),\n    ('meinberlin_budgeting', 'proposal'),\n    ('meinberlin_kiezkasse', 'proposal'),\n    ('meinberlin_polls', 'vote'),  # TODO: really?\n)\n\nA4_MAP_BASEURL = 'https://maps.berlinonline.de/tile/bright/'\nA4_MAP_ATTRIBUTION = '&copy; <a href=\"http://openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\nA4_MAP_BOUNDING_BOX = ([[52.3517, 13.8229], [52.6839, 12.9543]])\n\nCONTACT_EMAIL = 'support-berlin@liqd.de'\nEMAIL_DEFAULT_LANGUAGE = 'de'\n", "path": "meinberlin/settings/base.py"}]}