python - Allow greek characters in Django usernames -


i allow users register using greek characters.

i added in admin.py file following code. regular expression correct ( regex=r'^[\w\p{greek}-]+$',) ? allow greek , english characters

from django.contrib.auth.models import user django.contrib.auth.admin import useradmin django.contrib.auth.forms import usercreationform, userchangeform  class myusercreationform(usercreationform):   username = forms.regexfield(     label='username',     max_length=30,     regex=r'^[\w\p{greek}-]+$',     help_text = 'required. 30 characters or fewer. alphanumeric characters (letters, digits, hyphens , underscores).',     error_message = 'this value must contain letters, numbers, hyphens , underscores.')  class myuserchangeform(userchangeform):   username = forms.regexfield(     label='username',     max_length=30,     regex=r'^[\w\p{greek}-]+$',     help_text = 'required. 30 characters or fewer. alphanumeric characters (letters, digits, hyphens , underscores).',     error_message = 'this value must contain letters, numbers, hyphens , underscores.')  class myuseradmin(useradmin):   form = myuserchangeform   add_form = myusercreationform  admin.site.unregister(user) admin.site.register(user, myuseradmin) 


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -