X
X
xozzslip2015-07-01 19:28:05
Django
xozzslip, 2015-07-01 19:28:05

Why is the request processed in the wrong pattern?

The request http://127.0.0.1:8000/flashcards/is being processed in the wrong pattern. Writes

1 pattern(s) tried: ['flashcards/(?P<deck_id>[0-9]+)/$']
, but I would like it to be processed by the first application pattern.
Project Urls
urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^flashcards/', include('flashcards.urls')),
]

Application Urls
urlpatterns = [
    url(r'^$', views.deck_choice, name='deck_choice'),
    url(r'^(?P<deck_id>[0-9]+)/$', views.question_in_deck, name='question_in_deck'),
]

UPD: The reason was migration errors. Rebuilding the database helped.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2015-07-01
@sim3x

Move to the bottom

S
Stanislav Fateev, 2015-07-01
@svfat

and so? make the first pattern in the application urlsurl(r'$', views.deck_choice, name='deck_choice'),

A
Artem Klimenko, 2015-07-02
@aklim007

what version of junga are you using?
you have written under version 1.8, and no jambs are visible, if an earlier version is used, then it can lead to problems.

V
Vov Vov, 2015-07-02
@balamut108

Good afternoon, swap templates + write CBV - this is more correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question