3

here is my urls.py and am currently getting the error: "tuple object has no attribute regex". Any thoughts?

from django.conf.urls.defaults import *
from ecomstore import settings

urlpatterns = patterns('ecomstore.accounts.views',
                       (r'^register/$', 'register', {'template_name':'registration/register.html', 'SSL':settings.ENABLE_SSL}, 'register'),
                       (r'^my_account/$','my_account', {'template_name':'registration/my_account.html'},'my_account'),
                       (r'^order_details/(?P<order_id>[-\w]+)/$', 'order_details', {'template_name':'registration/order_details.html'}, 'order_details'),
                       (r'^order_info//$', 'order_info', {'template_name':'registration/order_info.html'},'order_info'),
)

urlpatterns += ('django.contrib.auth.views', 
                (r'^login/$','login', {'template_name':'registration/login.html', 'SSL':settings.ENABLE_SSL}, 'login'),
)
1
  • 1
    You need to call patterns() on the second group of patterns, although I'm not sure this would give that attribute error on its own. Commented Jan 17, 2012 at 12:17

1 Answer 1

6

You forgot patterns around the second set of URL patterns. It should look like this:

urlpatterns += patterns('django.contrib.auth.views', 
Sign up to request clarification or add additional context in comments.

1 Comment

thanks - i've been staring at it for an hour :P. sometimes the easy ones are the hardest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.