49👍
✅
Inside your user app, you should have a folder migrations
. It should only contain 0001_initial.py
and __init__.py
. Is that correct?
Try running ./manage.py sqlmigrate user 0001_initial
and see what it does, because thats where the error comes from
2👍
Another issue can also be the fact that you were using the database for another application. So if this can be the case just drop the database before making migrations again
- [Django]-Itertools.groupby in a django template
- [Django]-Django Admin – Specific user (admin) content
- [Django]-How to use Django ImageField, and why use it at all?
1👍
I’ve also encountered with the same issue in Postgres DB.
Steps to follow:
- remove previous db and create new one
- add migration folder and add init.py empty file inside migration folder of each app having models
- now use command
python manage.py makemigrations
- use command
python manage.py migrate
- [Django]-How to view database and schema of django sqlite3 db
- [Django]-Django – Clean permission table
- [Django]-How to get the current URL within a Django template?
0👍
I had the same issues, and what I did was to run python manage.py makemigrations <app_name>
and do not forget to add <app_name>
to INSTALLED_APPS
in your settings.py
file
- [Django]-What is the meaning of bind = True keyword in celery?
- [Django]-Add class to form field Django ModelForm
- [Django]-What's the best solution for OpenID with Django?
Source:stackexchange.com