Skip to content

Instantly share code, notes, and snippets.

@rachelannelise
Last active July 13, 2017 21:08
Show Gist options
  • Save rachelannelise/6ff07c2abf3a4f307e4409382e267f62 to your computer and use it in GitHub Desktop.
Save rachelannelise/6ff07c2abf3a4f307e4409382e267f62 to your computer and use it in GitHub Desktop.
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.conf import settings
from django.db import IntegrityError
from account.models import ParselyAPIKey, Publisher
# get list of API keys
keys = Publisher.objects.get(id=3624).apikeys.all()
#tlds to add
tlds = "at40.com\nradiobigboy.com\nhannity.com\nonairwithryan.com\nsteveharvey.com\nbrookeandjubalradio.com\niheartradiocountdown.com\nkeephopealiveradio.com"
for apikey in keys:
print apikey
apikey = ParselyAPIKey.objects.get(key=apikey)
apikey.allowed_tlds = tlds
apikey.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment