16👍
According to the specific Django project structure (all applications are located in projectname/apps/
module) the full path including the project name should be used.
As the doc https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.name says:
AppConfig.name
Full Python path to the application, e.g. ‘django.contrib.admin’.
So it should be:
# articles/apps.py:
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ArticlesConfig(AppConfig):
name = 'projectname.apps.articles'
verbose_name = _(u'Articles')
and
# articles/__init__.py
default_app_config = 'projectname.apps.articles.apps.ArticlesConfig'
1👍
The name attribute in the app configuration should be same as what we give in the installed apps.
Also default_app_config
should give the correct path to your custom configuration like,
default_app_config = 'projectname.apps.articles.apps.ArticlesConfig
- Multiple database support in django
- Is there a Django ModelField that allows for multiple choices, aside from ManyToMany?
- Saving Base64ImageField Type using Django Rest saves it as Raw image. How do I convert it to a normal image
- Fatal error: libmemcached/memcached.h: no such file or directory
- ImportError: cannot import name 'Celery' from 'celery'
0👍
I think the problem could be focused in your articles/__init__.py file.
I mean… In the documentation says:
Of course, you can also tell your users to put ‘rock_n_roll.apps.RockNRollConfig’ in their INSTALLED_APPS setting.
You tried to delete the “default_app_config” statement and only getting your articles.apps.ArticlesConfig in your INSTALLED_APPS?
I say that because the docs says:
That will cause RockNRollConfig to be used when INSTALLED_APPS just contains ‘rock_n_roll’.
In the case to have a default_apps_config declared in articles/__init__.py, in your INSTALLED_APPS it’s only necessary:
INSTALLED_APPS = ( 'grappelli', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'grappelli.dashboard', 'mptt', 'sekizai', 'pytils', 'sorl.thumbnail', 'sefaro.apps.utils', 'sefaro.apps.seo', 'sefaro.apps.staticpages', 'sefaro.apps.statictext', 'sefaro.apps.usersettings', 'sefaro.apps.navigation', 'sefaro.apps.slideshow', 'articles', )
Maybe i’m wrong but I would try that 🙂 Tell me if you need more help.
- Django settings.cpython-36.pyc not ignored by gitignore
- Django, apache, mod_wsgi – Error: Premature end of script headers
- Create Read-Only MySQL Database Connection in Django
- Django: AttributeError: 'NoneType' object has no attribute 'split'