app's post-migrate triggers work only with pip's -e flag

12 views
Skip to first unread message

Olivier Dalang

unread,
Feb 8, 2018, 5:33:30 PM2/8/18
to django...@googlegroups.com
Dear List,

I'm currently trying to deploy a Django 1.8 app and run into a strange problem.

My app defines a post-migrate trigger in apps.py :

# apps.py
class MyAppConfig(AppConfig):
...

def ready(self):
print('Debug : installing the post-migrate callback')
post_migrate.connect(my_callback, sender=self)

This works as expected when installed for development (using  pip install -e /path/to/the/app ) : after migrations, my_callback is correctly called.

But then, when I pip-install the exact same code but without -e :  pip install/path/to/the/app , the callback isn't called anymore after the migrations. The strange thing is that everything else seems to work correctly still. Also the debug statement is printed to the console, which indicates the post_migrate signal should be connected. It seems all files are in the site-package folders...

How come I can get different results depending on whether I install with or without -e ?
Any idea what is happening ?

Thank you very much in advance !!

Olivier

Olivier Dalang

unread,
Feb 8, 2018, 6:14:43 PM2/8/18
to django...@googlegroups.com
Well it was some deleted file's .pyc lying around (models.pyc which was triggering migrations) :/

Sorry for the noise !

Kind regards,

Olivier

Reply all
Reply to author
Forward
0 new messages