mardi 5 mai 2015

Django URL is not calling a function instead it returns old information

I don't understand clearly why the URL is not calling a function,instead it returns old information. May be cache problem ? If yes, how to prevent ?

Please note: I am using render_to_response

The cases I have tried is REQUEST METHOD : GET or I am refreshing the browser for the new information

Is anyone facing the same issue before ? please let me know your views. Your help is highly appreciable

For instance:

URLS.PY

url(r'^home/$','home.views.index')

VIEWS.PY

def index(request):
    print "I am in index"
    new_info = "Here getting updated information from django models"
    return render_to_response('index.html',{'new_info':new_info})

Problem is some times it goes inside the function and returns new information, but other times not at all going inside, instead returns old information

Aucun commentaire:

Enregistrer un commentaire