pythondjangodjango-adminzinnia

Change zinnia app name to Blog Django admin


enter image description here

I am using zinnia to create a blog application in my website using django(1.6.5). But as in image my app name is showing as "Zinnia" in the django admin page which i would like to change as "Blog". Could some one explain me how i could do this


Solution

  • well you can try like:

    class Zinnia(models.Model):
            ....
        class Meta:
            app_label = 'Blog'
    

    update:

    well, from django source code: https://github.com/django/django/blob/731f313d604a6cc141f36d8a1ba9a75790c70154/django/contrib/admin/templates/admin/index.html#L15

    You can simply override django admin's index page to change app name in adminsite.(check: how to override admin template). Do this (templates/admin/index.html):

    {% if app_list %}
        {% for app in app_list %}
            <div class="app-{{ app.app_label }} module">
            <table>
            <caption>
                {% if app.name == 'Zinnia' %}
                <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the Blog application{% endblocktrans %}"> Blog </a>
            </caption>
            {% for model in app.models %}
    
     ....