Questions tagged [urlconf]

116 questions
0
votes
1 answer

page not found without forward slash in a url django

I have the following structure for urls in my urlconf from django.conf.urls import patterns, include, url from django.conf import settings urlpatterns = patterns('app.views', url(r'^$',…
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313
0
votes
1 answer

django urlconf cant find directives to including urls

i read the "practical django projects" and i stack on chapter 5. In general i have done exactly as it is in the book. I created a urls dir in coltrane app, I removed the urls.py file and i edited the urls.py in cms to write the include statements…
b10n1k
  • 567
  • 5
  • 21
0
votes
1 answer

Django pagination URLconf

My code looks like this answer but I am stuck with URLconf. I have an app installed and the pagination should be on index view. Current regex for it is: url(r'^$', views.IndexView.as_view(), name='index') (line from urls.py) I assume my pagination…
mortusdetus
  • 97
  • 2
  • 12
0
votes
2 answers

Django can't match url for date

I have a simple application and would like the home page to take a date as an url parameter. url( regex=r'^$', view=HomeView.as_view(), name='home' ), url( regex=r'^/(?P\d{2}-\d{2}-\d{4})/$', view=HomeView.as_view(), …
bgrantdev
  • 1,622
  • 4
  • 17
  • 29
0
votes
1 answer

Django: match one or more from a set of keyworded regular expressions in an urlconf

I have a Django view that takes three optional keyworded arguments. I want to handle the regular expression for matching possible urls to this view in one line. I want to structure the urls nicely. An example: My possible parameters are start which…
Tim Wilder
  • 1,607
  • 1
  • 18
  • 26
0
votes
1 answer

NoReverseMatch using URLConf & Generic Views in Django 1.4.x

I have this in my template file: Vote again? This was my URLConf: urlpatterns = patterns('polls.views', url(r'^$', 'index'), url(r'^(?P\d+)/$', 'detail'), …
blaze
  • 2,588
  • 3
  • 32
  • 47
0
votes
2 answers

how to "break" from a regex in django urlconf

I have the following views: def tag_page(request, tag): products = Product.objects.filter(tag=tag) return render(request, 'shop/tag_page.html', {'products': products, 'tag': tag}) def product_page(request, slug): product =…
darko
  • 2,438
  • 8
  • 42
  • 54
0
votes
1 answer

How do I properly decouple URLConf in Django tutorial 3?

I am following the Django tutorial and have made it to Decoupling the URLConfs in tutorial 3. Prior to this step, everything was working. Now, when I do the final step of Removing hardcoded URLs in templates which is changing
  • Andy
    • 49,085
    • 60
    • 166
    • 233
  • 0
    votes
    2 answers

    regex "OR" matching in Django urlconf without sending match as a view parameter

    In my Django urlconf, i'd like to return a 404 for requests probing for scripts. Otherwise, the request is needlessly hitting the database to look for a corresponding FlatPage, since i'm using the FlatPage middleware. My problem is that the…
    -1
    votes
    2 answers

    I am getting: TypeError: view must be a callable or a list/tuple in the case of include()

    My root urls.py: from django.contrib import admin from django.urls import path, include urlpatterns = [ path('', include('webarticles.urls')), ] While I have seen this error answered on stackoverflow before, they don't seem to work for me.…
    -1
    votes
    1 answer

    The requested URL in my Django app can grow indefinately and still be matched by Django URLResolvers

    I have the following line in my src/urls.py (r'^nomundo', include('interviews.urls')), and in my src/interviews/urls.py I have the following: r'/$', 'interviews.views.interviews'), This construction allows me to access URLs such as…
    Francisco
    • 1,352
    • 4
    • 13
    • 27
    1 2 3 4 5 6 7
    8