Try Django 1.8 Tutorial - 14 of 42 - Form in a View - Learn Django
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they were following when they ask why their Django form is not rendering, saving, or validating as it does in the video.
Recommended by 0 people across 0 different months, 2015 to 2016.
What it is
Part 14 of the Try Django 1.8 series from CodingEntrepreneurs, a roughly 19-minute screencast on using a Django form inside a function-based view. It covers building a sign-up form, handling request.POST, and printing or saving the submitted data as part of an MVP landing page project.
What people said
Cites GreedyAi · 2015-07 · Stack Overflow · on “Can't save instance of a form on database. Django”
I trying to write a small app while learning django. I was trying to create a django form to create an instance of one of my models in database. I was following [this video] to accomplish this. I wrote similar code, but the program doesn't seem to save created model in database. this is my models code: from django.db import models # Create your models here. class VoteType(models.Model): pub_date = models.DateTimeField('date published') name = models.CharField(max_length=50) def __unicode__(self): return self.name class Vote(models.Model): name = models.CharField(max_length=50) image = models.ImageField(upload_to= "images/vote/") rating = models.IntegerField(default=0) vote_type = models.ForeignKe
Cites GreedyAi · 2015-07 · Stack Overflow · on “Save django forms on button click”
I am currently trying to learn django. I decided to create a small app. currently I am making a form to create VoteType and Voting candidates on one page. I created a page where u can add as many candidate fields as you want, but when I click the button nothing happenes and even if I don't click the button some data is saved. I was watching this django guide on [this video] . This guy is making one simple form. He added method = POST and action = '' to ... and in views he used (request.POST or None). I tried to do the similar, but as my form is a bit more complicated I got really confused. so this is my views.py code: def create(request): voteTypeForm = VoteTypeForm(request.POST or None) voteForm
Cites vtj808 · 2015-09 · Stack Overflow · on “Can't get 'Form' working in Django”
I am creating a site using Django/Python. I have only just begun the registration page where a user will input their info and the data should flow into the sqlite3 DB which comes with Django. I have since yesterday evening (been just under 24 hours now) trying to figure out why my forms aren't showing up. I tried attaching what I'm getting vs what I'm aiming for but don't have enough reputation points so please visit: [this video] 9.09mins for what I'm aiming for. Please note: The word 'welcome' on the youtube vid has been replaced with 'Thank you' by me. This code is in my views.py. The issue is that the small boxes which a user would type in their fullname and email in the video (which I have r
Cites eded ed · 2016-08 · Stack Overflow · on “Request.Post or None”
In this [this video] In minute 17:52 he have some staff on the screen. First, This line: form = SignUpForm(request.POST or None) And second line: print request.POST['mail'] i didnt undarstanad his enlish to understand two things: What are the two parameters in the constructor are doing? Why he say its not good to print the data like he did? what that does to the form sending? Edit: My view: from django.shortcuts import render from .form import SignAlbumForm def SignUp(Request): form = SignAlbumForm(Request.POST) if form.is_valid(): print form.save(commit=False).name return render(Request, 'showname/index.html', {'form':form})