Solved: django.db.utils.OperationalError: no such table

When we tried to run django server after copied from one directory to another and deleting the cache files __pycache__ and database db.sqlite3 so that we can run the server at new location, suddenly we got an error as below,

django.db.utils.OperationalError: no such table:

This seems possibly that we deleted the database and cache manually and didn’t follow the initialisation steps properly since we just copied the code from one directory to another. So instead of doing all steps again, we can resolve this error by following steps,

Solution


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


$ python manage.py makemigrations
$ python manage.py migrate --run-syncdb 
$ python manage.py migrate 

You can refer more about Django & REST at

Installing Django and Django-REST Framework on ubuntu

lynxbee_ezoic

Leave a Comment

Android Android Build system Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded