Babbar matsalar ita ce, idan ka watsar da ƙaura sannan ka yi ƙoƙarin sake gudanar da ƙaura, django ba zai gane sauye-sauyen da ka yi ba kuma maimakon haka zai sake gudanar da ƙaura ta asali.
I am trying to dump my previous migrations in Django. I have tried the following command: <code>python manage.py dumpdata --exclude contenttypes --exclude auth.permission > app/fixtures/initial_data.json</code> However, this only dumps my current data and not the data from my previous migrations. How can I do this? A: You can use <code>--format=json</code> to export your data into a json file and then you can use it as a fixture for your future migrations: <code>python manage.py dumpdata --format=json --indent=4 > app/fixtures/initial_data.json # add all your apps here separated by spaces </code>
Menene juji
Juji kayan aiki ne na layin umarni don zubar da abubuwan da ke cikin rumbun adana bayanai zuwa fayil ɗin rubutu.
Yadda za a yi ƙaura a Django
1.8
Akwai 'yan hanyoyi daban-daban don ƙaura bayanan ku a cikin Django 1.8.
1. Yi amfani da umarnin ƙaura don gudanar da jerin ƙaura akan sabar ci gaban ku:
$ python sarrafa.py ƙaura
2. Yi amfani da kayan aikin django-migrate:
$ pip shigar django-migrate $ cd myproject $ django-migrate init $ python sarrafa.py ƙaura