We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Create reset password view under the accounts app.
Currently, when the user wants to reset the password, they go to a Django admin page, which has a different look.  Newly implemented registration and login views have been created under the '/accounts/' path. This task is to replace the current reset password page with a page that looks like the registration and login pages.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `project/core/urls.py`
Content:
```
1 """civiwiki URL Configuration
2 
3 The `urlpatterns` list routes URLs to views. For more information please see:
4     https://docs.djangoproject.com/en/1.8/topics/http/urls/
5 Examples:
6 Function views
7     1. Add an import:  from my_app import views
8     2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
9 Class-based views
10     1. Add an import:  from other_app.views import Home
11     2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
12 Including another URLconf
13     1. Add an import:  from blog import urls as blog_urls
14     2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
15 """
16 import django.contrib.auth.views as auth_views
17 
18 from django.conf.urls import include, url
19 from django.contrib import admin
20 from django.conf import settings
21 from django.urls import path
22 from django.views.static import serve
23 from django.views.generic.base import RedirectView
24 
25 from api import urls as api
26 from accounts import urls as accounts_urls
27 from accounts.views import RegisterView
28 from frontend_views import urls as frontend_views
29 
30 
31 
32 urlpatterns = [
33     path("admin/", admin.site.urls),
34     url(r"^api/", include(api)),
35     url(r"^auth/", include(accounts_urls)),
36 
37     # New accounts paths. These currently implement user registration/authentication in
38     # parallel to the current authentication.
39     path('accounts/register', RegisterView.as_view(), name='accounts_register'),
40     path(
41         'accounts/login',
42         auth_views.LoginView.as_view(template_name='accounts/register/login.html'),
43         name='accounts_login',
44     ),
45 
46     url(
47         "^inbox/notifications/",
48         include("notifications.urls", namespace="notifications"),
49     ),
50 ]
51 
52 urlpatterns += [
53     # A redirect for favicons at the root of the site
54     url(r"^favicon\.ico$", RedirectView.as_view(url="/static/favicon/favicon.ico")),
55     url(
56         r"^favicon-32x32\.png$",
57         RedirectView.as_view(url="/static/favicon/favicon-32x32.png"),
58     ),
59     url(
60         r"^apple-touch-icon\.png$",
61         RedirectView.as_view(url="/static/favicon/apple-touch-icon.png"),
62     ),
63     url(
64         r"^mstile-144x144\.png$",
65         RedirectView.as_view(url="/static/favicon/mstile-144x144.png"),
66     ),
67     # Media and Static file Serve Setup.
68     url(
69         r"^media/(?P<path>.*)$",
70         serve,
71         {"document_root": settings.MEDIA_ROOT, "show_indexes": True},
72     ),
73     url(r"^static/(?P<path>.*)$", serve, {"document_root": settings.STATIC_ROOT}),
74     url(r"^", include(frontend_views)),
75 
76 ]
77
```

Path: `project/accounts/views.py`
Content:
```
1 """
2 Class based views.
3 
4 This module will include views for the accounts app.
5 """
6 
7 from django.conf import settings
8 from django.views.generic.edit import FormView
9 from django.contrib.auth import views as auth_views
10 from django.contrib.auth import authenticate, login
11 from django.contrib.auth.tokens import PasswordResetTokenGenerator
12 from django.contrib.sites.shortcuts import get_current_site
13 from django.utils.encoding import force_bytes
14 from django.utils.http import int_to_base36
15 from django.utils.crypto import salted_hmac
16 from django.utils.http import urlsafe_base64_encode
17 
18 from api.models.account import Account
19 
20 from .forms import AccountRegistrationForm
21 from .models import User
22 from .authentication import send_activation_email
23 
24 
25 class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
26     """Token Generator for Email Confirmation"""
27 
28     key_salt = "django.contrib.auth.tokens.PasswordResetTokenGenerator"
29 
30     def _make_token_with_timestamp(self, user, timestamp):
31         """ Token function pulled from Django 1.11 """
32         ts_b36 = int_to_base36(timestamp)
33 
34         hash = salted_hmac(
35             self.key_salt, str(user.pk) + str(timestamp)
36         ).hexdigest()[::2]
37         return "%s-%s" % (ts_b36, hash)
38 
39 
40 class RegisterView(FormView):
41     """
42     A form view that handles user registration.
43     """
44     template_name = 'accounts/register/register.html'
45     form_class = AccountRegistrationForm
46     success_url = '/'
47 
48     def _create_user(self, form):
49         username = form.cleaned_data['username']
50         password = form.cleaned_data['password']
51         email = form.cleaned_data['email']
52 
53         user = User.objects.create_user(username, email, password)
54 
55         account = Account(user=user)
56         if hasattr(settings, 'CLOSED_BETA') and not settings.CLOSED_BETA:
57             account.beta_access = True
58         account.save()
59 
60         user.is_active = True
61         user.save()
62 
63         return user
64 
65     def _send_email(self, user):
66         domain = get_current_site(self.request).domain
67         send_activation_email(user, domain)
68 
69     def _login(self, user):
70         login(self.request, user)
71 
72     def form_valid(self, form):
73         user = self._create_user(form)
74 
75         self._send_email(user)
76         self._login(user)
77 
78         return super(RegisterView, self).form_valid(form)
79
```

