Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.17 KB | None | 0 0
  1. ValueError at /accounts/login/
  2. Couldn't load 'Argon2PasswordHasher' algorithm library: No module named argon2
  3.  
  4. """
  5. Django settings for django_project project.
  6.  
  7. Generated by 'django-admin startproject' using Django 1.8.7.
  8.  
  9. For more information on this file, see
  10. https://docs.djangoproject.com/en/1.8/topics/settings/
  11.  
  12. For the full list of settings and their values, see
  13. https://docs.djangoproject.com/en/1.8/ref/settings/
  14. """
  15.  
  16. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  17. import os
  18.  
  19. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  20. TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
  21. MEDIA_DIR = os.path.join(BASE_DIR, 'media')
  22.  
  23.  
  24. # Quick-start development settings - unsuitable for production
  25. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  26.  
  27. # SECURITY WARNING: keep the secret key used in production secret!
  28. SECRET_KEY = 'h&*(yq942_a^pa+ty&wh(bl9s4d#z^*_6cmeb#5&49jb^r$&!f'
  29.  
  30. # SECURITY WARNING: don't run with debug turned on in production!
  31. DEBUG = True
  32.  
  33. ALLOWED_HOSTS = []
  34.  
  35.  
  36. # Application definition
  37.  
  38. INSTALLED_APPS = (
  39. 'django.contrib.admin',
  40. 'django.contrib.auth',
  41. 'django.contrib.contenttypes',
  42. 'django.contrib.sessions',
  43. 'django.contrib.messages',
  44. 'django.contrib.staticfiles',
  45. 'django.contrib.sites',
  46.  
  47. 'users',
  48. 'feed',
  49. 'blog',
  50.  
  51. 'allauth',
  52. 'allauth.account',
  53. 'allauth.socialaccount',
  54. )
  55.  
  56. MIDDLEWARE_CLASSES = (
  57. 'django.contrib.sessions.middleware.SessionMiddleware',
  58. 'django.middleware.common.CommonMiddleware',
  59. 'django.middleware.csrf.CsrfViewMiddleware',
  60. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  61. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  62. 'django.contrib.messages.middleware.MessageMiddleware',
  63. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  64. 'django.middleware.security.SecurityMiddleware',
  65. )
  66.  
  67. ROOT_URLCONF = 'django_project.urls'
  68.  
  69. TEMPLATES = [
  70. {
  71. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  72. 'DIRS': [],
  73. 'APP_DIRS': True,
  74. 'OPTIONS': {
  75. 'context_processors': [
  76. 'django.template.context_processors.debug',
  77. 'django.template.context_processors.request',
  78. 'django.contrib.auth.context_processors.auth',
  79. 'django.contrib.messages.context_processors.messages',
  80. ],
  81. },
  82. },
  83. ]
  84.  
  85. WSGI_APPLICATION = 'django_project.wsgi.application'
  86.  
  87.  
  88. # Database
  89. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  90.  
  91. DATABASES = {
  92. 'default': {
  93. 'ENGINE': 'django.db.backends.sqlite3',
  94. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  95. }
  96. }
  97.  
  98. # Password validation
  99. # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  100.  
  101. PASSWORD_HASHERS = [
  102. 'django.contrib.auth.hashers.Argon2PasswordHasher',
  103. 'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
  104. 'django.contrib.auth.hashers.BCryptPasswordHasher',
  105. 'django.contrib.auth.hashers.PBKDF2PasswordHasher',
  106. 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  107. ]
  108.  
  109.  
  110. # Internationalization
  111. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  112.  
  113. LANGUAGE_CODE = 'en-us'
  114.  
  115. TIME_ZONE = 'UTC'
  116.  
  117. USE_I18N = True
  118.  
  119. USE_L10N = True
  120.  
  121. USE_TZ = True
  122.  
  123. SITE_ID = 1
  124.  
  125.  
  126. # Static files (CSS, JavaScript, Images)
  127. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  128.  
  129. STATIC_URL = '/static/'
  130. STATIC_ROOT = '/static/'
  131. STATIC_DIR = os.path.join(BASE_DIR,'static')
  132.  
  133. STATICFILES_DIRS = [
  134. STATIC_DIR,
  135. ]
  136.  
  137.  
  138. #MEDIA
  139. MEDIA_ROOT = MEDIA_DIR
  140. MEDIA_URL = '/media/'
  141.  
  142.  
  143. LOGIN_URL = '/user_login'
  144.  
  145. # settings
  146. ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
  147.  
  148. ACCOUNT_USERNAME_REQUIRED = True
  149. ACCOUNT_UNIQUE_USERNAME =True
  150. ACCOUNT_SIGNUP_EMAIL_ENTER_TWICE =False
  151. ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE =True
  152. ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS =3
  153. ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 5
  154. ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE =True
  155. ACCOUNT_SESSION_REMEMBER =None
  156. ACCOUNT_ADAPTER ='allauth.account.adapter.DefaultAccountAdapter'
  157.  
  158. ACCOUNT_UNIQUE_EMAIL =True
  159. # SOCIALACCOUNT_AUTO_SIGNUP =True
  160.  
  161. # SOCIALACCOUNT_EMAIL_REQUIRED ='ACCOUNT_EMAIL_REQUIRED'
  162. # SOCIALACCOUNT_QUERY_EMAIL ='ACCOUNT_EMAIL_REQUIRED'
  163.  
  164.  
  165. ACCOUNT_EMAIL_REQUIRED = True
  166. ACCOUNT_EMAIL_CONFIRMATION_HMAC =True
  167. ACCOUNT_EMAIL_VERIFICATION = 'none'
  168. #ACCOUNT_EMAIL_VERIFICATION = 'optional'
  169. #ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
  170.  
  171.  
  172. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  173. EMAIL_HOST = 'smtp.sendgrid.com'
  174. EMAIL_HOST_PASSWORD = 'password'
  175. EMAIL_HOST_USER = 'username'
  176. EMAIL_PORT = 587
  177. EMAIL_USE_TLS = True
  178. DEFAULT_FROM_EMAIL = 'support@yoursite.com'
  179.  
  180.  
  181.  
  182. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  183. # Allow Django from all hosts. This snippet is installed from
  184. # /var/lib/digitalocean/allow_hosts.py
  185.  
  186. import os
  187. import netifaces
  188.  
  189. # Find out what the IP addresses are at run time
  190. # This is necessary because otherwise Gunicorn will reject the connections
  191. def ip_addresses():
  192. ip_list = []
  193. for interface in netifaces.interfaces():
  194. addrs = netifaces.ifaddresses(interface)
  195. for x in (netifaces.AF_INET, netifaces.AF_INET6):
  196. if x in addrs:
  197. ip_list.append(addrs[x][0]['addr'])
  198. return ip_list
  199.  
  200. # Discover our IP address
  201. ALLOWED_HOSTS = ip_addresses()
  202.  
  203. Traceback Switch to copy-and-paste view
  204.  
  205. /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py in inner
  206. response = get_response(request) ...
  207. ▶ Local vars
  208. /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in _legacy_get_response
  209. response = self._get_response(request) ...
  210. ▶ Local vars
  211. /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in _get_response
  212. response = self.process_exception_by_middleware(e, request) ...
  213. ▶ Local vars
  214. /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in _get_response
  215. response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
  216. ▶ Local vars
  217. /usr/local/lib/python2.7/dist-packages/django/views/generic/base.py in view
  218. return self.dispatch(request, *args, **kwargs) ...
  219. ▶ Local vars
  220. /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in _wrapper
  221. return bound_func(*args, **kwargs) ...
  222. ▶ Local vars
  223. /usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py in sensitive_post_parameters_wrapper
  224. return view(request, *args, **kwargs) ...
  225. ▶ Local vars
  226. /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in bound_func
  227. return func.__get__(self, type(self))(*args2, **kwargs2) ...
  228. ▶ Local vars
  229. /home/django/django_project/allauth/account/views.py in dispatch
  230. return super(LoginView, self).dispatch(request, *args, **kwargs) ...
  231. ▶ Local vars
  232. /home/django/django_project/allauth/account/views.py in dispatch
  233. **kwargs) ...
  234. ▶ Local vars
  235. /usr/local/lib/python2.7/dist-packages/django/views/generic/base.py in dispatch
  236. return handler(request, *args, **kwargs) ...
  237. ▶ Local vars
  238. /home/django/django_project/allauth/account/views.py in post
  239. if form.is_valid(): ...
  240. ▶ Local vars
  241. /usr/local/lib/python2.7/dist-packages/django/forms/forms.py in is_valid
  242. return self.is_bound and not self.errors ...
  243. ▶ Local vars
  244. /usr/local/lib/python2.7/dist-packages/django/forms/forms.py in errors
  245. self.full_clean() ...
  246. ▶ Local vars
  247. /usr/local/lib/python2.7/dist-packages/django/forms/forms.py in full_clean
  248. self._clean_form() ...
  249. ▶ Local vars
  250. /usr/local/lib/python2.7/dist-packages/django/forms/forms.py in _clean_form
  251. cleaned_data = self.clean() ...
  252. ▶ Local vars
  253. /home/django/django_project/allauth/account/forms.py in clean
  254. **credentials) ...
  255. ▶ Local vars
  256. /home/django/django_project/allauth/account/adapter.py in authenticate
  257. user = authenticate(request=request, **credentials) ...
  258. ▶ Local vars
  259. /home/django/django_project/allauth/compat.py in authenticate
  260. return authenticate(request=request, **credentials) ...
  261. ▶ Local vars
  262. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py in authenticate
  263. user = _authenticate_with_backend(backend, backend_path, request, credentials) ...
  264. ▶ Local vars
  265. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py in _authenticate_with_backend
  266. return backend.authenticate(*args, **credentials) ...
  267. ▶ Local vars
  268. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/backends.py in authenticate
  269. if user.check_password(password) and self.user_can_authenticate(user): ...
  270. ▶ Local vars
  271. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/base_user.py in check_password
  272. return check_password(raw_password, self.password, setter) ...
  273. ▶ Local vars
  274. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/hashers.py in check_password
  275. must_update = hasher_changed or preferred.must_update(encoded) ...
  276. ▶ Local vars
  277. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/hashers.py in must_update
  278. argon2 = self._load_library() ...
  279. ▶ Local vars
  280. /usr/local/lib/python2.7/dist-packages/django/contrib/auth/hashers.py in _load_library
  281. (self.__class__.__name__, e)) ...
  282. ▶ Local vars
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement