Last active
July 13, 2017 21:08
-
-
Save rachelannelise/6ff07c2abf3a4f307e4409382e267f62 to your computer and use it in GitHub Desktop.
This file contains 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
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