Path: `project/core/settings.py`
Content:
```
1 """
2 Django settings for civiwiki project.
3 Darius Calliet May 12, 2016
4 
5 Production settings file to select proper environment variables.
6 """
7 import os
8 
9 # False if not in os.environ
10 DEBUG = os.getenv("DEBUG", False)
11 
12 # defaults to second value if not found in os.environ
13 DJANGO_HOST = os.getenv("DJANGO_HOST", "LOCALHOST")
14 
15 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
16 SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "TEST_KEY_FOR_DEVELOPMENT")
17 ALLOWED_HOSTS = [".herokuapp.com", ".civiwiki.org", "127.0.0.1", "localhost", "0.0.0.0"]
18 
19 INSTALLED_APPS = (
20     "django.contrib.admin",
21     "django.contrib.auth",
22     "django.contrib.contenttypes",
23     "django.contrib.sessions",
24     "django.contrib.messages",
25     "django.contrib.staticfiles",
26     "django_extensions",
27     "storages",
28     "core",  # TODO: consider removing this, if we can move the decorators, etc. to an actual app
29     "api",
30     "rest_framework",
31     "accounts",
32     "threads",
33     "frontend_views",
34     "notifications",
35     "corsheaders",
36     "taggit",
37 )
38 
39 MIDDLEWARE = [
40     "corsheaders.middleware.CorsMiddleware",
41     "django.middleware.security.SecurityMiddleware",
42     "whitenoise.middleware.WhiteNoiseMiddleware",
43     "django.contrib.sessions.middleware.SessionMiddleware",
44     "django.middleware.common.CommonMiddleware",
45     "django.middleware.csrf.CsrfViewMiddleware",
46     "django.contrib.auth.middleware.AuthenticationMiddleware",
47     # 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
48     "django.contrib.messages.middleware.MessageMiddleware",
49     "django.middleware.clickjacking.XFrameOptionsMiddleware",
50 ]
51 
52 CSRF_USE_SESSIONS = (
53     True  # Store the CSRF token in the users session instead of in a cookie
54 )
55 
56 CORS_ORIGIN_ALLOW_ALL = True
57 ROOT_URLCONF = "core.urls"
58 LOGIN_URL = "/login"
59 
60 # SSL Setup
61 if DJANGO_HOST != "LOCALHOST":
62     SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
63     SECURE_SSL_REDIRECT = True
64     SESSION_COOKIE_SECURE = True
65     CSRF_COOKIE_SECURE = True
66 
67 # Internationalization & Localization
68 LANGUAGE_CODE = "en-us"
69 TIME_ZONE = "UTC"
70 USE_I18N = True
71 USE_L10N = True
72 USE_TZ = True
73 
74 TEMPLATES = [
75     {
76         "BACKEND": "django.template.backends.django.DjangoTemplates",
77         "DIRS": [
78             os.path.join(BASE_DIR, "threads/templates/threads"), os.path.join(BASE_DIR, "accounts/templates/accounts")
79         ],  # TODO: Add non-webapp template directory
80         "APP_DIRS": True,
81         "OPTIONS": {
82             "context_processors": [
83                 "django.template.context_processors.debug",
84                 "django.template.context_processors.request",
85                 "django.contrib.auth.context_processors.auth",
86                 "django.contrib.messages.context_processors.messages",
87             ],
88         },
89     },
90 ]
91 
92 WSGI_APPLICATION = "core.wsgi.application"
93 
94 # Apex Contact for Production Errors
95 ADMINS = [("Development Team", "dev@civiwiki.org")]
96 
97 # AWS S3 Setup
98 if "AWS_STORAGE_BUCKET_NAME" not in os.environ:
99     MEDIA_URL = "/media/"
100     MEDIA_ROOT = os.path.join(BASE_DIR, "media")
101 else:
102     AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
103     AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
104     AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
105     DEFAULT_FILE_STORAGE = "storages.backends.s3boto.S3BotoStorage"
106     AWS_S3_SECURE_URLS = False
107     AWS_QUERYSTRING_AUTH = False
108 
109 STATIC_URL = "/static/"
110 STATICFILES_DIRS = (os.path.join(BASE_DIR, "threads/templates/static"),)
111 STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
112 
113 # TODO: re-organize and simplify staticfiles settings
114 if "CIVIWIKI_LOCAL_NAME" not in os.environ:
115     STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
116 
117 # Use DATABASE_URL in production
118 DATABASE_URL = os.getenv("DATABASE_URL")
119 
120 if DATABASE_URL is not None:
121     DATABASES = {"default": DATABASE_URL}
122 else:
123     # Default to sqlite for simplicity in development
124     DATABASES = {
125         "default": {
126             "ENGINE": "django.db.backends.sqlite3",
127             "NAME": BASE_DIR + "/" + "db.sqlite3",
128         }
129     }
130 
131 # Email Backend Setup
132 if "EMAIL_HOST" not in os.environ:
133     EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
134     EMAIL_HOST_USER = "test@civiwiki.org"
135 else:
136     EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
137     EMAIL_HOST = os.getenv("EMAIL_HOST")
138     EMAIL_PORT = os.getenv("EMAIL_PORT")
139     EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER")
140     EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD")
141     EMAIL_USE_SSL = True
142     DEFAULT_FROM_EMAIL = EMAIL_HOST
143 
144 # Notification API Settings
145 NOTIFICATIONS_SOFT_DELETE = True
146 NOTIFICATIONS_USE_JSONFIELD = True
147 
148 # Django REST API Settings
149 DEFAULT_RENDERER_CLASSES = ("rest_framework.renderers.JSONRenderer",)
150 
151 DEFAULT_AUTHENTICATION_CLASSES = ("rest_framework.authentication.BasicAuthentication",)
152 
153 if DEBUG:
154     # Browsable HTML - Enabled only in Debug mode (dev)
155     DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (
156         "rest_framework.renderers.BrowsableAPIRenderer",
157     )
158 
159     DEFAULT_AUTHENTICATION_CLASSES = (
160         "api.authentication.CsrfExemptSessionAuthentication",
161     ) + DEFAULT_AUTHENTICATION_CLASSES
162 
163 REST_FRAMEWORK = {
164     "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
165     "DEFAULT_RENDERER_CLASSES": DEFAULT_RENDERER_CLASSES,
166     "DEFAULT_AUTHENTICATION_CLASSES": DEFAULT_AUTHENTICATION_CLASSES,
167 }
168 
169 # CORS Settings
170 CORS_ORIGIN_ALLOW_ALL = True
171 
172 # Custom User model
173 AUTH_USER_MODEL = 'accounts.User'
174 
175 APPEND_SLASH = False
176 
177 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
178
```
--- 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/project/accounts/views.py b/project/accounts/views.py
--- a/project/accounts/views.py
+++ b/project/accounts/views.py
@@ -14,6 +14,7 @@
 from django.utils.http import int_to_base36
 from django.utils.crypto import salted_hmac
 from django.utils.http import urlsafe_base64_encode
