We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Create a template view to show after successful email verification during Signup
### Description

When a user registers on EvalAI, he receives an email that contains a unique link to confirm his email id. Whenever he clicks on the link, he should be shown a static page similar to this http://api.evalai.cloudcv.org/api/auth/registration/account-confirm-email/MTc:1cpmQ6:0_PqK9K-JJuKYxC3aSY2Bjt3OLU/

### Todo 

1. Override the URL Patterns for the URL  `/api/auth/registration/account-confirm-email/<token>/` to convert it to django TemplateView
2. Create a template at the backend that is served to the user whenever he clicks on the unique link. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `settings/common.py`
Content:
```
1 """
2 Django settings for evalai project.
3 
4 Generated by 'django-admin startproject' using Django 1.10.2.
5 
6 For more information on this file, see
7 https://docs.djangoproject.com/en/1.10/topics/settings/
8 
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/1.10/ref/settings/
11 """
12 
13 import datetime
14 import os
15 import sys
16 
17 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
18 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19 APPS_DIR = os.path.join(BASE_DIR, 'apps')
20 
21 sys.path.append(APPS_DIR)
22 
23 # Quick-start development settings - unsuitable for production
24 # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
25 
26 # SECURITY WARNING: keep the secret key used in production secret!
27 SECRET_KEY = os.environ.get('SECRET_KEY', 'random_secret_key')
28 
29 # SECURITY WARNING: don't run with debug turned on in production!
30 DEBUG = True
31 
32 ALLOWED_HOSTS = []
33 
34 
35 # Application definition
36 
37 DEFAULT_APPS = [
38     'django.contrib.admin',
39     'django.contrib.auth',
40     'django.contrib.contenttypes',
41     'django.contrib.sessions',
42     'django.contrib.messages',
43     'django.contrib.staticfiles',
44     'django.contrib.sites',
45 ]
46 
47 OUR_APPS = [
48     'accounts',
49     'analytics',
50     'base',
51     'challenges',
52     'hosts',
53     'jobs',
54     'participants',
55     'web',
56 ]
57 
58 THIRD_PARTY_APPS = [
59     'allauth',
60     'allauth.account',
61     'corsheaders',
62     'rest_auth',
63     'rest_auth.registration',
64     'rest_framework.authtoken',
65     'rest_framework',
66     'rest_framework_docs',
67     'rest_framework_expiring_authtoken',
68 ]
69 
70 INSTALLED_APPS = DEFAULT_APPS + OUR_APPS + THIRD_PARTY_APPS
71 
72 MIDDLEWARE = [
73     'corsheaders.middleware.CorsMiddleware',
74     'django.middleware.security.SecurityMiddleware',
75     'django.contrib.sessions.middleware.SessionMiddleware',
76     'django.middleware.common.CommonMiddleware',
77     'django.middleware.csrf.CsrfViewMiddleware',
78     'django.contrib.auth.middleware.AuthenticationMiddleware',
79     'django.contrib.messages.middleware.MessageMiddleware',
80     'django.middleware.clickjacking.XFrameOptionsMiddleware',
81 ]
82 
83 ROOT_URLCONF = 'evalai.urls'
84 
85 
86 TEMPLATES = [
87     {
88         'BACKEND': 'django.template.backends.django.DjangoTemplates',
89         'DIRS': [],
90         'APP_DIRS': True,
91         'OPTIONS': {
92             'context_processors': [
93                 'django.template.context_processors.debug',
94                 'django.template.context_processors.request',
95                 'django.contrib.auth.context_processors.auth',
96                 'django.contrib.messages.context_processors.messages',
97             ],
98         },
99     },
100 ]
101 
102 WSGI_APPLICATION = 'evalai.wsgi.application'
103 
104 
105 # Password validation
106 # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
107 
108 AUTH_PASSWORD_VALIDATORS = [
109     {
110         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',  # noqa
111     },
112     {
113         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',  # noqa
114     },
115     {
116         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',  # noqa
117     },
118     {
119         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',  # noqa
120     },
121 ]
122 
123 
124 # Internationalization
125 # https://docs.djangoproject.com/en/1.10/topics/i18n/
126 
127 LANGUAGE_CODE = 'en-us'
128 
129 TIME_ZONE = 'UTC'
130 
131 USE_I18N = True
132 
133 USE_L10N = True
134 
135 USE_TZ = True
136 
137 # Static files (CSS, JavaScript, Images)
138 # https://docs.djangoproject.com/en/1.10/howto/static-files/
139 
140 STATIC_URL = '/static/'
141 
142 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
143 MEDIA_URL = "/media/"
144 
145 SITE_ID = 1
146 
147 REST_FRAMEWORK = {
148     'DEFAULT_PAGINATION_CLASS': (
149         'rest_framework.pagination.LimitOffsetPagination'),
150     'PAGE_SIZE': 10,
151     'DEFAULT_PERMISSION_CLASSES': [
152         'rest_framework.permissions.IsAuthenticatedOrReadOnly'
153     ],
154     'DEFAULT_AUTHENTICATION_CLASSES': [
155         'rest_framework_expiring_authtoken.authentication.ExpiringTokenAuthentication',
156     ],
157     'TEST_REQUEST_DEFAULT_FORMAT': 'json',
158     'DEFAULT_THROTTLE_CLASSES': (
159         'rest_framework.throttling.AnonRateThrottle',
160         'rest_framework.throttling.UserRateThrottle'
161     ),
162     'DEFAULT_THROTTLE_RATES': {
163         'anon': '100/minute',
164         'user': '100/minute'
165     },
166     'DEFAULT_RENDERER_CLASSES': (
167         'rest_framework.renderers.JSONRenderer',
168     )
169 }
170 
171 # ALLAUTH SETTINGS
172 ACCOUNT_EMAIL_REQUIRED = True
173 OLD_PASSWORD_FIELD_ENABLED = True
174 
175 AUTHENTICATION_BACKENDS = (
176     # Needed to login by username in Django admin, regardless of `allauth`
177     'django.contrib.auth.backends.ModelBackend',
178     # `allauth` specific authentication methods, such as login by e-mail
179     'allauth.account.auth_backends.AuthenticationBackend',
180 )
181 
182 # CORS Settings
183 CORS_ORIGIN_ALLOW_ALL = True
184 
185 # REST Framework Expiring Tokens Configuration
186 EXPIRING_TOKEN_LIFESPAN = datetime.timedelta(days=7)
187 
188 # Logging
189 LOGGING = {
190     'version': 1,
191     'disable_existing_loggers': False,
192     'root': {
193         'level': 'INFO',
194         'handlers': ['console'],
195     },
196     'filters': {
197         'require_debug_false': {
198             '()': 'django.utils.log.RequireDebugFalse',
199         },
200         'require_debug_true': {
201             '()': 'django.utils.log.RequireDebugTrue',
202         }
203     },
204     'formatters': {
205         'simple': {
206             'format': '[%(asctime)s] %(levelname)s %(message)s',
207             'datefmt': '%Y-%m-%d %H:%M:%S'
208         },
209         'verbose': {
210             'format': '[%(asctime)s] %(levelname)s %(module)s %(message)s',
211             'datefmt': '%Y-%m-%d %H:%M:%S'
212         }
213     },
214     'handlers': {
215         'console': {
216             'level': 'INFO',
217             'filters': ['require_debug_true'],
218             'class': 'logging.StreamHandler',
219             'formatter': 'simple'
220         },
221         'logfile': {
222             'level': 'DEBUG',
223             'class': 'logging.handlers.RotatingFileHandler',
224             'filename': "/tmp/logfile",
225             'maxBytes': 50000,
226             'backupCount': 10,
227             'formatter': 'verbose'
228         },
229         'mail_admins': {
230             'level': 'ERROR',
231             'class': 'django.utils.log.AdminEmailHandler',
232             'filters': ['require_debug_false'],
233         }
234     },
235     'loggers': {
236         'django': {
237             'handlers': ['console'],
238             'propagate': True,
239         },
240         'django.request': {
241             'handlers': ['mail_admins'],
242             'level': 'ERROR',
243             'propagate': False,
244         },
245         'django.security': {
246             'handlers': ['mail_admins'],
247             'level': 'ERROR',
248             'propagate': False,
249         },
250         'django.db.backends': {
251             'handlers': ['mail_admins'],
252             'level': 'ERROR',
253             'propagate': False,
254         }
255     }
256 }
257 
258 CACHES = {
259     'default': {
260         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
261     }
262 }
263 
264 RABBITMQ_PARAMETERS = {
265     'HOST': 'localhost',
266     'EVALAI_EXCHANGE': {
267         'NAME': 'evalai_submissions',
268         'TYPE': 'topic',
269     },
270     'SUBMISSION_QUEUE': 'submission_task_queue',
271 }
272
```

