There are 3 possible layers of caching that return you the previous page: browser Django Apache
The 1st is solved by appending the timestamp or random number as additional fictional GET parameter (jQuery does it automatically when you pass the cache: false to the ajax call) The 2nd is solved by using the never_cache decorator on your view. Most probably (as everything works fine without Apache) you have the Apache-wide caching. Read the docs on how to configure Apache to prevent caching for specific URLs (unfortunately it's not what I know well). But I recommend using the previous methods as well. On Jul 12, 12:22 pm, Irimi <arnaud....@gmail.com> wrote: > Hi all, > > I'm trying to use Django and especially GeoDjango so I made a "little > application" where a country is randomly proposed and the user must > select it on the map (http://www.geotests.net/geogame/). > > When the user select the country on the map an ajax request is send by > the application and call a function of my views. > > Everything works fine when I use it with the django server. But when I > tried to do the same with apache mod-python, the ajax call return me > the actual page. > > I think i've got maybe a problem with the url rewriting... > > Do you know what i'm doing wrong? > > Here is my ajax call : > > JavaScript : > > var url = './getName?'; > var country = $('randomCountryName').innerHTML; > XY = map.getLonLatFromPixel(new OpenLayers.Pixel > (evt.xy.x, evt.xy.y)); > url += 'x='+XY.lon; > url += '&y='+XY.lat; > url += '&tryCountry='+tryCountry; > url += '&country='+country; > new OpenLayers.Request.GET({ > url : url, > success: responseCountry > }); > > And the view : > > def getName(req) : > #Geos Point geometry > pnt = Point(float(req.GET['x']), float(req.GET['y'])) > response = {} > if int(req.GET['tryCountry']) == 1 : > newCountry = newName(req.GET['country']) > response['newCountry'] = newCountry.name > response['X'] = newCountry.geom.centroid.x > response['Y'] = newCountry.geom.centroid.y > try : > country = WorldBorders.objects.get(geom__intersects=pnt) > if country.name != req.GET['country'] : > response['result'] = "false" > else : > newCountry = newName(country.name) > response['newCountry'] = newCountry.name > response['X'] = newCountry.geom.centroid.x > response['Y'] = newCountry.geom.centroid.y > response['result'] = "true" > except : > response['result'] = "false" > > # Return a json object > return HttpResponse(simplejson.dumps > (response),mimetype="application/javascript") > > Thanks for any help > > Regards > > Arnaud --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---