Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
initial settings and url settings for user authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
buddylindsey committed Feb 13, 2012
1 parent 68919bd commit 57e5acf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions godjango/settings.py
Expand Up @@ -114,6 +114,10 @@
# Don't forget to use absolute paths, not relative paths.
)

TEMPLATE_CONTEXT_PROCESSORS = (
'social_auth.context_processors.social_auth_by_type_backends',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
Expand All @@ -128,8 +132,28 @@
'home',
'coffee',
'south',
'social_auth',
)

# Django Social Auth settings
AUTHENTICATION_BACKENDS = (
'social_auth.backends.contrib.github.GithubBackend',
'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_ENABLED_BACKENDS = ('github',)

SOCIAL_AUTH_DEFAULT_USERNAME = 'new_social_auth_user'

GITHUB_APP_ID = os.environ['GITHUB_APP_ID']
GITHUB_API_SECRET = os.environ['GITHUB_API_SECRET']

LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/logged-in/'
LOGIN_ERROR_URL = '/login-error/'



# 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.
Expand Down
1 change: 1 addition & 0 deletions godjango/urls.py
Expand Up @@ -10,6 +10,7 @@
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
url(r'', include('social_auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'home.views.index'),
url(r'^about/$', 'home.views.about', name="about"),
Expand Down

0 comments on commit 57e5acf

Please sign in to comment.