{% extends "base.html" %} {% block content %}

Admin Dashboard

Logged in as {{user}}

Admin Authentication

Since there is now an admin, only admins can create new admin accounts. You can do so through the /admin/create route.

API Routes

Programmatically adding Chemicals

You need admin credentials to access the /chemical/create endpoint, so using an HTTP library like python's requests library is highly recommended for keeping track of session cookies.


import requests
session = requests.session()
baseurl = "chemicaldb.teidkim.me"
session.post(baseurl + "/admin/login", {"username": (username), "password": (password)})
fields = {
    "chemical_db_id": <db id from another database>,
    "library": (library, is a string),
    # name, formula, and mass are required fields!
    "name": (name of the chemical, is a string),
    "formula": (molecular formula, is a string),
    "mass": (monoisotopic mass, is a float),
    "pubchem_cid": <string>,
    "pubmed_refcount": <integer>
    "standard_class": <string>
    "inchikey": <string>,
    "inchikey14": <string>,
    # final_mz and final_rt are required fields!
    "final_mz": (m/z ratio after experiment, is a float),
    "final_rt": (retention time after experiment, is a float),
    "final_adduct": <string>,
    "final_adduct": <string>,
    "detected_adducts": <string>,
    "adduct_calc_mz": <string>,
    "msms_detected": <string if yes, do not include this field otherwise>
    "msms_purity": <float>
}
session.post(baseurl + "/chemical/create", fields)
        
{% endblock %}