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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:28:23+00:00 2026-05-17T01:28:23+00:00

python manage.py dumpdata modelName > file.json . created an empty database for a user

  • 0
  1. python manage.py dumpdata modelName > file.json.
  2. created an empty database for a user meder on postgres
  3. modified pga_hb.conf so that meder can use the database
  4. changed the settings in settings.py
  5. python manage.py syncdb ( I didnt create a su )
  6. attempting to loaddata file.json but it complains that the superuser isn’t there or doesn’t match up…

    Traceback (most recent call last):
    File “manage.py”, line 11, in
    execute_manager(settings)
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/core/management/init.py”, line 438, in execute_manager
    utility.execute()
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/core/management/init.py”, line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/core/management/base.py”, line 191, in run_from_argv
    self.execute(*args, **options.dict)
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/core/management/base.py”, line 220, in execute
    output = self.handle(*args, **options)
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/core/management/commands/loaddata.py”, line 219, in handle
    transaction.commit(using=using)
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/db/transaction.py”, line 199, in commit
    connection._commit()
    File “/srv/python-environments/saltycrane/lib/python2.5/site-packages/django/db/backends/init.py”, line 32, in _commit
    return self.connection.commit()
    psycopg2.IntegrityError: insert or update on table “bugs_bug” violates foreign key constraint “poster_id_refs_id_89e0243f”
    DETAIL: Key (poster_id)=(1) is not present in table “auth_user”.

Was I not supposed to syncdb? Was I supposed to dumpdata for the generic tables? I still have the db all intact in MySQL but would appreciate any direction.

SIDENOTE: I do have south installed. I did the --initial command a couple days ago. Perhaps I could use south as well?

  • 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-17T01:28:23+00:00Added an answer on May 17, 2026 at 1:28 am

    You have to run:

    python manage.py dumpdata > file.json.
    

    This will dump data from all tables(Models).

    Running python manage.py dumpdata myapp.modelName > file.json. will only dump data for model modelName in app myapp.

    You can also try, this if you only want to dump data for model modelName:

    python manage.py dumpdata auth myapp.MyModel > file.json
    

    This way data with Users will also dumped.

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

Sidebar

Related Questions

To output my database to json file I would usually do python manage.py dumptdata
For some reason today I cannot dump my database using python manage.py dumpdata or
When I issue the command: python manage.py syncdb --database=mydb It shows the output as
after running python manage.py syncdb i gett an error saying unable to open database
I entered: python manage.py loaddata fixtures\companies.json. It gives me an error. What is the
I would like to customize the files and folders created when running python manage.py
(pinax09)[user@web213 social]$ python manage.py syncdb Error: Can't import Pinax. Make sure you are in
I made a model, and ran python manage.py syncdb. I think that created a
I am doing this through django $ python manage.py shell from django.contrib.auth.models import User
I'm trying to reset a database in Django, using: python manage.py reset app but

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.