Skip to content

Instantly share code, notes, and snippets.

@dekoza
Created September 18, 2012 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekoza/3743107 to your computer and use it in GitHub Desktop.
Save dekoza/3743107 to your computer and use it in GitHub Desktop.
Problems with allauth
# Django project settings file
# This file should be part of the project repository of the project and should not
# contains any site-specific information.
# Site-specific information (database name/login/password for example) should be
# in the settings_local.py file and should not be added to the project repository
import os
# By default urllib, urllib2, and the like have no timeout which can cause
# some apache processes to hang until they are forced kill.
# Before python 2.6, the only way to cause them to time out is by setting
# the default timeout on the global socket
import socket
socket.setdefaulttimeout(5)
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media/')
STATIC_ROOT = os.path.join(PROJECT_PATH, 'static/')
STATICFILES_DIRS = (
os.path.join(PROJECT_PATH, 'assets/'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'django.core.context_processors.static',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
# "allauth.context_processors.allauth",
# "allauth.account.context_processors.account",
)
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates/'),
)
FILE_UPLOAD_PERMISSIONS = 0664
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
# import local settings overriding the defaults
try:
from settings_local import *
except ImportError:
try:
from mod_python import apache
apache.log_error( "local settings not available", apache.APLOG_NOTICE )
except ImportError:
import sys
sys.stderr.write( "local settings not available\n" )
else:
try:
TEMPLATE_CONTEXT_PROCESSORS += LOCAL_TEMPLATE_CONTEXT_PROCESSORS
except NameError:
pass
try:
INSTALLED_APPS += LOCAL_INSTALLED_APPS
except:
pass
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
PROJECT_NAME = 'myproject' # os.path.realpath(os.path.dirname(__file__)) ?
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'local.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
TIME_ZONE = 'Europe/Warsaw'
LANGUAGE_CODE = 'pl'
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '576e9aa6-abf0-421b-9278-bbe2194bc291'
ROOT_URLCONF = PROJECT_NAME + '.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = PROJECT_NAME + '.wsgi.application'
LOCAL_TEMPLATE_CONTEXT_PROCESSORS = (
"allauth.context_processors.allauth",
"allauth.account.context_processors.account",
)
LOCAL_INSTALLED_APPS = (
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.linkedin',
'allauth.socialaccount.providers.openid',
'allauth.socialaccount.providers.soundcloud',
'allauth.socialaccount.providers.twitter',
'uni_form',
)
AUTHENTICATION_BACKENDS = (
"allauth.account.auth_backends.AuthenticationBackend",
)
ACCOUNT_EMAIL_REQUIRED = True
SOCIALACCOUNT_QUERY_EMAIL = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment