I just researched my \"bug\" and it turned out to be a new feature in Django 1.9 that CharFields strip spaces by default : https://docs.djangoproject.com/en/1.9/ref/forms/fi
I was having this issue with django-rest model serializer. The data in my text field was stripped of white space. So if you are trying to do this on the serializer level, you can specify the whitespace param on CharField serializer. Here is the source code signature.
And here is the rest-docs on CharField
class SomeSerializer(serializers.ModelSerializer):
content = serializers.CharField(trim_whitespace=False)
class Meta:
model = YourModel
fields = ["content"]