Path: `evalai/urls.py`
Content:
```
1 """evalai URL Configuration
2 
3 The `urlpatterns` list routes URLs to views. For more information please see:
4     https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include
14     2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
15 """
16 
17 from django.conf.urls import url, include
18 from django.contrib import admin
19 from django.views.generic.base import TemplateView
20 from django.conf import settings
21 from django.conf.urls.static import static
22 
23 from rest_framework_expiring_authtoken.views import obtain_expiring_auth_token
24 
25 from accounts.views import ConfirmEmailView
26 from web import views
27 
28 handler404 = 'web.views.page_not_found'
29 handler500 = 'web.views.internal_server_error'
30 
31 urlpatterns = [url(r'^$', views.home, name='home'),
32                url(r'^accounts/',
33                    include('allauth.urls')),
34                url(r'^admin/',
35                    admin.site.urls),
36                url(r'^api/auth/login',
37                    obtain_expiring_auth_token, name='obtain_expiring_auth_token'),
38                url(r'^api/auth/',
39                    include('rest_auth.urls')),
40                url(r'^api/auth/registration/account-confirm-email/(?P<key>[-:\w]+)/$',   # noqa
41                    ConfirmEmailView.as_view(),
42                    name='account_confirm_email'),
43                url(r'^api/auth/registration/',
44                    include('rest_auth.registration.urls')),
45                url(r'^auth/api/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$',  # noqa
46                    TemplateView.as_view(
47                        template_name="password_reset_confirm.html"),
48                    name='password_reset_confirm'),
49                url(r'^api/accounts/',
50                    include('accounts.urls',
51                            namespace='accounts')),
52                url(r'^api/challenges/',
53                    include('challenges.urls',
54                            namespace='challenges')),
55                url(r'^api/analytics/',
56                    include('analytics.urls',
57                            namespace='analytics')),
58                url(r'^api/hosts/',
59                    include('hosts.urls',
60                            namespace='hosts')),
61                url(r'^api/jobs/',
62                    include('jobs.urls',
63                            namespace='jobs')),
64                url(r'^api/participants/',
65                    include('participants.urls',
66                            namespace='participants')),
67                url(r'^api/web/',
68                    include('web.urls',
69                            namespace='web')),
70                ]
71 
72 # DJANGO-SPAGHETTI-AND-MEATBALLS URLs available during development only.
73 if settings.DEBUG:
74     urlpatterns += [url(r'^dbschema/',
75                     include('django_spaghetti.urls')),
76                     url(r'^docs/',
77                     include('rest_framework_docs.urls')),
78                     url(r'^api/admin-auth/',
79                         include('rest_framework.urls',
80                                 namespace='rest_framework')),
81                     ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
82
```

