Django 1.6, how to set field default value for CreateView
问题 models.py class App(models.Model): name = models.CharField(max_length=10, default='') desc = models.CharField(max_length=10, default='') views.py class AppCreate(CreateView): template_name = "app/add.html" model = App templates <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <form action="" method="POST"> {% csrf_token %} {{form}} <input type="submit" value='submit'> </form> </body> </html> Here two problems: Why I set model field default value,