./manage.py migrate not work

WEN Pingbo wengpingbo at gmail.com
Fri May 20 18:44:56 AEST 2016


Hello, folks

I want to install patchwork in my local environment, by following
development guide doc. But when I run './manage.py migrate' command,
the script complains that the 'patchwork_state' table not found. And I
can not find the table definition.

Did I miss something?

Here are the outputs:

pluvia at ubuntu:~/patchwork$ ./manage.py migrate
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 398, in execute
    self.check()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py",
line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py",
line 13, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py",
line 23, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py",
line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py",
line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py",
line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py",
line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/pluvia/patchwork/patchwork/urls.py", line 25, in <module>
    from patchwork import views
  File "/home/pluvia/patchwork/patchwork/views/__init__.py", line 35,
in <module>
    from patchwork.forms import MultiplePatchForm
  File "/home/pluvia/patchwork/patchwork/forms.py", line 214, in <module>
    class MultiplePatchForm(forms.Form):
  File "/home/pluvia/patchwork/patchwork/forms.py", line 216, in
MultiplePatchForm
    state = OptionalModelChoiceField(queryset=State.objects.all())
  File "/home/pluvia/patchwork/patchwork/forms.py", line 165, in __init__
    __init__(initial=self.no_change_choice[0], *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py",
line 1142, in __init__
    self.queryset = queryset
  File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py",
line 1168, in _set_queryset
    self.widget.choices = self.choices
  File "/home/pluvia/patchwork/patchwork/forms.py", line 169, in _get_choices
    super(OptionalModelChoiceField, self)._get_choices())
  File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py",
line 1113, in __len__
    return (len(self.queryset) +
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 240, in __len__
    self._fetch_all()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 1074, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 52, in __iter__
    results = compiler.execute_sql()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py",
line 848, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py",
line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py",
line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py",
line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py",
line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py",
line 112, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line
226, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line
36, in defaulterrorhandler
    raise errorvalue
django.db.utils.ProgrammingError: (1146, "Table
'patchwork.patchwork_state' doesn't exist")

Pingbo


More information about the Patchwork mailing list