0

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

itsme
  • 140
  • 1
  • 11

2 Answers2

1

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 %}

 ....
Community
  • 1
  • 1
ruddra
  • 50,746
  • 7
  • 78
  • 101
  • zinnia.entry: 'categories' has an m2m relation with model zinnia.Category, which has either not been installed or is abstract. – itsme Sep 26 '14 at 07:18
  • well you have to use syncdb(if you don't have database or drop database and recreate) or migrate(if have an existing database and don't want to drop it, and have to south in that case: http://south.aeracode.org/) to solve this issue :) – ruddra Sep 26 '14 at 08:07
  • First of all zinnia is not a model. its a project. http://django-blog-zinnia.com/. – itsme Sep 26 '14 at 09:43
  • @itsme well, I have updated my answer. hope this helps – ruddra Sep 26 '14 at 11:17
  • Thanks for your help, But it changes only the dashboard right?. :) – itsme Oct 07 '14 at 05:36
0

Well you can read what is app name and how to give app_label

You have to change the model.py yourself for what you want to achieve. I assume that your zinna app located in site-packages.

i.e, see this link django-blog-zinna

app_label = 'Blog'

And edit yourself, i havn't checked that but it may encounter error and you have to clear yourself

Raja Simon
  • 10,126
  • 5
  • 43
  • 74