Answer the question
In order to leave comments, you need to log in
How to draw a form on all pages?
How can I draw the form on all pages of the site, as an example I use these urls and views
from django.shortcuts import render
from .models import *
from django import forms
from .forms import callMeForm
# Create your views here.
def home(request):
slide = HomeSlider.objects.filter(is_active=True)
return render(request, 'home/home.html', { 'slide': slide,})
def call(request):
if request.method == 'POST':
zvonok = callMeForm(request.POST)
if zvonok.is_valid():
zvonok.save()
else:
return render(request, 'sms_signup/errors.html', locals())
else:
zvonok = callMeForm()
return render(request, 'home/home.html', {'zvonok':zvonok})
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^zvonok', views.call, name = 'call')
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question