Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment #197

Open
younes-alouani opened this issue Feb 3, 2019 · 0 comments
Open

Deployment #197

younes-alouani opened this issue Feb 3, 2019 · 0 comments

Comments

@younes-alouani
Copy link

Hi,

I was working today on the deployment of my django project that used django-cities-light.
Once the project is cloned on the server. And when executing migrations I got this error :

Applying cities_light.0009_auto_20190202_0257...Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 203, in handle
    fake_initial=fake_initial,
  File "/usr/lib/python3.5/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3.5/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python3.5/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 514, in database_forwards
    getattr(new_model._meta, self.option_name, set()),
  File "/usr/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 356, in alter_unique_together
    self._delete_composed_index(model, fields, {'unique': True}, self.sql_delete_unique)
  File "/usr/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 380, in _delete_composed_index
    constraint_names = self._constraint_names(model, columns, **constraint_kwargs)
  File "/usr/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 1029, in _constraint_names
    constraints = self.connection.introspection.get_constraints(cursor, model._meta.db_table)
  File "/usr/lib/python3.5/site-packages/django/db/backends/sqlite3/introspection.py", line 268, in get_constraints
    pk_column = self.get_primary_key_column(cursor, table_name)
  File "/usr/lib/python3.5/site-packages/django/db/backends/sqlite3/introspection.py", line 187, in get_primary_key_column
    raise ValueError("Table %s does not exist" % table_name)
ValueError: Table cities_light_city does not exist

SOLUTION :
The solution is to comment : 'cities_light' in your settings

INSTALLED_APPS = [
    ...
    # 'cities_light',
    ...
] 

If you want to populate your cities, regions and countries models please load fixtures of your project (mode : development)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant