Created
February 3, 2012 23:05
-
-
Save conniec/1733551 to your computer and use it in GitHub Desktop.
add sites to a custom domain
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 lfcore.domain.api import DomainAPI | |
#Change the subdomain name and filename of sites | |
#Filename of sites should be list of sites, one on each line | |
subdomain = 'fisher-1' | |
sitefile = open("/tmp/list.txt", 'r') | |
d = Domain.objects.get(name='rooms.%s.fyre.co' % subdomain) | |
print "Domain: "+str(d) | |
print "Subdomain: "+subdomain+'\n' | |
url = sitefile.readline().rstrip('\n') | |
i = 0 | |
while url: | |
print 'Adding site... '+url | |
url = sitefile.readline().rstrip('\n') | |
s = DomainAPI.create_site(Site(url = url, domain = d, owner = d.owner)) | |
print "\nCreated site, URL: %s\n site id: %s\n site key: %s\n" % (s.url, s.id, s.api_secret) | |
i += 1 | |
print "\n Total sites: "+str(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment