Re: [Django] #32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig on custom admin setup

2021-06-03 Thread Django
#32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig 
on
custom admin setup
---+--
 Reporter:  Ron|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  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 Simon Meers):

 I was able to reproduce this by using an `apps.py` module inside an
 **app** instead of the **project** -- I initially missed the
 `myproject/apps.py` in the docs and assumed it belonged in `myapp/apps.py`
 which generates the `declares more than one default AppConfig`
 `RuntimeError`.

-- 
Ticket URL: 
Django 
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.e8b16f38bae40ab31a9c585eb59ccf6d%40djangoproject.com.


Re: [Django] #32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig on custom admin setup

2021-06-02 Thread Django
#32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig 
on
custom admin setup
---+--
 Reporter:  Ron|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  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
---+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 The current docs works for me.

-- 
Ticket URL: 
Django 
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.2c948db85f52230111eddb69b1036370%40djangoproject.com.


Re: [Django] #32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig on custom admin setup

2021-06-02 Thread Django
#32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig 
on
custom admin setup
---+--
 Reporter:  Ron|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  3.2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Julien Chiron):

 * cc: Julien Chiron (added)
 * status:  closed => new
 * resolution:  invalid =>


Comment:

 Having encountered the same kind of issue while implemeting site-wide
 custom AdminSite, I found a workaround to make it work.
 It seems the documentation should be updated accordingly.

 {{{
 from django.contrib.admin.apps import AdminConfig

 class MyAdminConfig(AdminConfig):
 default_site = 'myproject.admin.MyAdminSite'
 }}}

 This raises an exception:

 {{{RuntimeError: 'myproject.apps' declares more than one default
 AppConfig: 'AdminConfig', 'MyAdminConfig'.}}}

 It is solved by importing django.contrib.admin.apps instead of
 django.contrib.admin.apps.AdminConfig:

 {{{
 from django.contrib.admin import apps

 class MyAdminConfig(apps.AdminConfig):
 default_site = 'myproject.admin.MyAdminSite'
 }}}

 Then the exception moves on:

 {{{django.core.exceptions.ImproperlyConfigured: Application labels aren't
 unique, duplicates: admin}}}

 This is caused by the settings.py configuration:

 {{{
 INSTALLED_APPS = [
 'myproject.apps.MyAdminConfig',  #replaces django.contrib.admin
...
 }}}

 It is solved by removing the 'MyAdminConfig' from the settings:

 {{{
 INSTALLED_APPS = [
 'myproject.apps', #replaces django.contrib.admin
...
 }}}

-- 
Ticket URL: 
Django 
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.679113b3c271540ce15ad2f0c0e357d2%40djangoproject.com.


Re: [Django] #32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig on custom admin setup

2021-04-13 Thread Django
#32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig 
on
custom admin setup
---+--
 Reporter:  Ron|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  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
---+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 As far as I'm aware it's not a bug in Django. First of all you should
 customize a default admin site inside a main project directory (like
 described in the documentation) not in an app, secondly `INSTALLED_APPS`
 must point to
 [https://docs.djangoproject.com/en/3.2/ref/applications/#troubleshooting
 the config].

-- 
Ticket URL: 
Django 
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.9efb4ed61cfa867a757e372fb024bbc6%40djangoproject.com.


[Django] #32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig on custom admin setup

2021-04-13 Thread Django
#32642: RuntimeError: 'apps.core.apps' declares more than one default AppConfig 
on
custom admin setup
-+
   Reporter:  Ron|  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  contrib.admin  |Version:  3.2
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 Hi!

 I just migrated my project to django 3.2 and I get the following error:

 > RuntimeError: 'apps.core.apps' declares more than one default AppConfig:
 'AdminConfig', 'CustomAdminConfig'.

 Here is my apps.py:


 {{{
 from django.contrib.admin.apps import AdminConfig

 class CustomAdminConfig(AdminConfig):
 default_site = 'apps.core.admin.site.CustomAdminSite'
 }}}

 To narrow down the bug I renamed the import:

 {{{
 from django.contrib.admin.apps import AdminConfig as XAdminConfig

 class CustomAdminConfig(XAdminConfig):
 default_site = 'apps.core.admin.site.CustomAdminSite'
 }}}

 Then the error changes to:

 > RuntimeError: 'apps.core.apps' declares more than one default AppConfig:
 'XAdminConfig', 'CustomAdminConfig'.

 So I guess the new apps autoloader is following the import statement.

 I looked at the docs
 (https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#overriding-the-
 default-admin-site) but the described way seems like the stuff I did.

 I honestly hope, I'm not making any stupid mistakes here.

 Best regards and thx!
 Ronny

-- 
Ticket URL: 
Django 
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/049.68805821a54256cbce95e34905219657%40djangoproject.com.