mirror of https://github.com/r4sas/py-i2phosts
Hidden Z
14 years ago
1 changed files with 21 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/python |
||||
|
||||
import os |
||||
import sys |
||||
|
||||
# django setup |
||||
DJANGO_SETTINGS_MODULE = 'settings' |
||||
DJANGO_PROJECT_PATH = 'web' |
||||
sys.path.insert(1, DJANGO_PROJECT_PATH) |
||||
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE |
||||
from web.postkey.models import i2phost |
||||
|
||||
# result hosts.txt |
||||
hostsfile = 'hosts.txt' |
||||
|
||||
f = open(hostsfile, 'w') |
||||
# select name and hash for all activated hosts |
||||
l = i2phost.objects.filter(activated=True).values('name', 'b64hash') |
||||
for entry in l: |
||||
f.write(entry['name'] + '=' + entry['b64hash']) |
||||
f.close() |
Loading…
Reference in new issue