+from django.urls import reverse_lazy
 
 from api.models.account import Account
 
@@ -76,3 +77,24 @@
         self._login(user)
 
         return super(RegisterView, self).form_valid(form)
+
+
+class PasswordResetView(auth_views.PasswordResetView):
+    template_name = 'accounts/users/password_reset.html'
+    email_template_name = 'accounts/users/password_reset_email.html'
+    subject_template_name = 'accounts/users/password_reset_subject.txt'
+    from_email = settings.EMAIL_HOST_USER
+    success_url = reverse_lazy('accounts_password_reset_done')
+
+
+class PasswordResetDoneView(auth_views.PasswordResetDoneView):
+    template_name = 'accounts/users/password_reset_done.html'
+
+
+class PasswordResetConfirmView(auth_views.PasswordResetConfirmView):
+    template_name = 'accounts/users/password_reset_confirm.html'
+    success_url = reverse_lazy('accounts_password_reset_complete')
+
+
+class PasswordResetCompleteView(auth_views.PasswordResetCompleteView):
+    template_name = 'accounts/users/password_reset_complete.html'
diff --git a/project/core/settings.py b/project/core/settings.py
--- a/project/core/settings.py
+++ b/project/core/settings.py
@@ -175,3 +175,23 @@
 APPEND_SLASH = False
 
 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
+
+LOGIN_REDIRECT_URL = '/'
+
+AUTH_PASSWORD_VALIDATORS = [
+    {
+        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+        'OPTIONS': {
+            'min_length': 8,
+        }
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+    },
+]
diff --git a/project/core/urls.py b/project/core/urls.py
--- a/project/core/urls.py
+++ b/project/core/urls.py
@@ -24,7 +24,8 @@
 
 from api import urls as api
 from accounts import urls as accounts_urls
-from accounts.views import RegisterView
+from accounts.views import (RegisterView, PasswordResetView, PasswordResetDoneView,
+                            PasswordResetConfirmView, PasswordResetCompleteView)
 from frontend_views import urls as frontend_views
 
 
@@ -43,6 +44,28 @@
         name='accounts_login',
     ),
 
