# THIRD PARTY
from djangae.fields import CharField
from django.db import models


class Secret(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    url_slug = CharField(primary_key=True)
    secret = CharField()

    class Meta(object):
        ordering = ('-created',)

    def __unicode__(self):
        return self.url_slug

    def clean(self, *args, **kwargs):
        return_value = super(Secret, self).clean(*args, **kwargs)
        if not self.secret.startswith(self.url_slug):
            raise ValidationError("The URL slug and the beginning of the secret should be the same.")

@@ -379,16 +379,168 @@
 wargs):%0A
+        %22%22%22 Check that the secret starts with the URL slug plus a dot, as that's the format that%0A            Let's Encrypt creates them in.%0A        %22%22%22%0A
         
@@ -648,16 +648,22 @@
 url_slug
+ + %22.%22
 ):%0A     

Make sure that there's a dot separating the first and second halves of the secret.