migrations error

21 views
Skip to first unread message

carlos

unread,
Mar 20, 2017, 11:18:52 AM3/20/17
to django...@googlegroups.com
Hi all,

When I install my first third party application in my model I create my initial migration and everything okay, after that probe I uninstall that application and create another new migration number 2, but it throws me an error because there is no longer the application in both the Setting as well as in my virtual environment.

This is a bug in migrations? i use django 1.10.x
when apply python manage.py migrate, this error it happens i say me, no exist the application X
and the error is in 0001_initial.py line where import the packages tha no longer exist

how to fix this error?

thx any helps

Camilo Torres

unread,
Mar 20, 2017, 6:10:20 PM3/20/17
to Django users
Hi,

Do you have the virtual environment active when you run the migrate command?

carlos

unread,
Mar 21, 2017, 1:31:49 AM3/21/17
to django...@googlegroups.com
Hi, Camilo, yes of course, i see when create first 0001_initial.py files this file import the models for third party
app, but when uninstall app i apply news migrations i think django migration check all files i discover the import models for the third apps not exit anymore and raise the error, for me maybe this error the migrations a have put example:
initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-09 17:07
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import hitcount.models     <----- this apps i uninstall
import sorl.thumbnail.fields
import taggit_autosuggest.managers

i create new migrations
0002_auto_numbers
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-03-17 09:46
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):
   ....

when i erase this third apps hitcount, in settings. py and uninstall with pip,  I apply the new migrations this error raise:

RuntimeError: Model class hitcount.models.HitCount doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

maybe is a logic bug the django migrations, because if I do not need an app anymore I have to uninstall it!!

Or I'm confused???

cheers


On Mon, Mar 20, 2017 at 4:10 PM, Camilo Torres <camilo...@gmail.com> wrote:
Hi,

Do you have the virtual environment active when you run the migrate command?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/45c81c1e-4127-42e7-8b2f-9e5e38cc7f68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha
Reply all
Reply to author
Forward
0 new messages