Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro: No such table

**Estou tentando adicionar um novo aluno e/ou um novo curso,mas apresenta o seguinte erro:**

OperationalError at /admin/escola/curso/add/
no such table: escola_curso
Request Method:    POST
Request URL:    http://127.0.0.1:8000/admin/escola/curso/add/
Django Version:    3.2.5
Exception Type:    OperationalError
Exception Value:    
no such table: escola_curso
Exception Location:    C:\Users\Camil\PycharmProjects\djangoAPI\venv\lib\site-packages\django\db\backends\sqlite3\base.py, line 423, in execute
Python Executable:    C:\Users\Camil\PycharmProjects\djangoAPI\venv\Scripts\python.exe
Python Version:    3.9.6
Python Path:    
['C:\\Users\\Camil\\PycharmProjects\\djangoAPI',
 'C:\\Users\\Camil\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip',
 'C:\\Users\\Camil\\AppData\\Local\\Programs\\Python\\Python39\\DLLs',
 'C:\\Users\\Camil\\AppData\\Local\\Programs\\Python\\Python39\\lib',
 'C:\\Users\\Camil\\AppData\\Local\\Programs\\Python\\Python39',
 'C:\\Users\\Camil\\PycharmProjects\\djangoAPI\\venv',
 'C:\\Users\\Camil\\PycharmProjects\\djangoAPI\\venv\\lib\\site-packages']
Server time:    Tue, 27 Jul 2021 19:07:13 -0300
2 respostas
solução!

Pelo erro acho que faltou rodar as migrations. https://docs.djangoproject.com/en/3.2/topics/migrations/

Solucionei assim:

Remove the new changes from the models and run python manage.py migrate --fake

Now again modify your models with new changes

Run python manage.py makemigrations

And then again run python manage.py migrate