NoReverseMatch Reverse for 'profile_user' with arguments '()' and keyword arguments '{}' not found
<p>Views.py</p>

<pre><code>@login_required

def profile_edit(request):

    profile, created = UserProfile.objects.get_or_create(user=request.user)
    form = UserProfileForm(request.POST or None, request.FILES or None, instance=profile)
    if form.is_valid():
        instance = form.save(commit=False)
        instance.user = request.user
        instance.save()
        return redirect('profile_user')

    context = {
        "title": 'Edit Profile',
        "form":form,
    }
    return render(request, 'profiles/userprofile_form.html', context)
</code></pre>

<p>main url there is no name space given and profile url is as follows. </p>

<pre><code>url(r'^profile/(?P&lt;username&gt;[\w.@+-]+)$', profile_view, name='profile_user'),
</code></pre>

<p>Could anybody help to solve this please?</p>

<p>Your URL requires a named argument <code>username</code>. You have to give it to <code>redirect()</code> as keyword argument. Example:</p>

<pre><code>redirect('view-name', username='joe')
</code></pre>

python django