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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:36:01+00:00 2026-06-01T07:36:01+00:00

>>> from django.core.management import call_command >>> call_command(‘syncdb’) executes the syncdb management command from within

  • 0
>>> from django.core.management import call_command
>>> call_command('syncdb')

executes the syncdb management command from within a python script. However, I want to run the equivalent of

$ python manage.py syncdb --noinput

from within a python shell or script. How can I do that?

The following lines don’t work without interrupting me with the question whether I want to create a super user.

>>> call_command('syncdb', noinput = True) # asks for input
>>> call_command('syncdb', 'noinput') # raises an exception

I use Django 1.3.

  • 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-01T07:36:02+00:00Added an answer on June 1, 2026 at 7:36 am
    call_command('syncdb', interactive = False)
    

    EDIT:

    I found the answer in the source code. The source code for all management commands can be found in a python module called management/commands/(command_name).py

    The python module where the syncdb command resides is django.core.management.commands.syncdb

    To find the source code of the command you can do something like this:

    (env)$ ./manage.py shell
    >>> from django.core.management.commands import syncdb
    >>> syncdb.__file__
    '/home/user/env/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.pyc'
    >>> 
    

    Of course, check the contents of syncdb.py, and not syncdb.pyc.

    Or looking at the online source, the syncdb.py script contains:

        make_option('--noinput', action='store_false', dest='interactive', default=True,
            help='Tells Django to NOT prompt the user for input of any kind.'),
    

    that tells us that instead of --noinput on the command line, we should use interactive if we want to automate commands with the call_command function.

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

Sidebar

Related Questions

I am importing my settings.py in conf.py of sphinx. import settings from django.core.management import
I built a a.py in my mysite file, a.py: from django.core.management import setup_environ from
Problem: to find the Python module execute_manager in the class django.core.management. The question is
from django.contrib.auth.models import User u = User.objects.get(username='test') user.password u'sha1$c6755$66fc32b05c2be8acc9f75eac3d87d3a88f513802 Is reversing this password encryption
Given a Django model likeso: from django.db import models class MyModel(models.Model): textfield = models.TextField()
I have a form like: #forms.py from django import forms class MyForm(forms.Form): title =
I have a form like so: from django import forms from django.contrib.auth.models import User
I have this code in my forms.py : from django import forms from formfieldset.forms
I am doing something like this in myproject.myapp.urls : from django.conf.urls.defaults import * urlpatterns
I have a model project_phase : from django.db import models from django.utils import simplejson

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.