Path: `apps/accounts/views.py`
Content:
```
1 from django.contrib.auth import logout
2 from django.urls import reverse
3 
4 from rest_framework.views import APIView
5 from rest_framework.permissions import AllowAny
6 from rest_framework.response import Response
7 from rest_framework import permissions, status
8 from rest_framework.decorators import (api_view,
9                                        authentication_classes,
10                                        permission_classes,)
11 from rest_framework_expiring_authtoken.authentication import (ExpiringTokenAuthentication,)
12 
13 import requests
14 
15 
16 class ConfirmEmailView(APIView):
17     """
18     APIView for confirming email after registration
19     """
20     permission_classes = (AllowAny,)
21     allowed_methods = ('GET', 'OPTIONS', 'HEAD')
22 
23     def get(self, request, *args, **kwargs):
24         post_data = {
25             'key': kwargs['key'],
26         }
27 
28         requests.post(request.build_absolute_uri(
29             reverse("rest_verify_email")), data=post_data)
30         return Response({'message': "Email verified successfully"}, status=status.HTTP_200_OK)
31 
32 
33 @api_view(['POST'])
34 @permission_classes((permissions.IsAuthenticated,))
35 @authentication_classes((ExpiringTokenAuthentication,))
36 def disable_user(request):
37 
38     user = request.user
39     user.is_active = False
40     user.save()
41     logout(request)
42     return Response(status=status.HTTP_200_OK)
43
```
--- 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/apps/accounts/views.py b/apps/accounts/views.py
--- a/apps/accounts/views.py
+++ b/apps/accounts/views.py
@@ -1,8 +1,5 @@
 from django.contrib.auth import logout
