Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django get form data from post

value=request.POST['input_name']
Comment

in function how to get data from django form

from django.core.mail import send_mail

if form.is_valid():
    subject = form.cleaned_data['subject']
    message = form.cleaned_data['message']
    sender = form.cleaned_data['sender']
    cc_myself = form.cleaned_data['cc_myself']

    recipients = ['info@example.com']
    if cc_myself:
        recipients.append(sender)

    send_mail(subject, message, sender, recipients)
    return HttpResponseRedirect('/thanks/')
Comment

PREVIOUS NEXT
Code Example
Python :: how to convert binary to text in python 
Python :: numpy logspace 
Python :: dict typing python 
Python :: make white image numpy 
Python :: beautiful soup 4 
Python :: flask python use specified port 
Python :: python how to draw a square 
Python :: pyspark group by and average in dataframes 
Python :: check if all characters in a string are the same python 
Python :: python to c# 
Python :: python set day of date to 1 
Python :: how to iterate over columns of pandas dataframe 
Python :: clean nas from column pandas 
Python :: only keep rows of a dataframe based on a column value 
Python :: python cmd exec 
Python :: leap year 
Python :: run python notepad++ 
Python :: plot multiple axes matplotlib 
Python :: pandas df filter by time hour 
Python :: print( n ) in python 
Python :: distance between numpy arrays 
Python :: find the difference in python 
Python :: convert matplotlib figure to cv2 image 
Python :: pandas df to mongodb 
Python :: how to convert timestamp to date in python 
Python :: random in python 
Python :: How to wait a page is loaded in Python Selenium 
Python :: django set session variable 
Python :: dt.weekday_name 
Python :: how to install python dill 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =