How to change app name in Django admin?

后端 未结 8 1955
小鲜肉
小鲜肉 2020-12-14 08:03

I created \'frontend\' application using ./manage.py startproject frontend

But for some reason I just want to change the app name in the Dj

8条回答
  •  春和景丽
    2020-12-14 08:51

    In stars/app.py

    from django.apps import AppConfig
    
    
    class RequestsConfig(AppConfig):
        name = 'stars'
        verbose_name = "Star of India"
    

    in stars/init.py

    default_app_config = 'stars.apps.RequestsConfig'
    

    To access the app name in custom menu methods you can try to get that from

    model._meta.app_config.verbose_name
    

    Check the Django Doc for reference https://docs.djangoproject.com/en/1.11/ref/applications/#for-application-users

提交回复
热议问题