-from django.urls import reverse
 
-from rest_framework.views import APIView
-from rest_framework.permissions import AllowAny
 from rest_framework.response import Response
 from rest_framework import permissions, status
 from rest_framework.decorators import (api_view,
@@ -10,25 +7,6 @@
                                        permission_classes,)
 from rest_framework_expiring_authtoken.authentication import (ExpiringTokenAuthentication,)
 
-import requests
-
-
-class ConfirmEmailView(APIView):
-    """
-    APIView for confirming email after registration
-    """
-    permission_classes = (AllowAny,)
-    allowed_methods = ('GET', 'OPTIONS', 'HEAD')
-
-    def get(self, request, *args, **kwargs):
-        post_data = {
-            'key': kwargs['key'],
-        }
-
-        requests.post(request.build_absolute_uri(
-            reverse("rest_verify_email")), data=post_data)
-        return Response({'message': "Email verified successfully"}, status=status.HTTP_200_OK)
-
 
 @api_view(['POST'])
 @permission_classes((permissions.IsAuthenticated,))
diff --git a/evalai/urls.py b/evalai/urls.py
--- a/evalai/urls.py
+++ b/evalai/urls.py
@@ -20,9 +20,9 @@
 from django.conf import settings
 from django.conf.urls.static import static
 
+from allauth.account.views import ConfirmEmailView
 from rest_framework_expiring_authtoken.views import obtain_expiring_auth_token
 
-from accounts.views import ConfirmEmailView
 from web import views
 
 handler404 = 'web.views.page_not_found'
diff --git a/settings/common.py b/settings/common.py
--- a/settings/common.py
+++ b/settings/common.py
@@ -138,7 +138,7 @@
 # https://docs.djangoproject.com/en/1.10/howto/static-files/
 
 STATIC_URL = '/static/'
-
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
 MEDIA_URL = "/media/"

