How can I get second part URL to backend?

Hello I want to capture the second part of my URL and give that to the backend. I’m trying to query ‘codeIngang’ based on my URL and add +1 to ‘liveBezoekers’ of that row.


{% extends 'base/base.html' %}
{% load static %}

{% block maincontent %}
		<div class="container-login100" style="background-image: url('{% static 'main/images/bg-01.jpg' %}');">
			<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
				<form class="login100-form validate-form" method="GET" action="">
				{% csrf_token %}
					<div class="container-login100-form-btn">
						<div class="wrap-login100-form-btn">
							<div class="login100-form-bgbtn"></div>
							<button type="submit" class="login100-form-btn">
	{% endblock %}


class plusView(TemplateView):
    template_name = "plus.html"

    def post(self, request):
        logger = logging.getLogger(__name__)
        codeIngang = request.get["codeIngang"] #Grijp Code
        plusone = Plein.objects.filter(codeIngang = codeIngang).update(liveBezoekers= + 1)


from django.urls import path
from . import views

urlpatterns = [
    path('', views.loginPageView.as_view(), name="loginpage"),
    path('logout', views.logout_view, name="logout"),

    path('dashboardadmin/evenementaanmaken', views.evenementAanmakenView.as_view(), name="evenementaanmaken"),
    path('dashboardadmin/beheerderaanmaken', views.beheerderAanmakenView.as_view(), name="beheerderaanmaken"),
    path('dashboardbeheerder', views.dashboardBeheerderView.as_view(), name="dashboardbeheerder"),
    path('dashboarderbeheerder/pleinaanmaken', views.pleinAanmakenView.as_view(), name="pleinaanmaken"),

    path('plus/<str:codeIngang>', views.plusView.as_view(), name="plus"),
    path('min/<str:codeUitgang>', views.minView.as_view(), name="min" ),

Right now I’m getting no errors but it’s not doing what I want it to do, it just puts the MiddleWare token in the URL.

What am I doing wrong?

Your URL is defined as:

This means that the codeIngang part of the URL gets passed to the view as an argument, not within the GET object.

You can reference that variable through self.kwargs. See the examples in Dynamic Filtering in the Built-in class-based generic views page.