Search code examples
pythondjangopinax

Installed the pinax requirements over the base.txt file - nothing works?


I installed the pinax requirements over the base.txt file .

Now when I do python manage.py syncdb i get:

Traceback (most recent call last):
  File "manage.py", line 20, in <module>
    execute_from_command_line()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
443, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
  File "C:\Python27\lib\site-packages\django\core\management\sql.py", line 6, in
 <module>
    from django.db import models
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in <modul
e>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 34, in __geta
ttr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 90, in __getitem
__
    self.ensure_defaults(alias)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 80, in ensure_de
faults
    conn.setdefault('TIME_ZONE', 'UTC' if settings.USE_TZ else settings.TIME_ZON
E)
  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 185, in
inner
    return func(self._wrapped, *args)
AttributeError: 'Settings' object has no attribute 'USE_TZ'

I really do not know how to fix that. Therefore I am happy for every idea/advice I get!!


Solution

  • That usually means -- even if the error is really not helpful at all -- that there's some sort of syntax or import error happening while Django is trying to import your settings file.

    Try opening up a shell and importing the settings module by hand to see what exception, if any, you're getting:

    1. Open up a command prompt (or Powershell) in the directory that hosts your manage.py.
    2. Look at the DJANGO_SETTINGS_MODULE setting in that manage.py. It might be project.settings.
    3. Open up a Python shell in that console session; then import project.settings or whatever. An exception will probably occur. Fix it :)

    YMMV, hope this helps...