Skip to content

Instantly share code, notes, and snippets.

@yyolk
Last active December 22, 2015 20:59
Show Gist options
  • Save yyolk/6530708 to your computer and use it in GitHub Desktop.
Save yyolk/6530708 to your computer and use it in GitHub Desktop.
import keywords
# ./manage.py shell
from museum.models import Keyword
keys = file('keywords.txt', 'r').readlines()
for key in keys:
k = Keyword(keyword=key.strip())
k.save()
print '%s saved as %s' % (key.strip(), k.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment