Unable to graph_models when specifying apps

84 views
Skip to first unread message

Jameson Merkow

unread,
Feb 26, 2017, 2:01:06 PM2/26/17
to django-extensions
I am trying to graph models for selected apps with the following command: `./manage.py graph_models foo.bar > my_project.dot` , I get this error: `manage.py graph_models: error: unrecognized arguments: foo.bar
`.
I have also tried `./manage.py graph_models bar > my_project.dot`.  Same error.
Using --all-applications works fine, but this is not what I want.

My project layout has apps in a subdirectory (same as django cookiecutter):

foo
├── config
  ├── settings
    ├── common.py
    ├── local.py
    ├── production.py
   
...
...
├── foo
  ├── bar
    ├── apps.py
    ├── models.py
       
...
...


Apps are load via a config:
INSTALLED_APPS = [
...
'foo.bar.apps.BarConfig',
...
]

foo.bar.apps.BarConfig looks like:
class BarConfig(AppConfig):
    name
= 'foo.bar'
    verbose_name
= 'Bar'
    label
= 'bar'


Am I doing something wrong here?  Or is this a bug?

trbs

unread,
Feb 26, 2017, 2:09:15 PM2/26/17
to django-extensions
This works for me in Django Extensions:

$ ./manage.py graph_models bar

shows me the dot output.

If I give a wrong app name I get:

$ ./manage.py graph_models foo.bar
LookupError: No installed app with label 'foo.bar'.

The only way I get that particular error is to give wrong cli options:

$ ./manage.py graph_models -bar
manage.py graph_models: error: unrecognized arguments: -bar

Maybe somehow the command arguments given to graph_models are in error ?

Regards,
Trbs

Jameson Merkow

unread,
Feb 27, 2017, 3:18:07 PM2/27/17
to django-extensions
I have never gotten the 'no app installed' error. it is always an unrecognized arg error.
Reply all
Reply to author
Forward
0 new messages