Re: memcache not used?
Hi, just a quick note... the port (112211) wrong only on your email, or in the settings file too? > CACHE_BACKEND = 'memcached://127.0.0.1:112211/' Paolo --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: possible urls issue
On Mon, Jun 30, 2008 at 5:36 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > ok assuming i use a HttpResponseRedirect, how would I pull the session > variables into the template? HttpResponseRedirect does not use a template. The response is a 302 code to the browser, not an html page, to tell the browser to issue another request for the page you are redirecting to. Let's say that you return HttpResponseRedirect('/step2/ '). The browser receives the redirection request and calls the new url http://mysite.com/step2/. That is ANOTHER request that is handled by the view you chose for '^step2/' in your urls.py Paolo --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Trying to get ifequal to evaluate to True
On Mon, Jun 30, 2008 at 5:14 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > > On Jun 30, 8:05 pm, "Paolo Ambrosio" <[EMAIL PROTECTED]> > wrote: >> On Mon, Jun 30, 2008 at 4:52 PM, Ayaz Ahmed Khan >> >> <[EMAIL PROTECTED]> wrote: >> > [...] The variable "next" >> > does have that particular value (I verified both by printing it out >> > and by making sure {% if next %} evaluates to True). However, the >> > "ifequal" expression just doesn't work. >> >> Are you passing it through the context while invoking the template? > > I, myself, am not passing that particular value. I am calling the > built-in login view provided by Django -- which is ``from > django.contrib.auth.views import login''. That view passes the "next" > as part of the context while rendering the login template. I just built a test application and it works for me, if I understood what is your problem. I created a view protected by the @login_required decorator, mapped to two different urls: 1) /accounts/test1/ 2) /accounts/test2/ The login_required redirects to /accounts/login/?next=... that calls the same view you are using. And this is my template ("registration/login.html"): {{ next }} - {% ifequal next "/accounts/test1/" %}true{% endifequal %} If I go to http://localhost:8000/accounts/test1/, I am redirected to http://localhost:8000/accounts/login/?next=/accounts/test1/ that shows: /accounts/test1/ - true otherwise if I go to http://localhost:8000/accounts/test2/ I see: /accounts/test2/ - Maybe yours is just a typo. Paolo P.S. I am using the trunk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Trying to get ifequal to evaluate to True
On Mon, Jun 30, 2008 at 4:52 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > [...] The variable "next" > does have that particular value (I verified both by printing it out > and by making sure {% if next %} evaluates to True). However, the > "ifequal" expression just doesn't work. Are you passing it through the context while invoking the template? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: possible urls issue
On Mon, Jun 30, 2008 at 4:50 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > when form1 is_valid, the view saves form1 to session variables then > redirects to step2 as follows: > > return render_to_response("step2.html",'form': form}, > context_instance=RequestContext(request)) > > > The main issue i'm having is that i need this to redirect to > mysite.com/step2/ but it's staying at mysite.com/step1/ which results > in the view for step2 not being executed. I am not sure I understood your problem correctly, but if you want to redirect the request to another url you have to use HttpResponseRedirect, since render_to_response simply uses the step2.html template to render the page (so no http redirect). AFAIK it should be also explained in the Django tutorial. Hope it helps. Paolo --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---