user1256543
user1256543

Reputation: 1

python social auth 404 error

I have create test application with pythn-social-aut in which I login using facebook.

When i click in the facebook link it redirect me to facebook login page. It works correctly

After test app I integrate in application but when i click on the facebok login link it give me 404 error. Even I check step by step but found whats the reason.

I inspect the link its href=/login/facebook/ is correct but not redirect me to facebook login page

here my code under my main urls.py i have paste

urlpatterns = patterns('',


    url('', include('social.apps.django_app.urls', namespace='social')),
    url(r'^admin/', include(admin.site.urls)),

    (r'^tinymce/', include('tinymce.urls')),


    (r'^comments/', include('django.contrib.comments.urls')),
    (r'^', include('app.urls')),

    url(r'^(?i)login/$', login, {'template_name': 'login.html'}),
    url(r'^(?i)logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),


) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

Inside my app.urls

urlpatterns = patterns('',

    url(r'^socialcheck/$', 'app.views.socialCheck'),

) 

100% working in the test app but in main project when i integrate it give 404 error when i click on link

Upvotes: 0

Views: 1179

Answers (1)

catavaran
catavaran

Reputation: 45575

It is a very good chance that your problem is in the urls.py code which you doesn't show. I suspect that some of the urls catches the ^/login/([^/]+)/ pattern but doesn't handle the /login/facebook/ path.

Try to move the social urls to the top of your urls.py. Set it as the first item of the patterns():

urlpatterns = patterns('',
    url('', include('social.apps.django_app.urls', namespace='social')),
    ...
)

Upvotes: 1

Related Questions