How do I create a migration when creating a Django app? #817
-
I'm at a loss as to how i should go about creating a migration for Django app that i generated from this template? |
Beta Was this translation helpful? Give feedback.
Answered by
browniebroke
Oct 16, 2024
Replies: 2 comments 3 replies
-
Great question. I've had this issue while trying to contribute to reusable Django apps, it's a real problem. I thought the answer would be simpler, but while trying it out, I found several issues with the current setup. Basically, you need to:
I'll see if I can make it work better out of the box, thanks for the question! |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
abe-101
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great question. I've had this issue while trying to contribute to reusable Django apps, it's a real problem.
I thought the answer would be simpler, but while trying it out, I found several issues with the current setup. Basically, you need to:
manage.py
at the root of your project. This can be taken from the standarddjango-admin startproject
and pointing the default setting file to the test settings:os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
at the beginning ofmain()
functionmigrations/__init__.py
in your apppython manage.py makemigrations --skip-checks
and you should see your new migration file. The--skip-checks
is required because the def…