+    path(
+        'accounts/password_reset',
+        PasswordResetView.as_view(),
+        name='accounts_password_reset',
+    ),
+
+    path(
+        'accounts/password_reset_done',
+        PasswordResetDoneView.as_view(),
+        name='accounts_password_reset_done',
+    ),
+    path(
+        'accounts/password_reset_confirm/<uidb64>/<token>',
+        PasswordResetConfirmView.as_view(),
+        name='accounts_password_reset_confirm',
+    ),
+
+    path(
+        'accounts/password_reset_complete',
+        PasswordResetCompleteView.as_view(),
+        name='accounts_password_reset_complete',
+    ),
     url(
         "^inbox/notifications/",
         include("notifications.urls", namespace="notifications"),

{"golden_diff": "diff --git a/project/accounts/views.py b/project/accounts/views.py\n--- a/project/accounts/views.py\n+++ b/project/accounts/views.py\n@@ -14,6 +14,7 @@\n from django.utils.http import int_to_base36\n from django.utils.crypto import salted_hmac\n from django.utils.http import urlsafe_base64_encode\n+from django.urls import reverse_lazy\n \n from api.models.account import Account\n \n@@ -76,3 +77,24 @@\n         self._login(user)\n \n         return super(RegisterView, self).form_valid(form)\n+\n+\n+class PasswordResetView(auth_views.PasswordResetView):\n+    template_name = 'accounts/users/password_reset.html'\n+    email_template_name = 'accounts/users/password_reset_email.html'\n+    subject_template_name = 'accounts/users/password_reset_subject.txt'\n+    from_email = settings.EMAIL_HOST_USER\n+    success_url = reverse_lazy('accounts_password_reset_done')\n+\n+\n+class PasswordResetDoneView(auth_views.PasswordResetDoneView):\n+    template_name = 'accounts/users/password_reset_done.html'\n+\n+\n+class PasswordResetConfirmView(auth_views.PasswordResetConfirmView):\n+    template_name = 'accounts/users/password_reset_confirm.html'\n+    success_url = reverse_lazy('accounts_password_reset_complete')\n+\n+\n+class PasswordResetCompleteView(auth_views.PasswordResetCompleteView):\n+    template_name = 'accounts/users/password_reset_complete.html'\ndiff --git a/project/core/settings.py b/project/core/settings.py\n--- a/project/core/settings.py\n+++ b/project/core/settings.py\n@@ -175,3 +175,23 @@\n APPEND_SLASH = False\n \n DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'\n+\n+LOGIN_REDIRECT_URL = '/'\n+\n+AUTH_PASSWORD_VALIDATORS = [\n+    {\n+        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n+    },\n+    {\n+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n+        'OPTIONS': {\n+            'min_length': 8,\n+        }\n+    },\n+    {\n+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n+    },\n+    {\n+        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n+    },\n+]\ndiff --git a/project/core/urls.py b/project/core/urls.py\n--- a/project/core/urls.py\n+++ b/project/core/urls.py\n@@ -24,7 +24,8 @@\n \n from api import urls as api\n from accounts import urls as accounts_urls\n-from accounts.views import RegisterView\n+from accounts.views import (RegisterView, PasswordResetView, PasswordResetDoneView,\n+                            PasswordResetConfirmView, PasswordResetCompleteView)\n from frontend_views import urls as frontend_views\n \n \n@@ -43,6 +44,28 @@\n         name='accounts_login',\n     ),\n \n+    path(\n+        'accounts/password_reset',\n+        PasswordResetView.as_view(),\n+        name='accounts_password_reset',\n+    ),\n+\n+    path(\n+        'accounts/password_reset_done',\n+        PasswordResetDoneView.as_view(),\n+        name='accounts_password_reset_done',\n+    ),\n+    path(\n+        'accounts/password_reset_confirm/<uidb64>/<token>',\n+        PasswordResetConfirmView.as_view(),\n+        name='accounts_password_reset_confirm',\n+    ),\n+\n+    path(\n+        'accounts/password_reset_complete',\n+        PasswordResetCompleteView.as_view(),\n+        name='accounts_password_reset_complete',\n+    ),\n     url(\n         \"^inbox/notifications/\",\n         include(\"notifications.urls\", namespace=\"notifications\"),\n", "issue": "Create reset password view under the accounts app.\nCurrently, when the user wants to reset the password, they go to a Django admin page, which has a different look.  Newly implemented registration and login views have been created under the '/accounts/' path. This task is to replace the current reset password page with a page that looks like the registration and login pages.\n", "before_files": [{"content": "\"\"\"civiwiki URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Add an import:  from blog import urls as blog_urls\n    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))\n\"\"\"\nimport django.contrib.auth.views as auth_views\n\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.conf import settings\nfrom django.urls import path\nfrom django.views.static import serve\nfrom django.views.generic.base import RedirectView\n\nfrom api import urls as api\nfrom accounts import urls as accounts_urls\nfrom accounts.views import RegisterView\nfrom frontend_views import urls as frontend_views\n\n\n\nurlpatterns = [\n    path(\"admin/\", admin.site.urls),\n    url(r\"^api/\", include(api)),\n    url(r\"^auth/\", include(accounts_urls)),\n\n    # New accounts paths. These currently implement user registration/authentication in\n    # parallel to the current authentication.\n    path('accounts/register', RegisterView.as_view(), name='accounts_register'),\n    path(\n        'accounts/login',\n        auth_views.LoginView.as_view(template_name='accounts/register/login.html'),\n        name='accounts_login',\n    ),\n\n    url(\n        \"^inbox/notifications/\",\n        include(\"notifications.urls\", namespace=\"notifications\"),\n    ),\n]\n\nurlpatterns += [\n    # A redirect for favicons at the root of the site\n    url(r\"^favicon\\.ico$\", RedirectView.as_view(url=\"/static/favicon/favicon.ico\")),\n    url(\n        r\"^favicon-32x32\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/favicon-32x32.png\"),\n    ),\n    url(\n        r\"^apple-touch-icon\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/apple-touch-icon.png\"),\n    ),\n    url(\n        r\"^mstile-144x144\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/mstile-144x144.png\"),\n    ),\n    # Media and Static file Serve Setup.\n    url(\n        r\"^media/(?P<path>.*)$\",\n        serve,\n        {\"document_root\": settings.MEDIA_ROOT, \"show_indexes\": True},\n    ),\n    url(r\"^static/(?P<path>.*)$\", serve, {\"document_root\": settings.STATIC_ROOT}),\n    url(r\"^\", include(frontend_views)),\n\n]\n", "path": "project/core/urls.py"}, {"content": "\"\"\"\nClass based views.\n\nThis module will include views for the accounts app.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.views.generic.edit import FormView\nfrom django.contrib.auth import views as auth_views\nfrom django.contrib.auth import authenticate, login\nfrom django.contrib.auth.tokens import PasswordResetTokenGenerator\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.utils.encoding import force_bytes\nfrom django.utils.http import int_to_base36\nfrom django.utils.crypto import salted_hmac\nfrom django.utils.http import urlsafe_base64_encode\n\nfrom api.models.account import Account\n\nfrom .forms import AccountRegistrationForm\nfrom .models import User\nfrom .authentication import send_activation_email\n\n\nclass AccountActivationTokenGenerator(PasswordResetTokenGenerator):\n    \"\"\"Token Generator for Email Confirmation\"\"\"\n\n    key_salt = \"django.contrib.auth.tokens.PasswordResetTokenGenerator\"\n\n    def _make_token_with_timestamp(self, user, timestamp):\n        \"\"\" Token function pulled from Django 1.11 \"\"\"\n        ts_b36 = int_to_base36(timestamp)\n\n        hash = salted_hmac(\n            self.key_salt, str(user.pk) + str(timestamp)\n        ).hexdigest()[::2]\n        return \"%s-%s\" % (ts_b36, hash)\n\n\nclass RegisterView(FormView):\n    \"\"\"\n    A form view that handles user registration.\n    \"\"\"\n    template_name = 'accounts/register/register.html'\n    form_class = AccountRegistrationForm\n    success_url = '/'\n\n    def _create_user(self, form):\n        username = form.cleaned_data['username']\n        password = form.cleaned_data['password']\n        email = form.cleaned_data['email']\n\n        user = User.objects.create_user(username, email, password)\n\n        account = Account(user=user)\n        if hasattr(settings, 'CLOSED_BETA') and not settings.CLOSED_BETA:\n            account.beta_access = True\n        account.save()\n\n        user.is_active = True\n        user.save()\n\n        return user\n\n    def _send_email(self, user):\n        domain = get_current_site(self.request).domain\n        send_activation_email(user, domain)\n\n    def _login(self, user):\n        login(self.request, user)\n\n    def form_valid(self, form):\n        user = self._create_user(form)\n\n        self._send_email(user)\n        self._login(user)\n\n        return super(RegisterView, self).form_valid(form)\n", "path": "project/accounts/views.py"}, {"content": "\"\"\"\nDjango settings for civiwiki project.\nDarius Calliet May 12, 2016\n\nProduction settings file to select proper environment variables.\n\"\"\"\nimport os\n\n# False if not in os.environ\nDEBUG = os.getenv(\"DEBUG\", False)\n\n# defaults to second value if not found in os.environ\nDJANGO_HOST = os.getenv(\"DJANGO_HOST\", \"LOCALHOST\")\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nSECRET_KEY = os.getenv(\"DJANGO_SECRET_KEY\", \"TEST_KEY_FOR_DEVELOPMENT\")\nALLOWED_HOSTS = [\".herokuapp.com\", \".civiwiki.org\", \"127.0.0.1\", \"localhost\", \"0.0.0.0\"]\n\nINSTALLED_APPS = (\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_extensions\",\n    \"storages\",\n    \"core\",  # TODO: consider removing this, if we can move the decorators, etc. to an actual app\n    \"api\",\n    \"rest_framework\",\n    \"accounts\",\n    \"threads\",\n    \"frontend_views\",\n    \"notifications\",\n    \"corsheaders\",\n    \"taggit\",\n)\n\nMIDDLEWARE = [\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\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]\n\nCSRF_USE_SESSIONS = (\n    True  # Store the CSRF token in the users session instead of in a cookie\n)\n\nCORS_ORIGIN_ALLOW_ALL = True\nROOT_URLCONF = \"core.urls\"\nLOGIN_URL = \"/login\"\n\n# SSL Setup\nif DJANGO_HOST != \"LOCALHOST\":\n    SECURE_PROXY_SSL_HEADER = (\"HTTP_X_FORWARDED_PROTO\", \"https\")\n    SECURE_SSL_REDIRECT = True\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n\n# Internationalization & Localization\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\n            os.path.join(BASE_DIR, \"threads/templates/threads\"), os.path.join(BASE_DIR, \"accounts/templates/accounts\")\n        ],  # TODO: Add non-webapp template directory\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 = \"core.wsgi.application\"\n\n# Apex Contact for Production Errors\nADMINS = [(\"Development Team\", \"dev@civiwiki.org\")]\n\n# AWS S3 Setup\nif \"AWS_STORAGE_BUCKET_NAME\" not in os.environ:\n    MEDIA_URL = \"/media/\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\nelse:\n    AWS_STORAGE_BUCKET_NAME = os.getenv(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_ACCESS_KEY_ID = os.getenv(\"AWS_S3_ACCESS_KEY_ID\")\n    AWS_S3_SECRET_ACCESS_KEY = os.getenv(\"AWS_S3_SECRET_ACCESS_KEY\")\n    DEFAULT_FILE_STORAGE = \"storages.backends.s3boto.S3BotoStorage\"\n    AWS_S3_SECURE_URLS = False\n    AWS_QUERYSTRING_AUTH = False\n\nSTATIC_URL = \"/static/\"\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"threads/templates/static\"),)\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\n\n# TODO: re-organize and simplify staticfiles settings\nif \"CIVIWIKI_LOCAL_NAME\" not in os.environ:\n    STATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\n# Use DATABASE_URL in production\nDATABASE_URL = os.getenv(\"DATABASE_URL\")\n\nif DATABASE_URL is not None:\n    DATABASES = {\"default\": DATABASE_URL}\nelse:\n    # Default to sqlite for simplicity in development\n    DATABASES = {\n        \"default\": {\n            \"ENGINE\": \"django.db.backends.sqlite3\",\n            \"NAME\": BASE_DIR + \"/\" + \"db.sqlite3\",\n        }\n    }\n\n# Email Backend Setup\nif \"EMAIL_HOST\" not in os.environ:\n    EMAIL_BACKEND = \"django.core.mail.backends.console.EmailBackend\"\n    EMAIL_HOST_USER = \"test@civiwiki.org\"\nelse:\n    EMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\n    EMAIL_HOST = os.getenv(\"EMAIL_HOST\")\n    EMAIL_PORT = os.getenv(\"EMAIL_PORT\")\n    EMAIL_HOST_USER = os.getenv(\"EMAIL_HOST_USER\")\n    EMAIL_HOST_PASSWORD = os.getenv(\"EMAIL_HOST_PASSWORD\")\n    EMAIL_USE_SSL = True\n    DEFAULT_FROM_EMAIL = EMAIL_HOST\n\n# Notification API Settings\nNOTIFICATIONS_SOFT_DELETE = True\nNOTIFICATIONS_USE_JSONFIELD = True\n\n# Django REST API Settings\nDEFAULT_RENDERER_CLASSES = (\"rest_framework.renderers.JSONRenderer\",)\n\nDEFAULT_AUTHENTICATION_CLASSES = (\"rest_framework.authentication.BasicAuthentication\",)\n\nif DEBUG:\n    # Browsable HTML - Enabled only in Debug mode (dev)\n    DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    )\n\n    DEFAULT_AUTHENTICATION_CLASSES = (\n        \"api.authentication.CsrfExemptSessionAuthentication\",\n    ) + DEFAULT_AUTHENTICATION_CLASSES\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": (\"rest_framework.permissions.IsAuthenticated\",),\n    \"DEFAULT_RENDERER_CLASSES\": DEFAULT_RENDERER_CLASSES,\n    \"DEFAULT_AUTHENTICATION_CLASSES\": DEFAULT_AUTHENTICATION_CLASSES,\n}\n\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\n\n# Custom User model\nAUTH_USER_MODEL = 'accounts.User'\n\nAPPEND_SLASH = False\n\nDEFAULT_AUTO_FIELD = 'django.db.models.AutoField'\n", "path": "project/core/settings.py"}], "after_files": [{"content": "\"\"\"civiwiki URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/1.8/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Add an import:  from blog import urls as blog_urls\n    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))\n\"\"\"\nimport django.contrib.auth.views as auth_views\n\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.conf import settings\nfrom django.urls import path\nfrom django.views.static import serve\nfrom django.views.generic.base import RedirectView\n\nfrom api import urls as api\nfrom accounts import urls as accounts_urls\nfrom accounts.views import (RegisterView, PasswordResetView, PasswordResetDoneView,\n                            PasswordResetConfirmView, PasswordResetCompleteView)\nfrom frontend_views import urls as frontend_views\n\n\n\nurlpatterns = [\n    path(\"admin/\", admin.site.urls),\n    url(r\"^api/\", include(api)),\n    url(r\"^auth/\", include(accounts_urls)),\n\n    # New accounts paths. These currently implement user registration/authentication in\n    # parallel to the current authentication.\n    path('accounts/register', RegisterView.as_view(), name='accounts_register'),\n    path(\n        'accounts/login',\n        auth_views.LoginView.as_view(template_name='accounts/register/login.html'),\n        name='accounts_login',\n    ),\n\n    path(\n        'accounts/password_reset',\n        PasswordResetView.as_view(),\n        name='accounts_password_reset',\n    ),\n\n    path(\n        'accounts/password_reset_done',\n        PasswordResetDoneView.as_view(),\n        name='accounts_password_reset_done',\n    ),\n    path(\n        'accounts/password_reset_confirm/<uidb64>/<token>',\n        PasswordResetConfirmView.as_view(),\n        name='accounts_password_reset_confirm',\n    ),\n\n    path(\n        'accounts/password_reset_complete',\n        PasswordResetCompleteView.as_view(),\n        name='accounts_password_reset_complete',\n    ),\n    url(\n        \"^inbox/notifications/\",\n        include(\"notifications.urls\", namespace=\"notifications\"),\n    ),\n]\n\nurlpatterns += [\n    # A redirect for favicons at the root of the site\n    url(r\"^favicon\\.ico$\", RedirectView.as_view(url=\"/static/favicon/favicon.ico\")),\n    url(\n        r\"^favicon-32x32\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/favicon-32x32.png\"),\n    ),\n    url(\n        r\"^apple-touch-icon\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/apple-touch-icon.png\"),\n    ),\n    url(\n        r\"^mstile-144x144\\.png$\",\n        RedirectView.as_view(url=\"/static/favicon/mstile-144x144.png\"),\n    ),\n    # Media and Static file Serve Setup.\n    url(\n        r\"^media/(?P<path>.*)$\",\n        serve,\n        {\"document_root\": settings.MEDIA_ROOT, \"show_indexes\": True},\n    ),\n    url(r\"^static/(?P<path>.*)$\", serve, {\"document_root\": settings.STATIC_ROOT}),\n    url(r\"^\", include(frontend_views)),\n\n]\n", "path": "project/core/urls.py"}, {"content": "\"\"\"\nClass based views.\n\nThis module will include views for the accounts app.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.views.generic.edit import FormView\nfrom django.contrib.auth import views as auth_views\nfrom django.contrib.auth import authenticate, login\nfrom django.contrib.auth.tokens import PasswordResetTokenGenerator\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.utils.encoding import force_bytes\nfrom django.utils.http import int_to_base36\nfrom django.utils.crypto import salted_hmac\nfrom django.utils.http import urlsafe_base64_encode\nfrom django.urls import reverse_lazy\n\nfrom api.models.account import Account\n\nfrom .forms import AccountRegistrationForm\nfrom .models import User\nfrom .authentication import send_activation_email\n\n\nclass AccountActivationTokenGenerator(PasswordResetTokenGenerator):\n    \"\"\"Token Generator for Email Confirmation\"\"\"\n\n    key_salt = \"django.contrib.auth.tokens.PasswordResetTokenGenerator\"\n\n    def _make_token_with_timestamp(self, user, timestamp):\n        \"\"\" Token function pulled from Django 1.11 \"\"\"\n        ts_b36 = int_to_base36(timestamp)\n\n        hash = salted_hmac(\n            self.key_salt, str(user.pk) + str(timestamp)\n        ).hexdigest()[::2]\n        return \"%s-%s\" % (ts_b36, hash)\n\n\nclass RegisterView(FormView):\n    \"\"\"\n    A form view that handles user registration.\n    \"\"\"\n    template_name = 'accounts/register/register.html'\n    form_class = AccountRegistrationForm\n    success_url = '/'\n\n    def _create_user(self, form):\n        username = form.cleaned_data['username']\n        password = form.cleaned_data['password']\n        email = form.cleaned_data['email']\n\n        user = User.objects.create_user(username, email, password)\n\n        account = Account(user=user)\n        if hasattr(settings, 'CLOSED_BETA') and not settings.CLOSED_BETA:\n            account.beta_access = True\n        account.save()\n\n        user.is_active = True\n        user.save()\n\n        return user\n\n    def _send_email(self, user):\n        domain = get_current_site(self.request).domain\n        send_activation_email(user, domain)\n\n    def _login(self, user):\n        login(self.request, user)\n\n    def form_valid(self, form):\n        user = self._create_user(form)\n\n        self._send_email(user)\n        self._login(user)\n\n        return super(RegisterView, self).form_valid(form)\n\n\nclass PasswordResetView(auth_views.PasswordResetView):\n    template_name = 'accounts/users/password_reset.html'\n    email_template_name = 'accounts/users/password_reset_email.html'\n    subject_template_name = 'accounts/users/password_reset_subject.txt'\n    from_email = settings.EMAIL_HOST_USER\n    success_url = reverse_lazy('accounts_password_reset_done')\n\n\nclass PasswordResetDoneView(auth_views.PasswordResetDoneView):\n    template_name = 'accounts/users/password_reset_done.html'\n\n\nclass PasswordResetConfirmView(auth_views.PasswordResetConfirmView):\n    template_name = 'accounts/users/password_reset_confirm.html'\n    success_url = reverse_lazy('accounts_password_reset_complete')\n\n\nclass PasswordResetCompleteView(auth_views.PasswordResetCompleteView):\n    template_name = 'accounts/users/password_reset_complete.html'\n", "path": "project/accounts/views.py"}, {"content": "\"\"\"\nDjango settings for civiwiki project.\nDarius Calliet May 12, 2016\n\nProduction settings file to select proper environment variables.\n\"\"\"\nimport os\n\n# False if not in os.environ\nDEBUG = os.getenv(\"DEBUG\", False)\n\n# defaults to second value if not found in os.environ\nDJANGO_HOST = os.getenv(\"DJANGO_HOST\", \"LOCALHOST\")\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nSECRET_KEY = os.getenv(\"DJANGO_SECRET_KEY\", \"TEST_KEY_FOR_DEVELOPMENT\")\nALLOWED_HOSTS = [\".herokuapp.com\", \".civiwiki.org\", \"127.0.0.1\", \"localhost\", \"0.0.0.0\"]\n\nINSTALLED_APPS = (\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_extensions\",\n    \"storages\",\n    \"core\",  # TODO: consider removing this, if we can move the decorators, etc. to an actual app\n    \"api\",\n    \"rest_framework\",\n    \"accounts\",\n    \"threads\",\n    \"frontend_views\",\n    \"notifications\",\n    \"corsheaders\",\n    \"taggit\",\n)\n\nMIDDLEWARE = [\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\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]\n\nCSRF_USE_SESSIONS = (\n    True  # Store the CSRF token in the users session instead of in a cookie\n)\n\nCORS_ORIGIN_ALLOW_ALL = True\nROOT_URLCONF = \"core.urls\"\nLOGIN_URL = \"/login\"\n\n# SSL Setup\nif DJANGO_HOST != \"LOCALHOST\":\n    SECURE_PROXY_SSL_HEADER = (\"HTTP_X_FORWARDED_PROTO\", \"https\")\n    SECURE_SSL_REDIRECT = True\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n\n# Internationalization & Localization\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\n            os.path.join(BASE_DIR, \"threads/templates/threads\"), os.path.join(BASE_DIR, \"accounts/templates/accounts\")\n        ],  # TODO: Add non-webapp template directory\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 = \"core.wsgi.application\"\n\n# Apex Contact for Production Errors\nADMINS = [(\"Development Team\", \"dev@civiwiki.org\")]\n\n# AWS S3 Setup\nif \"AWS_STORAGE_BUCKET_NAME\" not in os.environ:\n    MEDIA_URL = \"/media/\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\nelse:\n    AWS_STORAGE_BUCKET_NAME = os.getenv(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_ACCESS_KEY_ID = os.getenv(\"AWS_S3_ACCESS_KEY_ID\")\n    AWS_S3_SECRET_ACCESS_KEY = os.getenv(\"AWS_S3_SECRET_ACCESS_KEY\")\n    DEFAULT_FILE_STORAGE = \"storages.backends.s3boto.S3BotoStorage\"\n    AWS_S3_SECURE_URLS = False\n    AWS_QUERYSTRING_AUTH = False\n\nSTATIC_URL = \"/static/\"\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"threads/templates/static\"),)\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\n\n# TODO: re-organize and simplify staticfiles settings\nif \"CIVIWIKI_LOCAL_NAME\" not in os.environ:\n    STATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\n# Use DATABASE_URL in production\nDATABASE_URL = os.getenv(\"DATABASE_URL\")\n\nif DATABASE_URL is not None:\n    DATABASES = {\"default\": DATABASE_URL}\nelse:\n    # Default to sqlite for simplicity in development\n    DATABASES = {\n        \"default\": {\n            \"ENGINE\": \"django.db.backends.sqlite3\",\n            \"NAME\": BASE_DIR + \"/\" + \"db.sqlite3\",\n        }\n    }\n\n# Email Backend Setup\nif \"EMAIL_HOST\" not in os.environ:\n    EMAIL_BACKEND = \"django.core.mail.backends.console.EmailBackend\"\n    EMAIL_HOST_USER = \"test@civiwiki.org\"\nelse:\n    EMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\n    EMAIL_HOST = os.getenv(\"EMAIL_HOST\")\n    EMAIL_PORT = os.getenv(\"EMAIL_PORT\")\n    EMAIL_HOST_USER = os.getenv(\"EMAIL_HOST_USER\")\n    EMAIL_HOST_PASSWORD = os.getenv(\"EMAIL_HOST_PASSWORD\")\n    EMAIL_USE_SSL = True\n    DEFAULT_FROM_EMAIL = EMAIL_HOST\n\n# Notification API Settings\nNOTIFICATIONS_SOFT_DELETE = True\nNOTIFICATIONS_USE_JSONFIELD = True\n\n# Django REST API Settings\nDEFAULT_RENDERER_CLASSES = (\"rest_framework.renderers.JSONRenderer\",)\n\nDEFAULT_AUTHENTICATION_CLASSES = (\"rest_framework.authentication.BasicAuthentication\",)\n\nif DEBUG:\n    # Browsable HTML - Enabled only in Debug mode (dev)\n    DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    )\n\n    DEFAULT_AUTHENTICATION_CLASSES = (\n        \"api.authentication.CsrfExemptSessionAuthentication\",\n    ) + DEFAULT_AUTHENTICATION_CLASSES\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": (\"rest_framework.permissions.IsAuthenticated\",),\n    \"DEFAULT_RENDERER_CLASSES\": DEFAULT_RENDERER_CLASSES,\n    \"DEFAULT_AUTHENTICATION_CLASSES\": DEFAULT_AUTHENTICATION_CLASSES,\n}\n\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\n\n# Custom User model\nAUTH_USER_MODEL = 'accounts.User'\n\nAPPEND_SLASH = False\n\nDEFAULT_AUTO_FIELD = 'django.db.models.AutoField'\n\nLOGIN_REDIRECT_URL = '/'\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n        'OPTIONS': {\n            'min_length': 8,\n        }\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n    },\n]\n", "path": "project/core/settings.py"}]}