top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

In Django, How to delete the table in the existing database?

+1 vote

Anyone can explain how to delete or alter existing table in database?

posted Aug 26, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Deleting a table in Django can be very tricky.

First, if you are using SQLite which comes with Django and you feel you have messed up your whole table/database do the following
1. Delete the SQLite file. This erases the database.
2. Adjust your models and make migrations again using python makemigrations and python migrate

To delete a table, you have to use MySQL connector to make changes to the database.

Last, altering a table is also tricky. If you added new lines of codes to your database which already exists, you have to set blank=0

answer Oct 30, 2018 by Uncle Sherlock
Similar Questions
+1 vote

Is it possible to display a data grid table with django? Basically I am looking for displaying a data from the db table on the web interface through django or some other web interface.

My main application is in Python, that's why I'd like to explore Python possibilities first.

0 votes


Is there any default database for Django like LAMP or WAMP in PHP?

+1 vote

I want to count the number of active user in website and also I have to display their IP Address by using python Django framework.

+2 votes
(venv)avinash@dell ~/django_projects/usertracking $ python runserver
Performing system checks...

System check identified no issues (0 silenced).
December 27, 2014 - 13:12:42
Django version 1.7.1, using settings 'usertracking.settings'
Starting development server at
Quit the server with CONTROL-C.
Error: That IP address can't be assigned-to.
0 votes

I'm new to Django. Is there any tell how to add a limit filter in Django?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.