A
A
Alexander2016-04-14 08:21:03
Django
Alexander, 2016-04-14 08:21:03

How to change url in admin panel?

how to remove products from url - a 127.0.0.1:8000/admin/products/product/add
What would be 127.0.0.1:8000/admin/product/add

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2016-04-21
@netpastor

By default, the URL is formed according to the scheme
{{ app_label }}_{{ model_name }}_add, i.e. you're trying to remove the application name
Alternatively, you can redefine the url, like
urlpatterns = [
url(r'^admin/product/add', redirect_view), # it's important to put it before the declaration of the admin urls
url(r'^admin/', admin. site.urls),
...
where in redirect_view to redirect to reverse('admin:products_product_add')
But it's not clear why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question