Manage.py does not pass an argument to the command

I have a problem while trying to create a migration. manage.py behaves very strangely - it accepts the arguments that are given for the schema and the answers that I provided a nonexistent option.

When i started

# ../manage.py schemamigration locations --initial 

I get

 Usage: manage.py [options] manage.py: error: no such option: --initial 

EDIT: I get the same problem when I pass any argument to any manage.py command, e.g.

 ../manage.py runserver --settings=app.settings 

I have done the same thing many times before, and I have never had such problems. It worked on my local server, and when I tried to configure the remote server, I had this problem.

My manage.py file looks like this:

 #!/usr/bin/env python import os import sys def isProduction(): import socket if socket.gethostname().startswith('ip'): return True return False if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings") if isProduction(): os.environ.setdefault('DJANGO_CONFIGURATION', 'ProdSettings') else: os.environ.setdefault('DJANGO_CONFIGURATION', 'DevSettings') from configurations.management import execute_from_command_line execute_from_command_line(sys.argv) 

I use django configurations, but this should not cause any problems (it worked several times before). I think the problem is elsewhere. Any ideas what might cause such a weird problem?

+4
source share
2 answers

I don’t know why, but it turned out that the problem was using django configurations in version 0.2.

Switching from Django to 1.4.2 and with django configurations in 0.1 solved this problem.

+1
source

I tried to fix it. See the Github Question, https://github.com/jezdez/django-configurations/issues/21

0
source

All Articles