#create a form
from django import newforms as forms
class LoginForm(forms.Form):
email = forms.CharField()
password = forms.CharField()
# Create a view and make it accessible from the url.py:
# Create your views here.
from django.http import HttpResponse
from django.utils.html import escape
from django.shortcuts import render_to_response
from elearning.modules.login.loginform import LoginForm
from elearning.modules.models import Teacher
from django.http import HttpResponseRedirect
from django import http
#from django.core.exceptions import DoesNotExist
def gotoIndex(form):
return render_to_response('index.html', {'form': form})
def login(request):
r=HttpResponse()
loginform=LoginForm(request.POST)
if loginform.is_valid():
try:
#r.write("'"+str(loginform['email'])+"'")
login=Teacher.objects.get(email=loginform.data['email'])
#login=Teacher.objects.get(email="himu11@yahoo.com")
r.write(login.password)
# Check whether UserName and password mathc
except Teacher.DoesNotExist:
return gotoIndex(loginform)
if login.password !=loginform.data['password']:
return gotoIndex(loginform)
return HttpResponseRedirect('/modules/loginsuccess')
def loginsuccess(request):
return render_to_response('TeacherAdmin.html')
# Now write html:
4 comments:
...please where can I buy a unicorn?
Y como comprenderlo http://nuevascarreras.com/comprar-cialis-es/ cialis 20 mg prospecto Ritengo che questa sia un'ottima idea. cialis o viagra que es mejor jxsxqfblby [url=http://www.mister-wong.es/user/COMPRARCIALIS/comprar-viagra/]cialis online[/url]
Im Vertrauen gesagt ist meiner Meinung danach offenbar. Versuchen Sie, die Antwort auf Ihre Frage in google.com zu suchen levitra online apotheke viagra bestellen forum [url=http//t7-isis.org]cialis kaufen online[/url]
Nice staf, men! Thank4post
http://botscripcalfspan.chez.com/?c=7&p=60
http://thumbrihandcoun.chez.com/skachat-besplatno-programmu-besplatnie-sms/skachat-programmu-3d-puteshestviya-v-kosmose.html
Post a Comment