Questions tagged [django-manage.py]

django-manage.py refers to Django's command-line utility for common administrative tasks.

django-manage.py refers to Django's command-line utility for common administrative tasks.

188 questions
224
votes
18 answers

django change default runserver port

I would like to make the default port that manage.py runserver listens on specifiable in an extraneous config.ini. Is there an easier fix than parsing sys.argv inside manage.py and inserting the configured port? The goal is to run ./manage.py…
jonny
  • 4,264
  • 4
  • 22
  • 29
90
votes
14 answers

How to stop gunicorn properly

I'm starting gunicorn with the Django command python manage.py run_gunicorn. How can I stop gunicorn properly? Note: I have a semi-automated server deployment with fabric. Thus using something like ps aux | grep gunicorn to kill the process manually…
j7nn7k
  • 17,995
  • 19
  • 78
  • 88
81
votes
16 answers

django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg

Presently, I'm attempting to configure Django for use on a project, and am encountering a persistent error when I try to run python manage.py syncdb. File "/x/x/x/x/x/x/base.py", line 23, in ? raise ImproperlyConfigured("Error loading psycopg…
user968270
  • 4,251
  • 5
  • 21
  • 20
55
votes
12 answers

Django manage.py: Migration applied before its dependency

When running python manage.py migrate I encounter this error: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration .0016_auto__ is applied before its…
39
votes
2 answers

Django: Difference between using server through manage.py and other servers like gunicorn etc. Which is better?

I have been running my beginner Django projects with manage.py runserver. I see suggestions to use gunicorn instead. What is the difference ?
Rishi Saraswat
  • 419
  • 1
  • 4
  • 8
33
votes
4 answers

Heroku django app createsuperuser

I deployed my django app and when I tried heroku run python manage.py syncdb I got a timeout awaiting process error. Superuser is not created for the system yet, though i did syncdb by using: heroku run:detached python manage.py…
Aswin Murugesh
  • 10,831
  • 10
  • 40
  • 69
29
votes
14 answers

ImportError: No module named django.core.management when using manage.py

I'm trying to run python manage.py runserver on a Django application I have and I get this error: Traceback (most recent call last): File "manage.py", line 8, in from django.core.management import execute_from_command_line ImportError: No…
Zach
  • 4,555
  • 9
  • 31
  • 52
28
votes
2 answers

Why is run called twice in the Django dev server?

I want to make the Django development server do something before it starts running. To do this, I created a new app, added it to the top of INSTALLED_APPS, and then created a management/commands/runserver.py file in the app with the following…
Taymon
  • 24,950
  • 9
  • 62
  • 84
25
votes
5 answers

Django manage.py : Is it possible to pass command line argument (for unit testing)

Is it possible to pass command line arguments to Django's manage.py script, specifically for unit tests? i.e. if I do something like manage.py test myapp -a do_this Can I receive the value do_this in the setUp function of unit test? P.S. @Martin…
user4150760
  • 2,739
  • 5
  • 18
  • 25
24
votes
1 answer

Django manage.py --no-input . Yes or no?

I can't find this in the docs. When I run python manage.py collecstatic --no-input does it mean it will answer "yes" to any prompt that would pop up in the process? The same for python manage.py migrate --no-input.
Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180
19
votes
2 answers

How to manage.py loaddata in Django

I've being fighting with this command for several hours now. If I do python manage.py dumpdata --natural-foreign --> data.json when I loaddata I get the error Could not load contenttypes.ContentType(pk=19): duplicate key value violates unique…
Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180
16
votes
2 answers

How does one use Django custom management command option?

The Django doc tell me how to add an option to my django custom management command, via an example: from optparse import make_option class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--delete', …
peter2108
  • 5,580
  • 6
  • 24
  • 18
16
votes
2 answers

Is it possible to create subparsers in a django management command?

Title really says it all, but I currently have this, but it doesn't work: class Command(BaseCommand): help = ("Functions related to downloading, parsing, and indexing the " "content") def add_arguments(self, parser): …
mlissner
  • 17,359
  • 18
  • 106
  • 169
15
votes
1 answer

Add confirmation step to custom Django management/manage.py command

I created the following custom management command following this tutorial. from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from topspots.models import Notification class…
elethan
  • 16,408
  • 8
  • 64
  • 87
14
votes
4 answers

Django: how to pass individual setting to manage.py

I'm looking for a way to override/define some individual django setting from command line without additional settings files. What I need right now is to set the DEBUG setting or logging level each time when I run my management command. But it would…
raacer
  • 5,302
  • 3
  • 27
  • 46
1
2 3
12 13