[Answered ]-Regex validator produce migration without changes

1👍

As I found here https://code.djangoproject.com/ticket/25280#no1

A quick fix is to workaround this issue is just copy paste the code in django.core.validators:

from django.core.validators import RegexValidator
    
    url_regex_validator = [RegexValidator(
            regex=r'^(\w{1,5}:\/\/)([\w\+\/-]+)([\.]\w{1,4})$',
            message="Error invalid URL")]

class MyModel(models.Model):
    slug = models.SlugField(unique=True, validators=url_regex_validator)
👤Hamall

Leave a comment