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

Migrations do not work with Django 1.5.9 #64

Closed
cosmokai opened this issue Apr 15, 2015 · 9 comments
Closed

Migrations do not work with Django 1.5.9 #64

cosmokai opened this issue Apr 15, 2015 · 9 comments

Comments

@cosmokai
Copy link

Hi, I'm using Django 1.5.9 and wanted to integrate silk since it should support Django 1.5 (see README).
Now, after I ran migrate I get this:

UnknownMigration: Migration 'silk:0001_initial' probably doesn't exist.
Traceback (most recent call last):
  File "/home/kai/IdeaProjects/core-tms/env/local/lib/python2.7/site-packages/south/migration/base.py", line 302, in migration
    migration = __import__(full_name, {}, {}, ['Migration'])
  File "/home/kai/IdeaProjects/core-tms/env/local/lib/python2.7/site-packages/silk/migrations/0001_initial.py", line 4, in <module>
    from django.db import models, migrations
ImportError: cannot import name migrations

The migrations module was integrated in Django 1.7 I think, so how do I use silk with Django 1.5?
Thanks!

@mtford90
Copy link
Collaborator

@cosmokai It looks like south is trying to load the new style django migrations, I didn't foresee that... perhaps there is a way in which to exclude certain apps when you run south's migrate?

@mtford90
Copy link
Collaborator

Ahh check this out: https://docs.djangoproject.com/en/1.8/topics/migrations/#libraries-third-party-apps

Apparently if I create a south_migrations directory for silk, this issue can be avoided. I'll get on that now, shouldn't take long

@mtford90
Copy link
Collaborator

Actually, for backwards compatibility, it should be migrations (for south) and django_migrations for the new style, which should automatically be picked up

@cosmokai
Copy link
Author

Wow, that was fast... Yes, I think it should work if django_migrations will be picked up, but I'm not sure if django does it. Where did you find that? Another solution would be to use south_migrations and migrations, and require a south installation of at least version 1.0.

@mtford90
Copy link
Collaborator

@cosmokai yep you're right - that ended up being the best solution. django_migrations ended up requiring an extra settings.py setting so I think it's better just to require the south upgrade. I just released version 0.5.2 with the changes - all seems to work for me. Can you try it and close the issue if all working?

@cosmokai
Copy link
Author

I can confirm that it works, thanks!

@mtford90
Copy link
Collaborator

Excellent!

@pbassut
Copy link

pbassut commented Jul 11, 2015

Is it needed to add something to settings.py to get this working? I'm using django 1.5.4 and it throws me an error because it's searching on the wrong directory.

@pbassut
Copy link

pbassut commented Jul 11, 2015

I got it working. This needed to be added to settings.py:

SOUTH_MIGRATION_MODULES = {
    'silk': 'silk.south_migrations',
}

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

3 participants