I believe that using a variable is not particularly unclean. But you can βabuseβ the fact that the default argument, which supports all fields, can be called.
So you could have this βcrazyβ thing:
def get_default_json(): json_text = open('mylargevalue.json').read() return json_text
and then in the field:
schema = models.TextField(default=get_default_json)
I have not tried anything like this, but I guess it might work.
source share