I have a frontend that will be sending bas64 images, I will put those very large strings on a variable and send it to a form. What kind of FormField
can I use?
The regular CharFields
need a max_length
. Since it is a very large string, I don't know the length it could have.
CharField since CharField has a max length of 255 characters while TextField can hold more than 255 characters.
TextField can contain more than 255 characters, but CharField is used to store shorter length of strings. When you want to store long text, use TextField, or when you want shorter strings then CharField is useful.
CharField is a string field, for small- to large-sized strings. It is like a string field in C/C+++. CharField is generally used for storing small strings like first name, last name, etc. To store larger text TextField is used. The default form widget for this field is TextInput.
CharField is a commonly-defined field used as an attribute to reference a text-based database column when defining Model classes with the Django ORM. The Django project has wonderful documentation for CharField and all of the other column fields.
Maybe TextField could be the right choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With