Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7621983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:20:11+00:00 2026-05-31T04:20:11+00:00

Hi I am using following URL patterns in django and I am wondering that

  • 0

Hi I am using following URL patterns in django and I am wondering that where is problem and why it is not able to find it. Following screenshot shows my URL as well as expected URLs.
enter image description here

Please tell that where I am making mistake. Please tell if some thing else I can tell to understand problem. I was looking on it for almost an hour or 2 and then I posted it on stackoverflow.com so hope I will get some solution.

Adding urls.py here:

from django.conf.urls.defaults import patterns, include, url 
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'ecomstore.views.home', name='home'),
#url(r'^catalog/', 'preview.views.home'),

# url(r'^ecomstore/', include('ecomstore.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
 url(r'^admin/', include(admin.site.urls)),
 url(r'',include('catalog.urls')),
  )

Then urls.py of catalog app:

from django.conf.urls.defaults import *
urlpatterns=patterns('catalog.views',
    (r'^$','index',{'template_name':'catalog/index.html'},'catalog_home'),
    (r'^category/(?P<category_slug>[-\w]+)/$','show_category',{'template_name':'catalog/category.html'},'catalog_category'),
    (r'^product/(?P<product_slug>[-_\w+])/$','show_product',{'template_name':'catalog/product.html'},'catalog_product'),

)

thanks in advance guys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:20:12+00:00Added an answer on May 31, 2026 at 4:20 am

    referring to my comment: at least one thing wrong is that you have an extra slash before “product”. You want ^product, not ^/product. That might be all but it’s a little hard to tell from the pic.

    also, correct me if I’m wrong, because I haven’t used regexes in a while, but doesn’t [-_\w+] only match – OR _ OR \w+?

    “[ ]

    Match anything inside the square brackets for ONE character position once and only once, for example, [12] means match the target to 1 and if that does not match then match the target to 2 while [0123456789] means match to any character in the range 0 to 9.”

    http://www.zytrax.com/tech/web/regex.htm

    so you’d want… [-_]\w+ ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following method to get bitmap from url but image is not
How do you find the following div using regex? The URL and image location
When using english the following URL should apply: http://example.org/services/myservice/ When using another language, the
I'm calling the following URL using YQL http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22UTG.L%22)%0A%09%09&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=cbfunc this returns the following in JSON
I try to get this following url using the downloadURL function as follows: http://www.ncbi.nlm.nih.gov/nuccore/27884304
I am using following code to get bitmap from url. This function is used
I open a pop-up window using following code in main.html function openwindow(url) { window.open(url,
I'm using a GET variable and people get to it by the following URL:
I am using the Google Maps api. When I take the following URL and
I am using the following to add .php extension in the URL: RewriteEngine On

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.