Forums

Django timezone

I'm following the Django tutorial:
https://docs.djangoproject.com/en/1.6/intro/tutorial01/

Trying to run:
from django.utils import timezone

Assuming I understand how python lays out packages; using a bash shell, I visited:
/usr/local/lib/python2.7/dist-packages/django/utils

And I don't see timezone.py listed:
...
text.pyc
timesince.py
timesince.pyc
translation
tree.py
...

What am I missing?

Thanks!

The tutorial is for Django 1.6. For Python 2.7 we have Django 1.3 installed and for Python 3, we have Django 1.6.

Got it, thanks. I was starting the app as Django 1.6, but kept navigating in the bash shell to Python 2.7.

As a follow up question, do you know why Django 1.3.7 and Django 1.6 put the default new project and new apps in different default starting directories?

Under Django 1.3.7, when I start a new project, it goes here: /home/user/mysite
And to start a new app I run python /home/user/mysite/manage.py startapp myapp
And it creates: /home/user/mysite/myapp

Under Django 1.6, when I start a new project, it goes here: /home/user/mysite/mysite (except for manage.py located one directory lower)
And to start a new app I run python /home/user/mysite/manage.py startapp myapp
And it creates: /home/user/mysite/mysite/myapp

They reorganised where all of the default folders went in Django 1.4. According to the release notes the change was to "fix some issues with the previous manage.py handling of Python import paths that caused double imports, trouble moving from development to deployment, and other difficult-to-debug path issues."