[Answer]-Cant validate Role.py model in Django

1๐Ÿ‘

โœ…

Do the following changes :

1) Rename your usermodels folder to models folder(for simplicity).

2) In the __init__.py file of models folder, import the Role model using from . import Role.

3) leave the models.py file(of the outer directory) blank.

So ultimately you will have the following structure

website (root directory)  
..mainws (its app)  
....migrations(not filled)  
....models  
......__init__.py  
......Role.py  
....__init__.py  
....admin.py  
....models.py  
....test.py  
....views.py  
..website(directory for project)  
..manage.py 

Then run the sqlall command.It should work!

๐Ÿ‘คYmartin

Leave a comment