0

I am connecting my database with Django codes so when I use python manage.py makemigrations I get the error as no such file

py manage.py makemigrations C:\Users\selwy\AppData\Local\Programs\Python\Python310\python.exe: can't open file 'C:\Users\selwy\projects\manage.py': [Errno 2] No such file or directory PS C:\Users\selwy\projects>

  • Please [edit] your question to show the entire output after you run `python manage.py makemigrations`. Feel free to edit sensitive information such as your name, but we need more of the output than you provided so far. – Code-Apprentice Apr 04 '22 at 18:55

1 Answers1

0

This can be solved with these steps :

  1. Delete your database (db.sqlite3 in my case) in your project directory.
  2. Remove everything from pycache folder under your project subdirectory.
  3. For the application you are trying to fix, go to the folder and clear migrations and pycache directories

When you are sure you have cleared all the above files, run:

python manage.py makemigrations
python manage.py migrate

For further references,visit: Django - no such table exception

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268