title: Only allow letters, numbers, underscores or hyphens django
body: <p>I have a form that allows a user to register for my app using the UserModel . I'm trying to only allow  letters, numbers, underscores or hyphens in the username . I'm been trying to use validate_slug¶ but I don't understand how to use it probably to verify if the input submitted is only letters, numbers, underscores or hyphens otherwise raise an error.</p>
  
  <p>Can someone please help me</p>
  
  <pre><code>class UserRegistration(forms.Form):
      username = forms.CharField()
      email = forms.EmailField()
      password = forms.CharField(
          widget=forms.PasswordInput(render_value=False))
  
  
          def clean_username(self):
              username = self.cleaned_data['username']
  
                  if "@" in username:
                      raise forms.ValidationError("Sorry , you cannot use the symbol @")
                  return username
  </code></pre>