Validator phone number with RegexValidator?

Trying to do validation of input for the phone number using the RegexValidator.
in the model the user has prescribed the following:
phone_regex = RegexValidator(
 regex=r'^\+?1?\d{9,15}$', 
 message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed."
)
 phone = models.CharField(validators=[phone_regex], max_length=17, blank=True)

when entering ugly numbers in input, the data is stored, fine, but
Expect that when you enter in the input letters will leave that in the message.
What can be connected, can this variable where it is most necessary to withdraw?
June 8th 19 at 16:32
1 answer
June 8th 19 at 16:34
Solution
cap - martina commented on June 8th 19 at 16:37
to see what differs your code from the first example in Manet
Think
Rewrite your - marilyne_Roh commented on June 8th 19 at 16:40
, cap[2] - martina commented on June 8th 19 at 16:43
, ? - marilyne_Roh commented on June 8th 19 at 16:46
as You told me, you can 90% of users here to answer, throw a link to the docks and say, read, think - decide.
fair? true. - martina commented on June 8th 19 at 16:49
you difficult to copy the code from mana
Replace the text errors on your
Replace the regular season on their
I understand you correctly? - marilyne_Roh commented on June 8th 19 at 16:52
Understood, sorry, I just don't know how to think - martina commented on June 8th 19 at 16:55

Find more questions by tags PythonDjango