Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django manage.py do not show commands of an app

I'm using Django 1.4 and have a project similar to the following:

project/
    __init__.py
    app1/
        __init__.py
        models.py
        views.py
        management/
            __init__.py
            commands/
                __init__.py
                ...many commands...
        test/
            __init__.py
            ...many tests...
    app2/
        __init__.py
        models.py
        management/
            __init__.py
            commands/
                __init__.py
                ...many commands...
        test/
            __init__.py
            ...many tests...

where models.py of app2 is an empty file, and both app1 and app2 are listed in INSTALLED_APPS. The problem is that when i run

python manage.py --help

the commands of app1 appears as:

[app1]
command1
command2
...
commandsn

but not those of app2 as if there's no installed app2. And if try to run a command of app2 named app2command it complains Unknown command: 'app2command'. But the tests for both apps can be run, in particular

python manage.py test app2

goes good. Is the problem the fact that app2 has no models?

like image 438
se7entyse7en Avatar asked Oct 18 '25 13:10

se7entyse7en


1 Answers

I have just realized that I have a local settings which overrides INSTALLED_APPS. In settings.py the INSTALLED_APPS contains both app1 and app2 while in local settings app2 was not there.

like image 92
se7entyse7en Avatar answered Oct 20 '25 16:10

se7entyse7en



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!