﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24616	date_hierarchy with USE_TZ=True won't work with Amazon RDS	Ben Lee	nobody	"I got this error in the Django admin when upgrading Django to 1.6:

  ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions
  for your database and pytz installed?

when rendering this: 

  {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}

From to Django 1.6 release notes:

 Time zone-aware day, month, and week_day lookups
 Django 1.6 introduces time zone support for day, month, and week_day lookups when USE_TZ is   
 True. These lookups were previously performed in UTC regardless of the current time zone.
 This requires time zone definitions in the database. If you’re using SQLite, you must install pytz. If 
 you’re using MySQL, you must install pytz and load the time zone tables with mysql_tzinfo_to_sql.


You're supposed to run this command to load tz data into the ""mysql"" db. 

   mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

but if you're hosted with Amazon RDS, you don't have root access and the user (created when launching the RDS instance) doesn't have access to the ""mysql"" database.  

    ERROR 1044 (42000) at line 1: Access denied for user '<user>'@'%' to database 'mysql'

FWIW, the Django admin worked fine with Amazon RDS in Django 1.4, '''and now RDS users may be effectively blocked from upgrading Django versions.'''
"	Cleanup/optimization	closed	contrib.admin	1.6	Normal	wontfix	pytz,mysql_tzinfo_to_sql,USE_TZ		Accepted	0	0	0	0	0	0
