2014-04-08 18 views
15

Starałem się śledzić najnowsze http://django-allauth.readthedocs.org/en/latest/#installationdjango-allauth podstawowa konfiguracja

urls.py plik wygląda następująco:

urlpatterns = patterns('', 
    url(r'^admin/', include(admin.site.urls)), 
    url(r'^accounts/', include('allauth.urls')), 
) 

settings.py plik posiada:

INSTALLED_APPS = (
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib.staticfiles', 
    'django.contrib.sites', 
    'allauth', 
    'allauth.account', 
    'allauth.socialaccount', 
) 

TEMPLATE_CONTEXT_PROCESSORS = (
    # Required by allauth template tags 
    "django.core.context_processors.request", 
    "django.contrib.auth.context_processors.auth", 
    # allauth specific context processors 
    "allauth.account.context_processors.account", 
    "allauth.socialaccount.context_processors.socialaccount", 
) 

AUTHENTICATION_BACKENDS = (
    # Needed to login by username in Django admin, regardless of `allauth` 
    "django.contrib.auth.backends.ModelBackend", 
    # `allauth` specific authentication methods, such as login by e-mail 
    "allauth.account.auth_backends.AuthenticationBackend", 
) 
SITE_ID = 1 

i wpadłem python manage.py syncdb ale kiedy odwiedzam mój localhost: 8000/accounts/login /, daje mi stronę nie odnalezioną (404). Sprawdziłem również dwukrotnie, co zrobiłem z tutorialem pod adresem: http://www.sarahhagstrom.com/2013/09/the-missing-django-allauth-tutorial/, ale nie jestem pewien, co jeszcze zrobić, aby wyświetlić podstawowy ekran logowania. Jakieś wskazówki?

EDIT

tu jest błąd na stronie oprócz Page Not Found 404

Using the URLconf defined in asa.urls, Django tried these URL patterns, in this order: 
^admin/ 
^accounts/^^signup/$ [name='account_signup'] 
^accounts/^^login/$ [name='account_login'] 
^accounts/^^logout/$ [name='account_logout'] 
^accounts/^^password/change/$ [name='account_change_password'] 
^accounts/^^password/set/$ [name='account_set_password'] 
^accounts/^^inactive/$ [name='account_inactive'] 
^accounts/^^email/$ [name='account_email'] 
^accounts/^^confirm-email/$ [name='account_email_verification_sent'] 
^accounts/^^confirm-email/(?P<key>\w+)/$ [name='account_confirm_email'] 
^accounts/^^confirm_email/(?P<key>\w+)/$ 
^accounts/^^password/reset/$ [name='account_reset_password'] 
^accounts/^^password/reset/done/$ [name='account_reset_password_done'] 
^accounts/^^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key'] 
^accounts/^^password/reset/key/done/$ [name='account_reset_password_from_key_done'] 
^accounts/ ^social/ 

aktualny adres URL, konta/profile /, nie pasuje do żadnej z nich.

Odpowiedz

20

Wystarczy sprawdzić: czy uruchomiłeś swój serwer?

python manage.py runserver 

EDIT:

Wygląda na to, że próbujesz accounts/profile/, który nie jest zarejestrowanym URL. Czy nadal występuje błąd, jeśli przejdziesz do localhost:8000/accounts/register?

Również z docs:

Gdy próbuję się zalogować biegnę do 404 na/accounts/profile/

Kiedy skończy się tutaj pomyślnym zalogowaniu się jednak. , musisz zaimplementować widok dla tego adresu URL sam, ponieważ to, co ma być tutaj wyświetlane, zależy od projektu. Możesz także zdecydować się na przekierowanie w inne miejsce.

Wygląda na to trzeba napisać swój własny pogląd na kontach/profile/

Jeśli chcesz, możesz ustawić login przekierowanie na inną stronę w settings.py. Np .:

LOGIN_REDIRECT_URL = "/" 

To odeśle cię z powrotem na swoją stronę główną.

+0

haha ​​tak, zacząłem. W sekcji/admin mogłem zobaczyć, że tabele zostały utworzone dla Witryn i Socialaccount. – newbieProgrammer

+0

Czy możesz podać więcej szczegółów na temat otrzymanego błędu? – Alex

+0

Właśnie zaktualizowałem wpis z błędem, który wydaje się, że zawierał adresy URL z allauth.urls – newbieProgrammer