0

I have a django 2.0.6 project running on python 3.6. I'd like to create a manage.py command that seeds the project database with initial data using faker and factory_boy. I have the subcommand working and printing to stdout. When I try to import the models I get the following error

RuntimeError: Model class cb3p.events.model_utils.Link doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

The models are fine, however: python manage.py makemigrations works, the app works.

Moving the models into the same app as the project doesn't help. Stripping the models down to the point where they only contain a single table with 1 field doesn't help. Moving the import inside the commands handle method doesn't help.

mrehan
  • 1,122
  • 9
  • 18

1 Answers1

0

Oops, looks like I figured it out. When you have a command that accesses an app it looks like it needs to extend AppCommand