You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hello everyone,
First post on this mailing list. Big thanks to the community and the core dev
of Django!
I'm using Django 1.7c1 with python 3.2 or 3.4.
I'm splitting lots of my website as Django apps. So my main app is handling
(only) the urls routing, the settings, some tests and that's it.
I want to do some data migrations. For example add some
django.contrib.sites.models.Site objects to the database when I migrate my
app. Or some flags (django-waffle) etc. All the data relates to this app.
I don't want to put this data migration into the django.contrib.sites folder
cause it's already packaged as root etc. So it's not runnable from my
development user (to create or read the file into the folder). And it's the
same problem for all these apps I want to add data into.
If I run "python3 manage.py makemigrations --empty <app>", it create the
0001_initial.py migrations. I create the function to add the data inside the
database, and try to run the migrations with "python3 manage.py migrate
<app>", but get the error:
"CommandError: App <app> does not have migrations (you cannot selectively
sync unmigrated apps)"
So I'm searching how can I make this <app> migrated? Create an empty initial
migrations? so the django migrations take this app into account.
Thank you for all your help
aRkadeFR
j1z0
unread,
Jul 16, 2014, 10:07:06 AM7/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com, con...@arkade.info
Are you sure you have your django app in your settings.INSTALLED_APPS and your django app has a migrations folder underneath it with an __init__.py file?
I'm pretty sure that should be all you need to have in place so you can run a migration.
Cheers,
Jeremy
aRkadeFR
unread,
Jul 17, 2014, 7:59:03 AM7/17/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
After some tests, the problem came from the lack of the file models.py
The __init__ is there and is ok.
If I run without models.py file:
python3 manage.py migrations <app> --empty
python3 manage.py migrate
-> that doesn't take into account my <app>
But if I run the same commands with models.py (even empty), it takes into
account my app and migrate it.
Seems to be something weird to me, cause the 0001_initial.py migration is
exactly the same generated file either case.
Anyway, problem solved, but weird behavior from my point of view? If anyone
can tell me why…