0
我想做到,因爲usercreationform一個簡單的登記表格,但我得到這個錯誤:「Match_view」對象有沒有屬性「RINDEX」
File "/home/draicore/project/multilevel/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in get_mod_func
143. dot = callback.rindex('.')
Exception Type: AttributeError at/
Exception Value: 'Match_view' object has no attribute 'rindex'
這裏我的源代碼:
views.py :
from django.views.generic import TemplateView,FormView
from .forms import UserForm
from django.core.urlresolvers import reverse_lazy
class Match_view(FormView):
template_name = 'synopticup/validator.html'
form_class = UserForm
success_url = reverse_lazy('vista_validador')
urls.py:
url(r'^dracoin/validator/$',Match_view(),name = 'vista_validador'),
forms.py:
from django import forms
from django.contrib.auth.forms import UserCreationForm
class UserForm(UserCreationForm):
pass
我的代碼有什麼問題?
感謝