#33207: django.apps.apps.get_model() does not allow namespaced (PEP 420) apps to
get a model
------------------------------+--------------------------------------
     Reporter:  Jonas L.      |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  Core (Other)  |                  Version:  3.2
     Severity:  Normal        |               Resolution:  invalid
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by Jonas L.):

 Oooh, first let me apologize for not noticing the different between an
 App.name and an App.label.

 I guess I could fix my issue by using a custom App.label, without dot.

 My app now looks like this:
 {{{
 from pathlib import Path

 from django.apps import AppConfig

 here = Path(__file__).parent


 class LibreTimeAPIConfig(AppConfig):
     name = "libretime.api"
     label = "libretime_api"
     path = here
     verbose_name = "LibreTime API"
     default_auto_field = "django.db.models.AutoField"

 }}}

 And it seem to be working.

 Sorry again for this new comer error.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33207#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.55c625355cde6c8f5338047037dc5ccc%40djangoproject.com.

Reply via email to