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 8431911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:58:57+00:00 2026-06-10T05:58:57+00:00

To be able to see how my django application looks like, and performs with

  • 0

To be able to see how my django application looks like, and performs with lots of data, i would like to programmatically generate data in the database. In the django documentation they propose either using fixtures oder SQL statements, but i would rather use a simple python loop to generate thousends of random entries by using the django model classes.

How can i execute such a script? I am using south for database migration, but even there such generation of data seems not to be supported.

  • 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-06-10T05:58:59+00:00Added an answer on June 10, 2026 at 5:58 am

    You can use django-whatever (enhanced django-any) – it easily creates dummy data.

    Here is my sample (in *app_name*/management/commands/dummyitems.py):

    class Command(BaseCommand):
        args = '[count]'
    
        def handle(self, count=20, *args, **options):
    
            try:
                i = int(count)
            except ValueError:
                print u'n is to be a number!'
                sys.exit(1)
    
            for _ in xrange(i):
                # you can pass params explicitly
                m = any_model(MY_MODEL_CLASS, image=None)
                m.save()
    

    And so if I need 100 dummy items I run:

    $ python manage.py dummyitems 100
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the django admin, I would like to be able to specify which models
I am writing a Django application and using the built-in ORM. I would like
I want the user to be able to see my application in the menu
How do you work with someone when they haven't been able to see that
I have a Django application running locally and I'd like to test the send_mail()
I have a Django Model with a text field. I would like to modify
I'm developing application on Django, and ready to move to deployment server. I'm able
When using Django sessions , is it good practice to see if session data
We are implementing the gamification component of a project in Django. We would like
i am not able to see where i am going wrong with my xpath

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.