Django : Table doesn't exist

前端 未结 8 1715
再見小時候
再見小時候 2020-11-28 07:45

I dropped some table related to an app. and again tried the syncdb command

python manage.py syncdb

It shows error like

dja         


        
8条回答
  •  Happy的楠姐
    2020-11-28 07:58

    I have to face same issue and there are a couple of approaches, but the one I think is the most probable one.

    Maybe you are loading views or queries to database but you haven´t granted enough time for Django to migrate the models to DB. That's why the "table doesn't exist".

    Make sure you use this sort of initialization in you view's code:

    Class RegisterForm(forms.Form):

      def __init__(self, *args, **kwargs):
        super(RegisterForm, self).__init__(*args, **kwargs)
    

    A second approach is you clean previous migrations, delete the database and start over the migration process.

提交回复
热议问题