mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding login view and integrating oauth middleware and authentication backend. Wow that was easy.
This commit is contained in:
parent
61d6240694
commit
c7d158a654
3 changed files with 10 additions and 2 deletions
|
@ -744,6 +744,7 @@ def load_feed_page(request, feed_id):
|
|||
logging.user(request, "~FYLoading original page, from the db")
|
||||
return HttpResponse(data, mimetype="text/html; charset=utf-8")
|
||||
|
||||
@login_required()
|
||||
@json.json_view
|
||||
def load_starred_stories(request):
|
||||
user = get_user(request)
|
||||
|
|
|
@ -101,6 +101,7 @@ MIDDLEWARE_CLASSES = (
|
|||
'django.middleware.gzip.GZipMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'apps.profile.middleware.TimingMiddleware',
|
||||
'apps.profile.middleware.LastSeenMiddleware',
|
||||
|
@ -110,10 +111,14 @@ MIDDLEWARE_CLASSES = (
|
|||
'apps.profile.middleware.SimpsonsMiddleware',
|
||||
'apps.profile.middleware.ServerHostnameMiddleware',
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'oauth2_provider.middleware.OAuth2TokenMiddleware',
|
||||
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
)
|
||||
|
||||
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'oauth2_provider.backends.OAuth2Backend',
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
)
|
||||
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
|
||||
|
|
4
urls.py
4
urls.py
|
@ -50,7 +50,9 @@ urlpatterns = patterns('',
|
|||
url(r'^android/?', static_views.android, name='android-static'),
|
||||
url(r'^firefox/?', static_views.firefox, name='firefox'),
|
||||
url(r'zebra/', include('zebra.urls', namespace="zebra", app_name='zebra')),
|
||||
(r'^account/login/?$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.html'}),
|
||||
url(r'^account/login/?$',
|
||||
'django.contrib.auth.views.login',
|
||||
{'template_name': 'accounts/login.html'}, name='login'),
|
||||
url(r'^account/', include('oauth2_provider.urls', namespace='oauth2_provider')),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue