hello my view.py is like this:
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.db import models
from django.core.files.storage import FileSystemStorage
#from django.core.servers.basehttp import FileWrapper
from django.contrib.auth import authenticate, login
from .forms import FormContatti
from django.core.mail import send_mail
from django.views.decorators.csrf import csrf_protect
global lenguage
language = 'it'
def first_page(request):
testo = ["aaaa ....." , 'bbbbbb']
if language == 'it':
testo = testo[0]
else :
testo = testo[1]
return render(request,'polls/first_page.html',{'testo':testo,})
where language can be it or en, in the web page i have two flag where i
have to place an <href and i need only to pass the global variable
language, because any view have the if statement to the global varible
language
Thanks for your help
Luca
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/157f35f6-7f52-4451-ae68-0fb704b9e64b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.