title: Django ValueError: Field 'id' expected a number but got 'myuser'
body: <p>I need to use my usernames to <code>panel/profile/&lt;username&gt;</code> address. So what I did in <code>models</code> is:</p>
  <pre><code>class Customer(models.Model):
      user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE)
      first_name = models.CharField(max_length=30, null=True)
      last_name = models.CharField(max_length=30, null=True)
      
      def __str__(self):
          return str(self.user)
  </code></pre>
  <p>And in  <code>urls.py</code> I have these paths:</p>
  <pre><code>urlpatterns = [
      path('panel', views.home, name='panel'),
  
      path('panel/register', views.registerPage, name='register'),
      path('panel/login', views.loginPage, name='login'),
      path('panel/logout', views.logoutPage, name='logout'),
  
      path('dashboard', views.userProfile, name='dashboard'),
      path('dashboard/settings/edit-profile', views.userSettings, name='settings'),
  
      path('panel/profile/&lt;str:username&gt;', views.profile, name='profile'),
  ]
  </code></pre>
  <p>and in this way there is no problem:</p>
  <pre><code>&gt;&gt;&gt; customer=Customer.objects.get(user_id=118)
  &gt;&gt;&gt; customer.user.username
  'myuser'
  </code></pre>
  <p>But in <code>views.py</code> I need to grab username as a part of URL like that:</p>
  <pre><code>@login_required(login_url='login')
  @allowed_users(allowed_roles=['admins'])
  def profile(request, username):
      customer = Customer.objects.get(user=username)
      print(type(customer), customer)
  </code></pre>
  <p>But I have this error:</p>
  <pre><code>ValueError at /panel/profile/myuser
  Field 'id' expected a number but got 'myuser'.
  </code></pre>