|
|
@ -0,0 +1,21 @@ |
|
|
|
#!/usr/bin/env python3 |
|
|
|
|
|
|
|
import requests |
|
|
|
import sys |
|
|
|
import data2 |
|
|
|
import data1 |
|
|
|
|
|
|
|
baseurl = "http://127.0.0.1:5000" |
|
|
|
session = requests.session() |
|
|
|
|
|
|
|
with session.post(baseurl + "/admin/login", {'username': 'admin', 'password': 'admin'}) as req: |
|
|
|
if req.status_code != 200: |
|
|
|
print("Auth Failed") |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
for x in data1.data + data2.data: |
|
|
|
print(f"POSTing for {x}...") |
|
|
|
req = session.post(baseurl + "/chemical/create", x) |
|
|
|
if req.status_code != 200: |
|
|
|
print(f"Request Failed for {x}") |
|
|
|
print("Complete.") |