gpt4 book ai didi

python - 渲染时捕获 AttributeError : tuple object has no attribute regex

转载 作者:太空宇宙 更新时间:2023-11-03 13:51:03 25 4
gpt4 key购买 nike

这是我的 urls.py,目前收到错误:“元组对象没有属性正则表达式”。有什么想法吗?

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'),
)

最佳答案

您忘记了第二组 URL 模式的模式。它应该看起来像这样:

urlpatterns += patterns('django.contrib.auth.views', 

关于python - 渲染时捕获 AttributeError : tuple object has no attribute regex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8894377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com