I have problem with passing an argument from url to my view.
url:
from ProjectName import settings
from django.conf.urls import url, include
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
import ProjectName.views as views
from register import views as registerViews
from profile import views as profileViews
from login import views as loginViews
from user import views as userViews
from django.contrib.flatpages import views as flatPageViews
urlpatterns = i18n_patterns(
url(r'^user/area/decline/(?P<id>\d+)/$', userViews.DeclineUser, name='decline_user'),
.
.
)
view:
@login_required
def DeclineUser(request, id):
print("Here: " + id)
And I get the following error:
TypeError at /en/user/area/decline/48136796350054996/
DeclineUser() got an unexpected keyword argument 'id'
I search many related problems but all of them their function argument name didn't match the url argument, which in my case does!