They’re not talking about the physical size of the text area.
If you define max_length
, that is the number of characters that the field in the browser will be initialized to accept. (Subject to being changed by JavaScript, malicious users, etc.) The point they’re making is that there’s no validation on the server side.
If you create a form with a TextField max_length of 50, and someone alters that field in their browser to allow for 500 characters - and sends 500 characters, your application is going to need to deal with a 500-character submission. (Or 500K, or 500M if the server will allow a POST that large.)
To some degree it depends upon the database and how Django builds the SQL to construct tables in that database.
For example, MariaDB defines a varchar as being up to 64K (65535) - VARCHAR — MariaDB Documentation
On the other hand, PostgreSQL says that there’s no performace difference between varchar(n)
and text
, so for that it wouldn’t matter. (See the Note section at PostgreSQL: Documentation: 14: 8.3. Character Types)