Skip to content Skip to sidebar Skip to footer

Django Accepts An Integer Into A Charfield

I am learning django and created a Page form class like so: from django import forms class Page(forms.Form): title = forms.CharField(max_length = 200, min_length = 10) bo

Solution 1:

There is no field type that will validate that kind of data.

You can easily validate the data enter by users using regular Expressions on backend or the frontend.

exp = '[\w\s]+'

This will only accept words and whitespaces which is perfect for author name

https://regexr.com/ use this site to make your regular expression.

Post a Comment for "Django Accepts An Integer Into A Charfield"