Note that there are some explanatory texts on larger screens.

plurals
  1. POneed help in email subscription in django (python)
    text
    copied!<p>im making a simple email subscription project.i have a html file which is having email text field.And now i want to get the entered email value from the html page and store it in mysql database.I dont know how to move on.i googled and saw everywhere but iam not able to understand properly.i also checked the dangoproject website.can any one simply explain me how to do this.Thank you in Advance </p> <h3>email.html</h3> <pre><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="." method=POST&gt; enter email&lt;input type =text name="email"&gt; &lt;input type=submit value="submit"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h3>models.py</h3> <pre><code>from django.db import models class ferpost(models.Model): useremail=models.CharField(max_length=50) </code></pre> <h3>views.py</h3> <pre><code>from django.http import HttpResponse from django.shortcuts import render_to_response def ind(request): name=request.POST["form-email"] print name return render_to_response('email.html') </code></pre> <h3>urls.py</h3> <pre><code> urlpatterns = patterns('', # Examples: # url(r'^$', 'webapp1.views.home', name='home'), # url(r'^webapp1/', include('webapp1.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: # url(r'^admin/', include(admin.site.urls)), url(r'^$','app1.views.ind'), ) </code></pre> <h3>settings.py</h3> <pre><code> INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', #Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: 'django.contrib.admindocs', 'app1',#this is my app name ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload