Forums

Timezone (first django app)

I am simply trying to follow along with the recommended tutorials

I am following the one that helps you create a POLL:

https://docs.djangoproject.com/en/1.6/intro/tutorial01/

I get the following error when I try to import the 'timezone' from django.utils

Here is my code:

In [16]: from django.utils import timezone                                                                                                                                      
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.py in <module>()
----> 1 from django.utils import timezone

ImportError: cannot import name timezone

In [17]:

If yo uhave any suggestions of or can just tell me about the error I would appreciate any knowledge sharing. Thank you.

Hi there,

our default Django version is currently Django 1.3. django.utils.timezone is a newer feature.

You have two choices.

Thank Harry. Will PythonAnywhere be taking steps to upgrade from 1.3 or will that remain default indefinitely?

It will probably remain the default for a while to avoid breaking existing web apps that rely on it, but we are thinking up ways to provide a choice of versions for users. It's not a simple task, though, so don't hold your breath.