/ / Django Admin Urls nie działa - python, django, admin, urlconf

Adresy URL Django Admin nie działają - python, django, admin, urlconf

Niektóre z moich adresów URL django nie będą działać. Mogę dobrze odwiedzić moją stronę indeksu i stronę administracyjną django. Nie mogę się zalogować i tworzyć obiektów. Na przykład mogę utworzyć witrynę, jak poniżej, ale kiedy próbuję odwiedzić kolekcję witryn, otrzymuję trafienie 404 (nawet po utworzeniu). Używam allauth Django, a te strony również mają problemy z moim urlconfem. Czy każdy może wykryć błąd?

Na przykład ten adres URL:

Page not found (404)
Request Method:     GET
Request URL:    http://myapp.com/admin/sites/site/

No reward found matching the query

I ten:

Page not found (404)
Request Method:     GET
Request URL:    http://shielded-island-1440.herokuapp.com/accounts/profile/

Using the URLconf defined in litherewards.urls, Django tried these URL patterns, in this order:

^ ^$ [name="index"]
....
^ ^reward/$ [name="reward_list"]
^ ^redeem/(?P<reward_code>)/$ [name="redeem_reward"]
^ ^redeem/(?P<slug>w+)/(?P<reward_code>w+)/$ [name="reward_confirmation"]
....
^account/
^sitemap.xml$
^admin/

Mój urlconf wygląda następująco:

from django.conf.urls import patterns, include, url
from myapp.views import RewardSitemap

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
admin.autodiscover()

sitemaps = {"rewards":RewardSitemap}
urlpatterns = patterns("",
url("^", include("myapp.urls", namespace="fluffy")),
url(r"^account/", include("allauth.urls")),
url(r"^sitemap.xml$", "django.contrib.sitemaps.views.sitemap", {"sitemaps": sitemaps}),
url(r"^admin/", include(admin.site.urls)),
)

Adresy URL myappów zawarte w pierwszym pliku urlconf:

urlpatterns = patterns("",
url(r"^$", IndexView.as_view(), name="index"),
....
url(r"^reward/$", RewardsList.as_view(), name="reward_list"),
url(r"^redeem/(?P<reward_code>)/$", RedeemReward.as_view(), name="redeem_reward"),
url(r"^redeem/(?P<slug>w+)/(?P<reward_code>w+)/$", RedeemConfirmation.as_view(), name="reward_confirmation"),
)

I wreszcie, mój ROOT_URLCONF jest ustawione na myapp.urls. Strona indeksu działa dobrze.

Odpowiedzi:

-1 dla odpowiedzi nr 1

Z ograniczonej wiedzy, którą mam, widzę, że wzór URl ma „konto /” i masz dostęp ”http://shielded-island-1440.herokuapp.com/accounts/profile/„który nie pasuje do żadnego z wzorców wyrażenia regularnego w URLConf.

Czy możesz spróbować zmodyfikować adres URL (r „^ accounts /”, include („allauth.urls”)))?