I have been writing a new Django package that will be pip-installable. I've been stuck for awhile because I'm unsure how to make migrations for my particular package so to allow for the normal workflow of an install to be:
- pip install my package
- add my package to your "INSTALLED_APPS"
- run
python manage.py migrate
Currently, my package looks like this:
package_root/
dist/
actual_package/
__init__.py
models.py
setup.py
The problem I am facing is that when I package the app and install it using pip install dist/...
and then add it to my example apps "INSTALLED_APPS", running python manage.py migrate
does not create any tables for the models in actual_package/models.py
and hence I (from a users perspective) need to then run python manage.py makemigrations actual_package
first, which is not ideal.
Any ideas on how to have the migrations already sorted before a user installs would be excellent.