In order to make it "work", I imported the models from foo_lib.django
app.models into foo_lib.models. Django was then able to find the
models, and create the migration files.

They are all in the wrong place however, that part of the library
should have nothing to do with django and so this obviously isn't
correct.

I didn't mention it in the first post, this is for
py{27,34,35,36}-dj{108,109,110,111,200}, and developing against
py36-dj200

Cheers

Tom

On Mon, Mar 19, 2018 at 3:35 PM, Tom Evans <tevans...@googlemail.com> wrote:
> Hi all
>
> I'm writing a small library which will be bundled together with a
> pluggable django app.
>
> The app provides a bunch of different AppConfig instances, the end
> user chooses one and pops it in their INSTALLED_APPS:
>
>   INSTALLED_APPS += [ 'foo_lib.contrib.django_app.configs.FooAppConfig', ]
>
> All the AppConfigs have their name attribute set to "foo_lib", they
> have their path attribute set to the directory containing models.py
> and there is a default AppConfig
>
> I have a test project that I'm using to run "makemigrations" and so
> on. With INSTALLED_APPS as above, django cannot find any changes for
> "foo_lib". If I supply the dotted path to the appconfig to
> "makemigrations", I am told:
>
>    "App 'foo_lib.contrib.django.configs.FooAppConfig' could not be
> found. Is it in INSTALLED_APPS?"
>
> which is quite amusing.
>
> If I replace the path to the appconfig with the dotted path to the
> module, and then use "makemigrations django_app", then the migrations
> get created, but obviously that seriously sucks.
>
> Furthermore, even with the migration files in place, they are not
> actually acted upon when running migrate or tests.
>
>
> What is the correct way to do this?
>
> Cheers
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1K3LbBjV%2BwbxdgKnTJj_nnGHHqkMNcRn2ROwVEXiaecgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to