{% 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),
    # name, formula, and mass are required fields!
    "name": (name of the chemical),
    "formula": (molecular formula),
    "mass": (monoisotopic mass, float),
    "pubchem_cid": <string>,
    "pubmed_refcount": <integer>
    "standard_class": <string>
    "inchikey": <inchikey>,
    "inchikey14": <inchikey14>,
    # final_mz and final_rt are required fields!
    "final_mz": (m/z ratio after experiment, float),
    "final_rt": (retention time after experiment, 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 %}