Question

I have a problem when trying to create migrations. manage.py behave in a very weird way - it takes arguments which are given for schemamigration and answers that I provided non-existing option.

When I run

# ../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 for example

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

I have done the same many times before and I have never had any problem like this. It has worked on my local server and when I was trying to configure remote server, I had got 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 it should not cause any problems(It has worked a few times before). I think the problem is somewhere else. Any ideas what can cause such a weird problem?

Was it helpful?

Solution

I don't know why but it turned out the problem was in using django-configurations in version 0.2.

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

OTHER TIPS

I've attempted a fix for this. See the Github issue, https://github.com/jezdez/django-configurations/issues/21

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top