title: NoReverseMatch Error Reverse for 'profile' with no arguments not found
body: <p>Please somebody anybody help please, know that these question has been answered a lot of times but am new to django and don't know how to get around this in my code. Am following a tutorial and that builds a vlog with django. Everythin works fine but then i wanted to modify it and dispaly the posts written by a user aon their profile page so that others can see it. i passed a variable to the original url that lead to the page and then also modify my views that only rendered a html template to include posts from the user. it works the post are listed the way i want but after i go to the update profile page and update on submit the button that was supposed to redirect to the profile page returns an error</p>
  <pre><code>NoReverseMatch at /update_profile/
  Reverse for 'profile' with no arguments not found. 1 pattern(s) tried: ['profile/(?P&lt;username&gt;[^/]+)/$']
  </code></pre>
  <p>My urls.py file</p>
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  from django.conf import settings
  from django.conf.urls.static import static
  from django.contrib.auth import views as auth_views
  from users import views as user_views
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('register/', user_views.register, name='register'),
      path('profile/&lt;str:username&gt;/', user_views.profile, name = 'profile'),
      path('update_profile/', user_views.update_profile, name='update_profile'),
      path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'),
      path('logout/', auth_views.LogoutView.as_view(template_name='users/logout.html'), name='logout'),
      path('', include('blog.urls')),
  ]
  
  if settings.DEBUG:
      urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  
  </code></pre>
  <p>this is my views.py file</p>
  <pre><code>from django.urls import reverse
  from django.contrib.auth.decorators import login_required
  from django.contrib import messages
  from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
  from blog.models import Post
  
  def register(request):
      if request.method == 'POST':
          form = UserRegisterForm(request.POST, request.FILES)
          if form.is_valid():
              form.save()
              username = form.cleaned_data.get('username')
              messages.success(request, f'{username} Your account has been created! Login to verify your account')
              return redirect('login')
      else:
          form = UserRegisterForm()
      return render(request, 'users/register.html', {'form': form})
  
  @login_required
  def profile(request, username):
      user_posts = Post.objects.filter(author=request.user).order_by('-date_posted')
      context = {
          'user_posts': user_posts
      }
      return render(request, 'users/profile.html', context)
  
  def update_profile(request):
      if request.method == 'POST':
  
          u_form = UserUpdateForm(request.POST, instance=request.user)
          p_form = ProfileUpdateForm(request.POST, request.FILES,
          instance=request.user)
          if u_form.is_valid() and p_form.is_valid():
              u_form.save()
              p_form.save()
              messages.success(request, f'Your account has been updated')
              return redirect('profile')
      else:
          u_form = UserUpdateForm(instance=request.user)
          p_form = ProfileUpdateForm(instance=request.user.profile)
  
      context = {
          'u_form': u_form,
          'p_form': p_form
      }
      return render(request, 'users/update_profile.html', context)
  </code></pre>
  <p>my models.py</p>
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from PIL import Image
  
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      image = models.ImageField(default='default.png', upload_to='profile_pics')
      bio = models.TextField(max_length=500, blank=True)
  
      def __str__(self):
          return f'{self.user.username} Profile'
      
      def save(self, *args, **kwargs):
          super().save(*args, **kwargs)
  
          img = Image.open(self.image.path)
          if img.height &gt; 300 or img.width &gt; 300:
              output_size = (300, 300)
              img.thumbnail(output_size)
              img.save(self.image.path)
  
  </code></pre>
  <p>i have two apps users and blogs if there is anything more you need please let me know.
  I also want to make it so that the profile can be viewed by anonymous users</p>