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

  • SEARCH
  • Home
  • 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 6213595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:43:28+00:00 2026-05-24T06:43:28+00:00

I had an idea and before implementing I would like to throw it out

  • 0

I had an idea and before implementing I would like to throw it out there to get some feedback or even discover that somebody has already done.

Here is the thing: I have a website running with a database that is growing quite rapidly and over the months, and over the several issues that took place, got filled with a good amount of garbage. I was thinking in put-up some scripts to run across the database and clean up the mess. So, my idea was to use Django Tests, in a way that one would write a large sum of small simple tests that would do exactly that, except that instead of raising a flag, would actually fix things.

What do you guys think? I can’t think in any reason why this wouldn’t work. But I’m not that seasoned in Django. Would it be hard? Any foreseeable issue?

Thanks!

  • 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-24T06:43:29+00:00Added an answer on May 24, 2026 at 6:43 am

    No, this is a bad idea for many reasons, starting from the design perspective to implementation issues. Just to mention a few:

    1. Tests do not run on the actual database. A separate database is created from scratch for it. You’d have to hack this.
    2. Normally each test case that touches the db, runs in a transaction and then it’s rolled back. So in the end the DB has not changed at all. Ofc you can also avoid this, but that’s not the point.
    3. Tests are supposed to be run all the time when you change something. But the kind of issues you are talking about should be one-time fix only (mostly).

    But there is a very simple and appropriate solution for what you want to do:

    1. Install South
    2. Fix bug that causes incorrect/unwanted data.
    3. Write data migration that fixes/cleans up the already existing “broken” data.
    4. Update and migrate.
    5. Repeat 2-5

    Now, this is for one-time fixes only, but in most cases this is the correct way to do it. You fix the bug that causes the data issue, along with fixing the data.

    If you really need the same data altering functionality to run more than once (periodically), then for that you can create a custom management command (or just a simple executable python script) and schedule it to run from cron.

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

Sidebar

Related Questions

I had the idea of a search engine that would index web items like
I had en idea, which shortly explained was that i would like to load
I had an idea that would require me be able to send and receive
I would like to build a website that has some elements of a social
I had an idea for a client-side language other than JavaScript, and I'd like
I had an idea I was mulling over with some colleagues. None of us
I had this idea of creating a count down timer, like 01:02, on the
I had this idea and my first reaction after having it was That's a
Based on this original idea, that many of you have probably seen before: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
Coming from a background of Visual Studio I had no idea how good that

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.