{"golden_diff": "diff --git a/apps/accounts/views.py b/apps/accounts/views.py\n--- a/apps/accounts/views.py\n+++ b/apps/accounts/views.py\n@@ -1,8 +1,5 @@\n from django.contrib.auth import logout\n-from django.urls import reverse\n \n-from rest_framework.views import APIView\n-from rest_framework.permissions import AllowAny\n from rest_framework.response import Response\n from rest_framework import permissions, status\n from rest_framework.decorators import (api_view,\n@@ -10,25 +7,6 @@\n                                        permission_classes,)\n from rest_framework_expiring_authtoken.authentication import (ExpiringTokenAuthentication,)\n \n-import requests\n-\n-\n-class ConfirmEmailView(APIView):\n-    \"\"\"\n-    APIView for confirming email after registration\n-    \"\"\"\n-    permission_classes = (AllowAny,)\n-    allowed_methods = ('GET', 'OPTIONS', 'HEAD')\n-\n-    def get(self, request, *args, **kwargs):\n-        post_data = {\n-            'key': kwargs['key'],\n-        }\n-\n-        requests.post(request.build_absolute_uri(\n-            reverse(\"rest_verify_email\")), data=post_data)\n-        return Response({'message': \"Email verified successfully\"}, status=status.HTTP_200_OK)\n-\n \n @api_view(['POST'])\n @permission_classes((permissions.IsAuthenticated,))\ndiff --git a/evalai/urls.py b/evalai/urls.py\n--- a/evalai/urls.py\n+++ b/evalai/urls.py\n@@ -20,9 +20,9 @@\n from django.conf import settings\n from django.conf.urls.static import static\n \n+from allauth.account.views import ConfirmEmailView\n from rest_framework_expiring_authtoken.views import obtain_expiring_auth_token\n \n-from accounts.views import ConfirmEmailView\n from web import views\n \n handler404 = 'web.views.page_not_found'\ndiff --git a/settings/common.py b/settings/common.py\n--- a/settings/common.py\n+++ b/settings/common.py\n@@ -138,7 +138,7 @@\n # https://docs.djangoproject.com/en/1.10/howto/static-files/\n \n STATIC_URL = '/static/'\n-\n+STATIC_ROOT = os.path.join(BASE_DIR, 'static')\n MEDIA_ROOT = os.path.join(BASE_DIR, 'media')\n MEDIA_URL = \"/media/\"\n", "issue": "Create a template view to show after successful email verification during Signup\n### Description\r\n\r\nWhen a user registers on EvalAI, he receives an email that contains a unique link to confirm his email id. Whenever he clicks on the link, he should be shown a static page similar to this http://api.evalai.cloudcv.org/api/auth/registration/account-confirm-email/MTc:1cpmQ6:0_PqK9K-JJuKYxC3aSY2Bjt3OLU/\r\n\r\n### Todo \r\n\r\n1. Override the URL Patterns for the URL  `/api/auth/registration/account-confirm-email/<token>/` to convert it to django TemplateView\r\n2. Create a template at the backend that is served to the user whenever he clicks on the unique link. \n", "before_files": [{"content": "\"\"\"\nDjango settings for evalai project.\n\nGenerated by 'django-admin startproject' using Django 1.10.2.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.10/ref/settings/\n\"\"\"\n\nimport datetime\nimport os\nimport sys\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nAPPS_DIR = os.path.join(BASE_DIR, 'apps')\n\nsys.path.append(APPS_DIR)\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.environ.get('SECRET_KEY', 'random_secret_key')\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = []\n\n\n# Application definition\n\nDEFAULT_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.contrib.sites',\n]\n\nOUR_APPS = [\n    'accounts',\n    'analytics',\n    'base',\n    'challenges',\n    'hosts',\n    'jobs',\n    'participants',\n    'web',\n]\n\nTHIRD_PARTY_APPS = [\n    'allauth',\n    'allauth.account',\n    'corsheaders',\n    'rest_auth',\n    'rest_auth.registration',\n    'rest_framework.authtoken',\n    'rest_framework',\n    'rest_framework_docs',\n    'rest_framework_expiring_authtoken',\n]\n\nINSTALLED_APPS = DEFAULT_APPS + OUR_APPS + THIRD_PARTY_APPS\n\nMIDDLEWARE = [\n    'corsheaders.middleware.CorsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\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.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'evalai.urls'\n\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\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 = 'evalai.wsgi.application'\n\n\n# Password validation\n# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',  # noqa\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.10/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.10/howto/static-files/\n\nSTATIC_URL = '/static/'\n\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\nMEDIA_URL = \"/media/\"\n\nSITE_ID = 1\n\nREST_FRAMEWORK = {\n    'DEFAULT_PAGINATION_CLASS': (\n        'rest_framework.pagination.LimitOffsetPagination'),\n    'PAGE_SIZE': 10,\n    'DEFAULT_PERMISSION_CLASSES': [\n        'rest_framework.permissions.IsAuthenticatedOrReadOnly'\n    ],\n    'DEFAULT_AUTHENTICATION_CLASSES': [\n        'rest_framework_expiring_authtoken.authentication.ExpiringTokenAuthentication',\n    ],\n    'TEST_REQUEST_DEFAULT_FORMAT': 'json',\n    'DEFAULT_THROTTLE_CLASSES': (\n        'rest_framework.throttling.AnonRateThrottle',\n        'rest_framework.throttling.UserRateThrottle'\n    ),\n    'DEFAULT_THROTTLE_RATES': {\n        'anon': '100/minute',\n        'user': '100/minute'\n    },\n    'DEFAULT_RENDERER_CLASSES': (\n        'rest_framework.renderers.JSONRenderer',\n    )\n}\n\n# ALLAUTH SETTINGS\nACCOUNT_EMAIL_REQUIRED = True\nOLD_PASSWORD_FIELD_ENABLED = True\n\nAUTHENTICATION_BACKENDS = (\n    # Needed to login by username in Django admin, regardless of `allauth`\n    'django.contrib.auth.backends.ModelBackend',\n    # `allauth` specific authentication methods, such as login by e-mail\n    'allauth.account.auth_backends.AuthenticationBackend',\n)\n\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\n\n# REST Framework Expiring Tokens Configuration\nEXPIRING_TOKEN_LIFESPAN = datetime.timedelta(days=7)\n\n# Logging\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'root': {\n        'level': 'INFO',\n        'handlers': ['console'],\n    },\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse',\n        },\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue',\n        }\n    },\n    'formatters': {\n        'simple': {\n            'format': '[%(asctime)s] %(levelname)s %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        },\n        'verbose': {\n            'format': '[%(asctime)s] %(levelname)s %(module)s %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        }\n    },\n    'handlers': {\n        'console': {\n            'level': 'INFO',\n            'filters': ['require_debug_true'],\n            'class': 'logging.StreamHandler',\n            'formatter': 'simple'\n        },\n        'logfile': {\n            'level': 'DEBUG',\n            'class': 'logging.handlers.RotatingFileHandler',\n            'filename': \"/tmp/logfile\",\n            'maxBytes': 50000,\n            'backupCount': 10,\n            'formatter': 'verbose'\n        },\n        'mail_admins': {\n            'level': 'ERROR',\n            'class': 'django.utils.log.AdminEmailHandler',\n            'filters': ['require_debug_false'],\n        }\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console'],\n            'propagate': True,\n        },\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'django.security': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'django.db.backends': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        }\n    }\n}\n\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',\n    }\n}\n\nRABBITMQ_PARAMETERS = {\n    'HOST': 'localhost',\n    'EVALAI_EXCHANGE': {\n        'NAME': 'evalai_submissions',\n        'TYPE': 'topic',\n    },\n    'SUBMISSION_QUEUE': 'submission_task_queue',\n}\n", "path": "settings/common.py"}, {"content": "\"\"\"evalai URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include\n    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))\n\"\"\"\n\nfrom django.conf.urls import url, include\nfrom django.contrib import admin\nfrom django.views.generic.base import TemplateView\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nfrom rest_framework_expiring_authtoken.views import obtain_expiring_auth_token\n\nfrom accounts.views import ConfirmEmailView\nfrom web import views\n\nhandler404 = 'web.views.page_not_found'\nhandler500 = 'web.views.internal_server_error'\n\nurlpatterns = [url(r'^$', views.home, name='home'),\n               url(r'^accounts/',\n                   include('allauth.urls')),\n               url(r'^admin/',\n                   admin.site.urls),\n               url(r'^api/auth/login',\n                   obtain_expiring_auth_token, name='obtain_expiring_auth_token'),\n               url(r'^api/auth/',\n                   include('rest_auth.urls')),\n               url(r'^api/auth/registration/account-confirm-email/(?P<key>[-:\\w]+)/$',   # noqa\n                   ConfirmEmailView.as_view(),\n                   name='account_confirm_email'),\n               url(r'^api/auth/registration/',\n                   include('rest_auth.registration.urls')),\n               url(r'^auth/api/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$',  # noqa\n                   TemplateView.as_view(\n                       template_name=\"password_reset_confirm.html\"),\n                   name='password_reset_confirm'),\n               url(r'^api/accounts/',\n                   include('accounts.urls',\n                           namespace='accounts')),\n               url(r'^api/challenges/',\n                   include('challenges.urls',\n                           namespace='challenges')),\n               url(r'^api/analytics/',\n                   include('analytics.urls',\n                           namespace='analytics')),\n               url(r'^api/hosts/',\n                   include('hosts.urls',\n                           namespace='hosts')),\n               url(r'^api/jobs/',\n                   include('jobs.urls',\n                           namespace='jobs')),\n               url(r'^api/participants/',\n                   include('participants.urls',\n                           namespace='participants')),\n               url(r'^api/web/',\n                   include('web.urls',\n                           namespace='web')),\n               ]\n\n# DJANGO-SPAGHETTI-AND-MEATBALLS URLs available during development only.\nif settings.DEBUG:\n    urlpatterns += [url(r'^dbschema/',\n                    include('django_spaghetti.urls')),\n                    url(r'^docs/',\n                    include('rest_framework_docs.urls')),\n                    url(r'^api/admin-auth/',\n                        include('rest_framework.urls',\n                                namespace='rest_framework')),\n                    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "evalai/urls.py"}, {"content": "from django.contrib.auth import logout\nfrom django.urls import reverse\n\nfrom rest_framework.views import APIView\nfrom rest_framework.permissions import AllowAny\nfrom rest_framework.response import Response\nfrom rest_framework import permissions, status\nfrom rest_framework.decorators import (api_view,\n                                       authentication_classes,\n                                       permission_classes,)\nfrom rest_framework_expiring_authtoken.authentication import (ExpiringTokenAuthentication,)\n\nimport requests\n\n\nclass ConfirmEmailView(APIView):\n    \"\"\"\n    APIView for confirming email after registration\n    \"\"\"\n    permission_classes = (AllowAny,)\n    allowed_methods = ('GET', 'OPTIONS', 'HEAD')\n\n    def get(self, request, *args, **kwargs):\n        post_data = {\n            'key': kwargs['key'],\n        }\n\n        requests.post(request.build_absolute_uri(\n            reverse(\"rest_verify_email\")), data=post_data)\n        return Response({'message': \"Email verified successfully\"}, status=status.HTTP_200_OK)\n\n\n@api_view(['POST'])\n@permission_classes((permissions.IsAuthenticated,))\n@authentication_classes((ExpiringTokenAuthentication,))\ndef disable_user(request):\n\n    user = request.user\n    user.is_active = False\n    user.save()\n    logout(request)\n    return Response(status=status.HTTP_200_OK)\n", "path": "apps/accounts/views.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for evalai project.\n\nGenerated by 'django-admin startproject' using Django 1.10.2.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.10/ref/settings/\n\"\"\"\n\nimport datetime\nimport os\nimport sys\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nAPPS_DIR = os.path.join(BASE_DIR, 'apps')\n\nsys.path.append(APPS_DIR)\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.environ.get('SECRET_KEY', 'random_secret_key')\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = []\n\n\n# Application definition\n\nDEFAULT_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.contrib.sites',\n]\n\nOUR_APPS = [\n    'accounts',\n    'analytics',\n    'base',\n    'challenges',\n    'hosts',\n    'jobs',\n    'participants',\n    'web',\n]\n\nTHIRD_PARTY_APPS = [\n    'allauth',\n    'allauth.account',\n    'corsheaders',\n    'rest_auth',\n    'rest_auth.registration',\n    'rest_framework.authtoken',\n    'rest_framework',\n    'rest_framework_docs',\n    'rest_framework_expiring_authtoken',\n]\n\nINSTALLED_APPS = DEFAULT_APPS + OUR_APPS + THIRD_PARTY_APPS\n\nMIDDLEWARE = [\n    'corsheaders.middleware.CorsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\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.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'evalai.urls'\n\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\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 = 'evalai.wsgi.application'\n\n\n# Password validation\n# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',  # noqa\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',  # noqa\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.10/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.10/howto/static-files/\n\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(BASE_DIR, 'static')\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\nMEDIA_URL = \"/media/\"\n\nSITE_ID = 1\n\nREST_FRAMEWORK = {\n    'DEFAULT_PAGINATION_CLASS': (\n        'rest_framework.pagination.LimitOffsetPagination'),\n    'PAGE_SIZE': 10,\n    'DEFAULT_PERMISSION_CLASSES': [\n        'rest_framework.permissions.IsAuthenticatedOrReadOnly'\n    ],\n    'DEFAULT_AUTHENTICATION_CLASSES': [\n        'rest_framework_expiring_authtoken.authentication.ExpiringTokenAuthentication',\n    ],\n    'TEST_REQUEST_DEFAULT_FORMAT': 'json',\n    'DEFAULT_THROTTLE_CLASSES': (\n        'rest_framework.throttling.AnonRateThrottle',\n        'rest_framework.throttling.UserRateThrottle'\n    ),\n    'DEFAULT_THROTTLE_RATES': {\n        'anon': '100/minute',\n        'user': '100/minute'\n    },\n    'DEFAULT_RENDERER_CLASSES': (\n        'rest_framework.renderers.JSONRenderer',\n    )\n}\n\n# ALLAUTH SETTINGS\nACCOUNT_EMAIL_REQUIRED = True\nOLD_PASSWORD_FIELD_ENABLED = True\n\nAUTHENTICATION_BACKENDS = (\n    # Needed to login by username in Django admin, regardless of `allauth`\n    'django.contrib.auth.backends.ModelBackend',\n    # `allauth` specific authentication methods, such as login by e-mail\n    'allauth.account.auth_backends.AuthenticationBackend',\n)\n\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\n\n# REST Framework Expiring Tokens Configuration\nEXPIRING_TOKEN_LIFESPAN = datetime.timedelta(days=7)\n\n# Logging\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'root': {\n        'level': 'INFO',\n        'handlers': ['console'],\n    },\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse',\n        },\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue',\n        }\n    },\n    'formatters': {\n        'simple': {\n            'format': '[%(asctime)s] %(levelname)s %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        },\n        'verbose': {\n            'format': '[%(asctime)s] %(levelname)s %(module)s %(message)s',\n            'datefmt': '%Y-%m-%d %H:%M:%S'\n        }\n    },\n    'handlers': {\n        'console': {\n            'level': 'INFO',\n            'filters': ['require_debug_true'],\n            'class': 'logging.StreamHandler',\n            'formatter': 'simple'\n        },\n        'logfile': {\n            'level': 'DEBUG',\n            'class': 'logging.handlers.RotatingFileHandler',\n            'filename': \"/tmp/logfile\",\n            'maxBytes': 50000,\n            'backupCount': 10,\n            'formatter': 'verbose'\n        },\n        'mail_admins': {\n            'level': 'ERROR',\n            'class': 'django.utils.log.AdminEmailHandler',\n            'filters': ['require_debug_false'],\n        }\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console'],\n            'propagate': True,\n        },\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'django.security': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'django.db.backends': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': False,\n        }\n    }\n}\n\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',\n    }\n}\n\nRABBITMQ_PARAMETERS = {\n    'HOST': 'localhost',\n    'EVALAI_EXCHANGE': {\n        'NAME': 'evalai_submissions',\n        'TYPE': 'topic',\n    },\n    'SUBMISSION_QUEUE': 'submission_task_queue',\n}\n", "path": "settings/common.py"}, {"content": "\"\"\"evalai URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include\n    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))\n\"\"\"\n\nfrom django.conf.urls import url, include\nfrom django.contrib import admin\nfrom django.views.generic.base import TemplateView\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nfrom allauth.account.views import ConfirmEmailView\nfrom rest_framework_expiring_authtoken.views import obtain_expiring_auth_token\n\nfrom web import views\n\nhandler404 = 'web.views.page_not_found'\nhandler500 = 'web.views.internal_server_error'\n\nurlpatterns = [url(r'^$', views.home, name='home'),\n               url(r'^accounts/',\n                   include('allauth.urls')),\n               url(r'^admin/',\n                   admin.site.urls),\n               url(r'^api/auth/login',\n                   obtain_expiring_auth_token, name='obtain_expiring_auth_token'),\n               url(r'^api/auth/',\n                   include('rest_auth.urls')),\n               url(r'^api/auth/registration/account-confirm-email/(?P<key>[-:\\w]+)/$',   # noqa\n                   ConfirmEmailView.as_view(),\n                   name='account_confirm_email'),\n               url(r'^api/auth/registration/',\n                   include('rest_auth.registration.urls')),\n               url(r'^auth/api/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})$',  # noqa\n                   TemplateView.as_view(\n                       template_name=\"password_reset_confirm.html\"),\n                   name='password_reset_confirm'),\n               url(r'^api/accounts/',\n                   include('accounts.urls',\n                           namespace='accounts')),\n               url(r'^api/challenges/',\n                   include('challenges.urls',\n                           namespace='challenges')),\n               url(r'^api/analytics/',\n                   include('analytics.urls',\n                           namespace='analytics')),\n               url(r'^api/hosts/',\n                   include('hosts.urls',\n                           namespace='hosts')),\n               url(r'^api/jobs/',\n                   include('jobs.urls',\n                           namespace='jobs')),\n               url(r'^api/participants/',\n                   include('participants.urls',\n                           namespace='participants')),\n               url(r'^api/web/',\n                   include('web.urls',\n                           namespace='web')),\n               ]\n\n# DJANGO-SPAGHETTI-AND-MEATBALLS URLs available during development only.\nif settings.DEBUG:\n    urlpatterns += [url(r'^dbschema/',\n                    include('django_spaghetti.urls')),\n                    url(r'^docs/',\n                    include('rest_framework_docs.urls')),\n                    url(r'^api/admin-auth/',\n                        include('rest_framework.urls',\n                                namespace='rest_framework')),\n                    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "evalai/urls.py"}, {"content": "from django.contrib.auth import logout\n\nfrom rest_framework.response import Response\nfrom rest_framework import permissions, status\nfrom rest_framework.decorators import (api_view,\n                                       authentication_classes,\n                                       permission_classes,)\nfrom rest_framework_expiring_authtoken.authentication import (ExpiringTokenAuthentication,)\n\n\n@api_view(['POST'])\n@permission_classes((permissions.IsAuthenticated,))\n@authentication_classes((ExpiringTokenAuthentication,))\ndef disable_user(request):\n\n    user = request.user\n    user.is_active = False\n    user.save()\n    logout(request)\n    return Response(status=status.HTTP_200_OK)\n", "path": "apps/accounts/views.py"}]}