Created
May 25, 2013 11:41
-
-
Save wolfg1969/5648807 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core import serializers | |
from myproject.myapp import models | |
data = serializers.serialize("json", models.MyModel.objects.all()) | |
out = open("mymodel.json", "w") | |
out.write(data) | |
out.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment