When I examined line 194 of the base.py file I noticed the following code:
tz = 'UTC' if settings.USE_TZ else settings_dict.get('TIME_ZONE')
By changing the USE_TZ parameter in my settings.py file to 'False' I then got the following error:
psycopg2.DataError: invalid value for parameter "TimeZone": "Australia/Perth"
"Australia/Perth" was the timezone setting in my settings.py file so at least it was accessing my timezone now.
Looking again at psycopg2 base.py file I noticed the following code:
if tz:
try:
get_parameter_status = self.connection.get_parameter_status
except AttributeError:
# psycopg2 < 2.0.12 doesn't have get_parameter_status
conn_tz = None
else:
conn_tz = get_parameter_status('TimeZone')
if conn_tz != tz:
Putting a debug 'print conn_tz' into base.py showed that conn_tz (presumably the timezone setting of the postgres db) was 'Australia/West'.
Changing my settings.py TIME_ZONE to 'Australia/West' allowed syncdb to run normally.