-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added project dump, cleaned settings and readme
- Loading branch information
1 parent
11465b1
commit 0913506
Showing
8 changed files
with
126 additions
and
34 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"projects": {"SSOP": {"id": "13", "name": "SSOP", "organization": "GSL", "verbose_name": "View your user attributes", "return_to": "https://gsl.noaa.gov/ssop/ldg_authenticated", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "w9zj2cZFQz_64TQNbSEb", "decrypt_key": "nz5TJfKciudwCA", "updated": "2023-01-25 18:28:12.287361+00:00", "updater": "None", "enabled": "True", "expiretokens": "True", "display_order": "1", "graphnode": "None"}, "demopy": {"id": "14", "name": "demopy", "organization": "GSL -- ITS", "verbose_name": "A demonstration view using python", "return_to": "https://gsl.noaa.gov/ssop/demopy", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "vcxbVLKa4Nh8C-feYdyz", "decrypt_key": "VZeiN2uIV4b7Vg", "updated": "2023-01-25 19:39:25.727485+00:00", "updater": "None", "enabled": "True", "expiretokens": "True", "display_order": "2", "graphnode": "None"}, "demoajax": {"id": "15", "name": "demoajax", "organization": "GSL -- ITS", "verbose_name": "A demonstration using AJAX", "return_to": "https://gsl.noaa.gov/ssop/examples/demoajax.html", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "2J-Rhl6R3Ppd_xY-lHwp", "decrypt_key": "vkc3O_Gk9NrG3g", "updated": "2023-01-25 19:39:25.743015+00:00", "updater": "None", "enabled": "True", "expiretokens": "True", "display_order": "3", "graphnode": "None"}, "firewxtb": {"id": "16", "name": "firewxtb", "organization": "GSL -- WIDS", "verbose_name": "Fire Weather Testbed", "return_to": "https://gsl.noaa.gov/ssop/firewxtb", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/firewxtboops", "state": "ilv1Vz5sO47vtamdfQ-K", "decrypt_key": "yeS-0X1EoJtVFg", "updated": "2023-01-25 19:39:25.756142+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "4", "graphnode": "None"}, "nvods": {"id": "17", "name": "nvods", "organization": "PMEL", "verbose_name": "National Virtual Ocean Data System (NVDOS)", "return_to": "https://data.pmel.noaa.gov/nvods/las/", "queryparam": "False", "error_redirect": "https://data.pmel.noaa.gov/nvods/ssopoops", "state": "c5HmuyHETJ_wwJp_MnKM", "decrypt_key": "MhqyX0xuYToIKQ", "updated": "2023-01-25 19:39:25.769755+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "5", "graphnode": "None"}, "desi": {"id": "18", "name": "desi", "organization": "GSL -- WIDS - WIZARD", "verbose_name": "Dynamic Ensemble-based Scenarios for IDSS", "return_to": "https://sites.gsl.noaa.gov/desi/", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "iiW7lDEgBF2KFDUEeGSm", "decrypt_key": "WvpDKlnPgnFtCA", "updated": "2023-01-25 19:39:25.782753+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "6", "graphnode": "None"}, "awspub": {"id": "19", "name": "awspub", "organization": "GSL -- WIDS - WIZARD", "verbose_name": "GSL AWS Public Nginx", "return_to": "https://sites.gsl.noaa.gov/test-js2/", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "cIYURPoPRskxQeGoASCh", "decrypt_key": "sfXynjgjQGhFlw", "updated": "2023-01-25 19:39:25.795706+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "7", "graphnode": "None"}, "int-mats": {"id": "20", "name": "int-mats", "organization": "GSL -- ASCEND", "verbose_name": "INTEGRATION Model Analysis Tool Suite (MATS)", "return_to": "https://esrl.noaa.gov/gsd/int-mats/", "queryparam": "False", "error_redirect": "https://esrl.noaa.gov/gsd/int-mats/ssopoops", "state": "i5EA3hjEyYFrUOTuyaDc", "decrypt_key": "yP24Bc-Nq4gORQ", "updated": "2023-01-25 19:39:25.808460+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "8", "graphnode": "None"}, "rr": {"id": "21", "name": "rr", "organization": "GSL -- ASCEND", "verbose_name": "Rapid Refresh", "return_to": "https://rapidrefresh.noaa.gov", "queryparam": "True", "error_redirect": "https://gsl.noaa.gov/ssop/oops", "state": "NKvuJA8Le065rJ0s-GOe", "decrypt_key": "TkIQzDw_bpYyWQ", "updated": "2023-01-25 19:39:25.821624+00:00", "updater": "None", "enabled": "True", "expiretokens": "False", "display_order": "9", "graphnode": "None"}}, "keys": {"nz5TJfKciudwCA": "FsXF5Tp8ovsR_1oGxndiRiuKXCNUGzv-jE1pAnapi-o=", "VZeiN2uIV4b7Vg": "jUXBQZhZdNB954N24adVLCCO6joKEadQpPisEBCaPG4=", "vkc3O_Gk9NrG3g": "YcZAJMirTV6Ovd6PFBEbweak-y3O4Gsl4ia4DvaTV9c=", "yeS-0X1EoJtVFg": "yfU5g-oGzArOSO8L3Vamg5AEzMVHnNWmEgjUPRXD_20=", "MhqyX0xuYToIKQ": "N7_eulBdLknYejPYOfd-GNVslIHC0M9P5rO78bhW0gU=", "WvpDKlnPgnFtCA": "Q2raysisYQMKVrA8cOfqoJZz2DdY6c58GCZC9CSP5VU=", "sfXynjgjQGhFlw": "mn3rRLc8paAyxD04P5gbnq7ZnryPhzWf4heIC6B3TfE=", "yP24Bc-Nq4gORQ": "5ZBT62JRveyfmz85-t2tdwm8RH1ynPNdqrfzB5hZk5w=", "TkIQzDw_bpYyWQ": "yxE9jOpQE24OW4fR5rL1h0ofI6-Kq8jqXNFIp19WKlY="}, "organizations": {"GSL -- ITS": {"id": 1, "name": "GSL -- ITS", "contact": "Kirk Holub", "email": "[email protected]", "updated": "2022-11-28 15:45:03.439223+00:00", "graphnode": "None"}, "GSL -- ASCEND": {"id": 2, "name": "GSL -- ASCEND", "contact": "Curtis Alexander", "email": "[email protected]", "updated": "2022-11-28 15:55:25.520120+00:00", "graphnode": "None"}, "GSL": {"id": 3, "name": "GSL", "contact": "Scott Nahman", "email": "[email protected]", "updated": "2022-11-28 16:11:49.434804+00:00", "graphnode": "None"}, "GSL -- WIDS": {"id": 7, "name": "GSL -- WIDS", "contact": "Dan Nietfeld", "email": "[email protected]", "updated": "2023-01-24 15:05:20.627123+00:00", "graphnode": "None"}, "PMEL": {"id": 8, "name": "PMEL", "contact": "Eugene Burger", "email": "[email protected]", "updated": "2023-01-24 18:43:24.313756+00:00", "graphnode": "None"}, "GSL -- WIDS - WIZARD": {"id": 9, "name": "GSL -- WIDS - WIZARD", "contact": "Jebb Stewart", "email": "[email protected]", "updated": "2023-01-24 20:44:27.029983+00:00", "graphnode": "None"}}} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script | ||
from django.core.management.base import BaseCommand | ||
from sites.models import get_or_add_project | ||
import json | ||
import ast | ||
|
||
class Command(BaseCommand): | ||
help = "Adds all Organizations, Keys, and Projects found in the file created by dump_orgs_and_projects.py" | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument('filename', type=str) | ||
|
||
def handle(self, *args, **options): | ||
|
||
filename = options['filename'] | ||
print('filename: ' + filename) | ||
|
||
fp = open(filename, 'r') | ||
datastr = fp.read() | ||
fp.close | ||
#print('datastr: ' + str(datastr)) | ||
|
||
data = json.loads(datastr) | ||
#print('data: ' + str(data)) | ||
|
||
for p in data.keys(): | ||
print(" project: " + str(p)) | ||
# thisp = {} | ||
# thisp['name'] = str(k) | ||
# for a in projects[k].keys(): | ||
# thisp[a] = projects[k][a] | ||
# print('np = get_or_add_project(' + str(thisp) + ')') | ||
# np = get_or_add_project(thisp) | ||
# print(" np: " + str(np)) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script | ||
from django.core.management.base import BaseCommand | ||
from django.utils import timezone | ||
|
||
from sites.models import Project, Key, Organization | ||
|
||
class Command(BaseCommand): | ||
help = "Dumps Projects and Organiations in JSON" | ||
|
||
def handle(self, *args, **options): | ||
|
||
allproj = Project.objects.all() | ||
allkey = Key.objects.all() | ||
allorg = Organization.objects.all() | ||
|
||
data = {} | ||
pret = {} | ||
data["projects"] = pret | ||
for p in allproj: | ||
pret[str(p)] = {} | ||
for (k,v) in p.get_fields(): | ||
pret[str(p)][str(k)] = str(v) | ||
print(" pret = " + str(pret)) | ||
|
||
kret = {} | ||
data["keys"] = kret | ||
for v in allkey: | ||
kret[str(v)] = v.get_key() | ||
print(" kret = " + str(kret)) | ||
|
||
oret = {} | ||
data["organizations"] = oret | ||
for o in allorg: | ||
oret[str(o)] = {} | ||
for (k,v) in o.get_fields(): | ||
oret[str(o)][str(k)] = v | ||
print(" oret = " + str(oret)) | ||
|
||
data = str(data).replace("'", '"', 1000000) | ||
now = str(timezone.now()) | ||
now = now[0:19] | ||
fname = now.replace(' ', '_') | ||
fname = fname.replace('-', '', 3) | ||
fname = 'SSOP_' + fname.replace(':', '', 4) + '.json' | ||
print("wrote " + str(fname)) | ||
fp = open(fname, 'w') | ||
fp.write(str(data)) | ||
fp.close() |
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
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
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