S
S
Stanislav2021-02-02 15:09:20
Django
Stanislav, 2021-02-02 15:09:20

How to change app name in Django?

I'm trying to change the name of the Comment application in django, but I'm getting an error

ModuleNotFoundError: No module named 'comment'
Cannot import 'comment'. Check that 'apps.comment.apps.CommentConfig.name' is correct.

Applications are stored in the apps folder
project
    apps
        comment
        ...
    project
        settings.py
    static
    templates


#project/project/settings.py
INSTALLED_APPS = [
    'apps.comment.apps.CommentConfig',
    ...

]

#project/apps/comment/apps.py
from django.apps import AppConfig
class CommentConfig(AppConfig):
    name = 'comment'
    verbose_name = 'Комментарии'

Tried to connect via project/apps/comment/__init__.py. The result is the same.
default_app_config = 'apps.comment.apps.CommentConfig'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question