Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:48:30+00:00 2026-05-23T10:48:30+00:00

I am using Django to build a website with MySQL. Now as I am

  • 0

I am using Django to build a website with MySQL. Now as I am learning so I need to change the Model very often so I want that all tables get cleared and new table get created.

But syncdb doesn’t touch existing tables. Is there any better way to handle this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:48:31+00:00Added an answer on May 23, 2026 at 10:48 am

    If you don’t care about data:

    Best way would be to drop the database and run syncdb again. Or you can run:

    For Django >= 1.5

    python manage.py flush
    

    For Django < 1.5

    python manage.py reset appname
    

    (you can add --no-input to the end of the command for it to skip the interactive prompt.)

    If you do care about data:

    From the docs:

    syncdb will only create tables for
    models which have not yet been
    installed. It will never issue ALTER
    TABLE statements to match changes made
    to a model class after installation.
    Changes to model classes and database
    schemas often involve some form of
    ambiguity and, in those cases, Django
    would have to guess at the correct
    changes to make. There is a risk that
    critical data would be lost in the
    process.

    If you have made changes to a model
    and wish to alter the database tables
    to match, use the sql command to
    display the new SQL structure and
    compare that to your existing table
    schema to work out the changes.

    https://docs.djangoproject.com/en/dev/ref/django-admin/

    Reference: FAQ – https://docs.djangoproject.com/en/dev/faq/models/#if-i-make-changes-to-a-model-how-do-i-update-the-database

    People also recommend South ( http://south.aeracode.org/docs/about.html#key-features ), but I haven’t tried it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.Net and NHibernate to build a website. Now, I need to add
I'm using Django to build a website with a MySQL (MyISAM) backend. The database
I want to build a system using Django that will allow users to build
I want to build an API service using Django. A basic workflow goes like
I am developing a small testing website using Django 1.2 in Aptana Studio build
I am using django to build an app that is slightly heavy on functionality.
I'm using django-on-tornado to build an application that is similar to the chat applicatoin
I'm going to build a website using OSQA which is built on Django (a
I am using django 1.1.4 and python 2.6.6 with mod_wsgi to build a website
I have build a website in Django . I need to use the web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.