Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19403 closed Uncategorized (invalid)

timezone missing error

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When I did this part of the turorial:

Just for good measure, let's also include the was_published_recently custom method from Tutorial 1:

class PollAdmin(admin.ModelAdmin):

# ...
list_display = ('question', 'pub_date', 'was_published_recently')

Adding 'was_published_recently' to list_display in admin.py would cause an error: "Global name timezone not defined"

I added this to the top of models.py to fix it:
from django.utils import timezone

to get rid of the error

Change History (2)

comment:1 by Tim Graham, 12 years ago

Resolution: invalid
Status: newclosed

You must have missed the part in tutorial 1 where it instructs to add that import.

comment:2 by anonymous, 12 years ago

See about this error in version 1.5-alpha-1
https://code.djangoproject.com/ticket/19793#ticket

Note: See TracTickets for help on using tickets.
Back to Top