 <p>I think you cannot achieve this. Based on Django documentation it looks like use of binary fields is <a href="https://docs.djangoproject.com/en/dev/ref/models/fields/#binaryfield" rel="nofollow noreferrer">discouraged</a></p> <blockquote> <p>A field to store raw binary data. It only supports bytes assignment. Be aware that this field has limited functionality. For example, it is not possible to filter a queryset on a BinaryField value. It is also not possible to include a BinaryField in a ModelForm.</p> <p>Abusing BinaryField</p> <p>Although you might think about storing files in the database, consider that it is bad design in 99% of the cases. This field is not a replacement for proper static files handling.</p> </blockquote> <p>And based on a <a href="https://code.djangoproject.com/ticket/2495" rel="nofollow noreferrer">Django bug</a>, it is most likely impossible to achieve a <code>unique value</code> restriction on a binary field. This bug is marked as <code>wont-fix</code>. I am saying most likely impossible as I did not find evidence to confirm that binary field is stored as a <code>BLOB field</code> but the error does allude to it.</p> <blockquote> <p>Description </p> <p>When I used a field like this:<br> <code>text = models.TextField(maxlength=2048, unique=True)</code><br> it results in the following sql error when the admin app goes to make the table<br> <code>_mysql_exceptions.OperationalError: (1170, "BLOB/TEXT column 'text' used in key specification without a key length")</code><br> After a bit of investigation, it turns out that <code>mysql</code> refuses to use unique with the column unless it is only for an indexed part of the text field: </p> <pre><code>CREATE TABLE `quotes` ( \`id\` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `text` longtext NOT NULL , \`submitTS\` datetime NOT NULL, `submitIP` char(15) NOT NULL, `approved` bool NOT NULL, unique (text(1000)));</code></pre> <p>Of course 1000 is just an arbitrary number I chose, it happens to be the maximum my database would allow. Not entirely sure how this can be fixed, but I figured it was worth mentioning.</p> </blockquote>