python - How do I use generic views in Django? -


i trying use django's generic views make user registration page. have following code in app's urls.py

from django.conf.urls.defaults import * models import ticket  urlpatterns = patterns('',     (r'^new/$', 'django.views.generic.create_update.create_object', { 'model': user } ), ) 

now when go url following:

templatedoesnotexist @ /new/ auth/user_form.html 

i have tried making template match keep getting message. advice?

also, assumed make template me. put in template file when make it?

edit: coming rails mixing templates , views. still stuck think need make function in view. like:

def user_form:     #stuff 

you need create template file using format <app_label>/<model_name>_form.html. place template template directory defined in template_dirs in settings file.

in template file itself, need use context defined standard modelform.

{{ form.name.label_tag }} {{ form.name }} 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -