title: How to use characters like . in username slug in Django 2.1?
body: <p>I am creating a simple web app. The user suppose to signup and can see their profile. The signup form is working fine and the user can signup perfectly.</p>
  
  <p>In the forms.py I have function to raise validation error when the user signup with an existing username. Here is the problem. If there is an username types for example - 'userone' , and another user types 'user.one' it saves the new user with 'user.one'. But when the user wants to go to their profile, the problem arises in the URL. Because I am using username as slug, the dot(.) is not present in the URL which leads to the problem.</p>
  
  <p>I have tried with <code>re_path</code> as mentioned in the Django document, but still getting errors.</p>
  
  <p>forms.py to check unique username</p>
  
  <pre><code>    def clean_username(self):
      username = self.cleaned_data.get('username')
      email = self.cleaned_data.get('email')
  
      if username and User.objects.filter(username=username).exclude(email=email).count():
          raise forms.ValidationError('This username already exists')
      return username
  </code></pre>
  
  <p>views.py (signup class)</p>
  
  <pre><code>class SignupView(View):
  form_class = SignupForm
  template_name = 'webapp/user_signup.html'
  
  def get(self, request):
      form = self.form_class(None)
      return render(request, self.template_name, {'form':form})
  
  def post(self, request):
      form = self.form_class(request.POST)
  
      if form.is_valid():
          user = form.save(commit=False)
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          user.set_password(password)
          user.save()
  
  
          user = authenticate(username=username, password=password)
  
          if user is not None:
              if user.is_active:
                  login(request, user)
                  return redirect('webapp:home')
  </code></pre>
  
  <p>views.py (for profile class)</p>
  
  <pre><code>class ProfileView(generic.DetailView):
  model = User
  slug_field = 'username'
  template_name = 'webapp/user_profile.html'
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>urlpatterns = [
  # user signup link
  path('user/signup/', views.SignupView.as_view(), name='signup'),
  
  . . . .. . . .. . . .. 
  
  # user profile view
  path('user/&lt;slug:slug&gt;/', views.ProfileView.as_view(), name='user_profile'),
  
  ]
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;a href="{% url 'webapp:user_profile' article.user.username %}"&gt;{{article.user.first_name}} {{article.user.last_name}}&lt;/a&gt;
  </code></pre>
  
  <p>What should be a perfect approach for this? </p>