Adding www. prefix to get_absolute_url

2008-09-21 Thread Catalyst
I'm using Django .96 and I'm having trouble getting get_absolute_url to add a www. prefix on to my URLs. For the most part everything on my site keeps people on my www. URL, which is my goal, but my sitemap and RSS feeds point to URLs without a www. on them. Does anyone know a good way to

Including user's email in message body with a contact form

2009-05-18 Thread Catalyst
I followed the instructions here to build a contact form: http://www.djangobook.com/en/2.0/chapter07/ This works great, except I want to add the user's email address into the message body of the email that's sent through. In other words... To: [Site Owner's Email] From: [User's Email] Su

Re: Including user's email in message body with a contact form

2009-05-18 Thread Catalyst
That did it! Thanks Alan. On May 18, 6:48 am, zayatzz wrote: > have you tried replacing > cd['message'], > with > cd['message']+cd['email'], > or > cd['message']+' your mail address is '+cd['email'], > > Alan.

Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
I'm having trouble getting variables to output from a different Django app. For example, I have two apps installed in Django (besides the default stuff), events and polls. Here's my template code that's mapped to the events URL. {% for event in latest_event_list %} {{ event.n

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 1:00 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Please show your views code or tell what you pass into template > context. Sure thing, here's my views code for the events app. from mysite.events.models import Event from django.shortcuts import render_to_response, get_object_or_404

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 1:10 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > In list_events view you have to pass your polls list into context to. > > ... > from mysite.polls.models import Poll > ... > def list_events(request): > latest_event_list = Event.objects.all() > latest_poll_list = Poll.objects

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 8:37 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Yes you can try to play with custom template tags or with context > processorshttp://www.djangoproject.com/documentation/templates_python/#subclass... OK, excellent. Thanks for your help Alex, much appreciated. --~--~-

Looping through a specific number of times with a for loop

2008-06-19 Thread Catalyst
I was trying to figure out the best way to loop through a specific number of objects in a for loop. For example at the template level... {% for news in latest_news_list last 10 %} I'm hoping this would grab the latest 10 objects in the latest_news_list. Does anyone know the best way

Re: Looping through a specific number of times with a for loop

2008-06-19 Thread Catalyst
On Jun 19, 11:54 am, Tim Chase <[EMAIL PROTECTED]> wrote: > >   For example at the template level... > > >     {% for news in latest_news_list last 10 %} > > >   I'm hoping this would grab the latest 10 objects in the > > latest_news_list. Does anyone know the best way to do this, or have > > so

Contact form doesn't see user as logged in

2011-01-03 Thread Catalyst
I am having trouble with a contact form on my site. Whenever I hit the page, it doesn't see that the user is logged in. Here's how my code looks. #forms.py from django import forms from django.utils.translation import ungettext, ugettext_lazy as _ class ContactForm(forms.Form):

Re: Contact form doesn't see user as logged in

2011-01-04 Thread Catalyst
Thank you, this worked. I appreciate the fast response Łukasz. On Jan 3, 11:38 pm, Łukasz Rekucki wrote: > On 4 January 2011 02:27, Catalyst wrote: > > >  I am having trouble with a contact form on my site. Whenever I hit > > the page, it doesn't see that the user is l