-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviews.py
37 lines (24 loc) · 900 Bytes
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from django.shortcuts import render, HttpResponse
from MyApp.models import contact
# Create your views here.
def index(request):
context = {
'variable':"this is sent"
}
return render(request,'index.html',context)
def contact(request):
if request.method == "POST":
email = request.POST.get('email')
name = request.POST.get('name')
# phone = request.POST.get('')
phone = request.POST.get('phone', '')
contact_instance = contact.objects.create(email=email, name=name, phone=phone)
contact.save()
return render(request,'contact.html')
def about(request):
return render(request,'about.html')
# return HttpResponse("This is about page")
def services(request):
return render(request,'services.html')
def home(request):
return render(request,'home.html')