oscarmlage / django-cruds-adminlte

django-cruds is simple drop-in django app that creates CRUD for faster prototyping
BSD 3-Clause "New" or "Revised" License
425 stars 82 forks source link

Sidebar models not loading #45

Closed tanasecucliciu closed 6 years ago

tanasecucliciu commented 6 years ago

Hello,

Let me preface this by saying that I'm relatively new to web development & Django. I'm not sure but I presume the menu sidebar should generate buttons for all my models. I think this behaviour should just work out of the box after installation based on this bit of code from the default sidebar.html:

{% for model in models %}
                <li>
                    <a href="{% url model.url %}">
                        <i class="fa fa-dashboard"></i> <span>{{ model.plural }}</span>
                    </a>
                </li>
{% endfor %}

Needless to say, it doesn't do anything and for the life of me, I can't seem to figure out why.

My project follows this template.

If you guys can point me in the right direction I would really appreciate it.

Thank you!

oscarmlage commented 6 years ago

@tanasecucliciu you need to pass your app/project through our urls functions (crud_for_model or crud_for_app) in your urls.py, i.e.:

urlpatterns+= crud_for_app('testapp', check_perms=True)

Take a look to the demo/testapp code in the repo and the docs. Hope it helps.