# NoReverseMatch: Reverse for 'custom-model-add' with keyword arguments '{'model\_name': ''}' not found. 1 pattern(s) tried: \['ekle/(?P\<model\_name\>\[^/\]+)/\\\\Z'\]

**URL:** <https://forum.djangoproject.com/t/noreversematch-reverse-for-custom-model-add-with-keyword-arguments-model-name-not-found-1-pattern-s-tried-ekle-p-model-name-z/39934>\
**Category:** The Admin\
**Created:** [March 27, 2025, 8:39am UTC](https://forum.djangoproject.com/t/noreversematch-reverse-for-custom-model-add-with-keyword-arguments-model-name-not-found-1-pattern-s-tried-ekle-p-model-name-z/39934 "2025-03-27T08:39:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EnisDBZ](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/enisdbz/32/27775_2.png) [@EnisDBZ](https://forum.djangoproject.com/u/EnisDBZ)\
**Post date:** [March 27, 2025, 8:39am UTC](https://forum.djangoproject.com/t/noreversematch-reverse-for-custom-model-add-with-keyword-arguments-model-name-not-found-1-pattern-s-tried-ekle-p-model-name-z/39934/1 "2025-03-27T08:39:01Z")

</div>

I’m trying to creating my own custom-admin-panel for my website. I was trying to add an add button to my models but i am keep getting the same error as the topics title. Here are my views codes:

```auto
def dynamic_model_item_add(request, model_name):
  
    
    model_objects = model.objects.all()
    verbose_name = model._meta.verbose_name_plural
    model = apps.get_model("intern_app", model_name)
    if not model:
        raise Http404("Böyle bir model bulunamadı.")

    ModelForm = modelform_factory(model, fields=" __all__")

    if request.method == "POST":
        form = ModelForm(request.POST, request.FILES)
        if form.is_valid():
            form.save()
            return redirect(reverse("custom-model-add", args=[model_name])) # Başarıyla eklenince aynı sayfaya dön
    else:
        form = ModelForm()
    
    context = {
        "model_objects": model_objects,
        "model": model,
        "verbose_name": verbose_name,
        "model_name": model._meta.model_name,  
        "form": form, 
        "model_name": model_name,
    }

    return render(request, "intern_app/custom_admin_add_item.html",context)

```

My URLs:

```auto
path("yonetici-paneli/",custom_admin.admin_links,name="yonetici-paneli"),
    path("yonetici-paneli/<str:app_label>/<str:model_name>/",custom_admin.admin_links_pages,name = "yonetici_paneli_sayfa"),

    path("ekle/<str:model_name>/", custom_admin.dynamic_model_item_add, name="custom-model-add"),

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 27, 2025, 11:39am UTC](https://forum.djangoproject.com/t/noreversematch-reverse-for-custom-model-add-with-keyword-arguments-model-name-not-found-1-pattern-s-tried-ekle-p-model-name-z/39934/2 "2025-03-27T11:39:51Z")

</div>

Welcome @EnisDBZ !

Side Note: When posting code here, enclose the code between lines of three  
backtick - ` characters. This means you’ll have a line of ```, then your code,  
then another line of ```. This forces the forum software to keep your code  
properly formatted. (I have taken the liberty of correcting your original posts.  
Please remember to do this in the future.)

Also, when requesting help with an error, please do not post the error as the title. Post the full error (with the traceback if any) in the body of the post. Use the title as a short summary of the error.

This error is usually telling you that the parameter you are trying to use with that url is null.

We’d need to see more details about where and how this error is being generated. Please post the _complete_ error with the traceback as shown in the console screen. (Do not post a screenshot of the web page with the error.)

---

<div class="post-metadata">

**Author:** ![EnisDBZ](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/enisdbz/32/27775_2.png) [@EnisDBZ](https://forum.djangoproject.com/u/EnisDBZ)\
**Post date:** [March 27, 2025, 12:46pm UTC](https://forum.djangoproject.com/t/noreversematch-reverse-for-custom-model-add-with-keyword-arguments-model-name-not-found-1-pattern-s-tried-ekle-p-model-name-z/39934/3 "2025-03-27T12:46:55Z")

</div>

Thanks for giving your time to me. I figure out the problem. I was forgetting to add app\_label and model\_name to two different functions. That was the problem lol.
