Questions tagged [manage.py]

`manage.py` is a command-line utility for Django's administrative tasks. It is an automatically created thin wrapper around `django-admin.py`.

manage.py is similar to django-admin but it does some extra tasks like putting your project's package on sys.path and sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project’s settings.py file.

Usage

manage.py <command> [options]

Source

201 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
27
votes
1 answer

Django dumpdata django.contrib.auth

I want dump data of django.contrib.auth app. I've tried: >> python manage.py dumpdata django.contrib.auth > 'django.contrib.admin.json' Error: Unknown application: django.contrib.auth >> python manage.py dumpdata 'django.contrib.auth' >…
imkost
  • 8,033
  • 7
  • 29
  • 47
15
votes
5 answers

Django CommandError: App 'polls' has migrations

Trying to follow the tutorial at Django project. The problem I've come across is that when performing the command: python manage.py sql polls I'm given the error: CommandError: App 'polls' has migrations. only the sqlmigrate and sqlflush commands…
sneexz
  • 265
  • 2
  • 4
  • 10
13
votes
14 answers

cannot open manage.py after installing django

I have a problem in setting up django. My situation: I have Anaconda Python 2.7 in my Windows 8 computer. On the Anaconda command prompt window, I type: pip install django. This is successful. Then I create a folder named "newproject". On the…
Mel
  • 169
  • 1
  • 1
  • 7
12
votes
7 answers

How to execute code in the Django shell by an external python script?

What I want to achieve: I would like to create a python script to deactivate Django users in the database from the CLI. I came up with this: $ sudo python manage.py shell >>> user = User.objects.get(username=FooBar) >>> user.is_active = False >>>…
scre_www
  • 2,536
  • 4
  • 20
  • 30
12
votes
3 answers

How to write custom django manage.py commands in multiple apps

Imagine I have two or more apps in my django project, I was able to successfully write and execute custom manage.py commands when I had only one app, A. Now I have a new app, B, and as mentioned in…
user1335608
  • 156
  • 1
  • 1
  • 5
10
votes
2 answers

Problem with Django-1.3 beta

Guys!! I'm really enthusiastic in learning django and learnt a bit on Django-1.2 but then I installed 1.3 version which is ok till I run the server using the command "python manage.py runserver". It's giving a huge error. I can't figure out a way to…
Mojo_Jojo
  • 939
  • 4
  • 13
  • 26
10
votes
2 answers

Django makemessages decides to comment already existing translations

When I run manage.py makemessages I found some messages which were in the .po file like this: msgid "Example" msgstr "Example" Transformed to this, after I ran the command: #~ msgid "Example" #~ msgstr "Example" What does #~ means? Since the…
Saturnix
  • 10,130
  • 17
  • 64
  • 120
8
votes
1 answer

Ignoring existing table when ./manage.py migrate

I have a question about Django's migration feature when there is an existing table. ContentData ContentType Faq UserLog TB_TEAM_INF When I try to do "./manage.py migrate" so it can create the 5 tables above from models.py, I got an error message…
ronnefeldt
  • 2,083
  • 23
  • 24
8
votes
1 answer

What exactly does manage.py file do

I am very new to python/django programming, as in I have no programming background. I am working on a class online and I just would like to know exactly what the manage.py file does. I've tried googling it, but I have not found any answers other…
Audra
  • 93
  • 1
  • 2
  • 6
7
votes
3 answers

django-extensions - Get manage.py shell_plus to save history?

I'm using django-extensions shell_plus command, but it doesn't save the command history (i.e., ↑ does nothing). Any ideas how to fix this?
a paid nerd
  • 30,702
  • 30
  • 134
  • 179
7
votes
5 answers

Django migrations - django.db.migrations.exceptions.NodeNotFoundError

I get the following error when I run any python manage.py function: raise NodeNotFoundError(self.error_message, self.key, origin=self.origin) django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0010_user_following dependencies…
Jaacob
  • 101
  • 2
  • 8
7
votes
1 answer

Foreign key as required field on Django 1.5 configurable user model, createsuperuser says: AttributeError: 'NoneType' object has no attribute '_state'

Using the new Configurable user model from Django 1.5 (1, 5, 0, 'beta', 2) I get this error while running manage.py createsuperuser trying to set a foreign key of a required field: AttributeError: 'NoneType' object has no attribute '_state' Since…
chirale
  • 1,659
  • 16
  • 20
6
votes
2 answers

PyCharm manage.py runserver error

Sorry to ask a noob question but I have no idea why this is happening. I've just reinstalled Django 1.3, and am trying PyCharm for the first time. When I run python manage.py runserver from Terminal everything goes without a hitch, however if I try…
David John Smith
  • 1,824
  • 2
  • 18
  • 22
6
votes
3 answers

If multiple Django apps define the same custom management command, which is used?

The docs are silent on this questios. Will the commands be registered in order, with later apps (in settings.INSTALLED_APPS order) overriding previous commands (whether custom from other apps or the built-in Django commands)?
Ghopper21
  • 10,287
  • 10
  • 63
  • 92
1
2 3
13 14