In this tutorial, I will list some important Django tips and tricks for developers. These tips will help you work faster and add interesting features that improve the overall look and feel of your project.
Add a Post Edit Button on the Posts Page that only appears to Admin or Staff
{% if user.is_staff or user.is_superuser %} <a href="{% url 'home' %}admin/app_name/model_name/{{ model_name.id }}/change/" class="btn btn-primary">Edit in Admin</a> {% endif %}
Replace the URL with the admin page post edit URL.
© 2024 Webapptiv. All rights reserved.