Re: Saving data from HTML form into the database

111 views
Skip to first unread message
Message has been deleted

Roshan Jha

unread,
Oct 4, 2018, 5:30:03 AM10/4/18
to django...@googlegroups.com
You can do it by with the help of form.save().

For example, 
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from .forms import EmpDetailForm
def addEmp(request):
if request.method == 'POST':
empform = EmpDetailForm(request.POST)
if empform.is_valid():
empform.save()

On Thu, Oct 4, 2018 at 2:54 PM Jaydeep Borkar <jaijb...@gmail.com> wrote:
I want to save the data entered by the user into the HTML form(pure HTML) into the database. I'm a complete newbie in Django, what I found is Django forms can do the job, but still I can't figure it out. Please, provide me with a detailed answer/link for this. I'm using Django 1.9. Also, I wish to use Firebase as a database. So, the data from HTML form should be directly saved in Firebase database and I should be able to access that data. Please, guide me through this. 

Thanks in advance!!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c4da0963-b32c-403c-a68b-b1c7e8116781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages