Hello Pavel, Following is my views.py:
from django.shortcuts import render from home.models import Contact
def index(request):
return render(request,'index.html')
def about(request): return render(request,'about.html')
def services(request): return render(request,'services.html')
def contact(request): if request.method =="POST": name=request.POST.get('name') phone=request.POST.get('phone') email=request.POST.get('email') desc=request.POST.get('desc') obj1=Contact(name,phone,email,desc) obj1.save()
return render(request,'contact.html')
def str(self): self.name
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello Pavel,
Following is my views.py:
from django.shortcuts import render
from home.models import Contact
Create your views here.
def index(request):
def about(request):
return render(request,'about.html')
def services(request):
return render(request,'services.html')
def contact(request):
if request.method =="POST":
name=request.POST.get('name')
phone=request.POST.get('phone')
email=request.POST.get('email')
desc=request.POST.get('desc')
obj1=Contact(name,phone,email,desc)
obj1.save()
def str(self):
self.name