Simple way to find the amount of years between two dates?

2015-07-12 Thread Brandon Keith Biggs
Hello, using the django.utils.timezone.now() function, how can I find the difference from another date in years? For example, if I have two dates like: date1 = (1991, 12, 23) date2 = (1995, 12, 6) How do I use the current time to get 23 from the first and 19 from the second? thank you, -- Br

Allauth will not save additonal fields

2015-07-12 Thread Harrison Mead
Hello, I have posted everything on stack overflow so if you just follow this link that would be great, thanks! http://stackoverflow.com/questions/31366278/allauth-will-not-save-additional-fields -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Simple way to find the amount of years between two dates?

2015-07-12 Thread Avraham Serour
date 1 - date 2 On Sun, Jul 12, 2015, 2:02 PM Brandon Keith Biggs < brandonkeithbi...@gmail.com> wrote: > Hello, > using the django.utils.timezone.now() function, how can I find the > difference from another date in years? > For example, if I have two dates like: > date1 = (1991, 12, 23) > date2

Re: Simple way to find the amount of years between two dates?

2015-07-12 Thread lars van Gemerden
question is a bit vague, but look at python datetime.datetime and datetime.timedelta On Sunday, July 12, 2015 at 1:02:55 PM UTC+2, Brandon Keith Biggs wrote: > > Hello, > using the django.utils.timezone.now() function, how can I find the > difference from another date in years? > For example,

Re: Simple way to find the amount of years between two dates?

2015-07-12 Thread Brandon Keith Biggs
Hello, This works: from django.utils import timezone from datetime import datetime today = timezone.now() date1 = datetime(1991, 12, 23, tzinfo=today.tzinfo) apart = today-date1 years = apart.days/365 print(years) This works great for what I need it for! thanks, Brandon Keith Biggs

Where to put wsgi code in Apache in Ubuntu?

2015-07-12 Thread Christian Kleineidam
The Django documentation tell me to put WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py WSGIPythonPath /path/to/mysite.com Require all granted Into the httpd.conf-file. Such a file doesn't exist on Ubuntu. Where

Re: Where to put wsgi code in Apache in Ubuntu?

2015-07-12 Thread John 
If your install of apache is httpd, /etc/httpd/ If is apache2, /etc/apache2/ Under this folder, you may have conf and conf.d directories. You will find the httpd.conf of apache2.conf ;) > On Jul 12, 2015, at 7:54 PM, Christian Kleineidam > wrote: > > The Django documentation >

Re: Where to put wsgi code in Apache in Ubuntu?

2015-07-12 Thread Alex Mandel (wildintellect)
On ubuntu using vhosts, /etc/apache2/sites-available/ then run a2ensite to enable the conf you make, if you just toss the conf into default an apache reload is all you need. -Alex On Jul 12, 2015 3:56 PM, John  wrote:If your install of apache is httpd, /etc/httpd/If is apache2, /etc/apache2/Under

Grouping lists in a template

2015-07-12 Thread Andrea
Hello. I'm new to both django and python. Been trying to figure out how to group items from a model for hours now. This in an example code i made up to illustrate my problem: # Models class Book(models.Model): submitted_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='book_su

How to render a grouped list to a template

2015-07-12 Thread Andrea
Hello. I'm new to both django and python. This in an example code i made up to illustrate my problem: # Models class Book(models.Model): submitted_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='book_subby') submitted_date = models.DateField(auto_now=True) book_title =