I am creating a Django application that stores an equation with variables that needs to be calculated in the backend. i.e. the user would store the following as a string:
{rower_weight}/({rower_time})^3
where rower_weight ad rower_time are variables. Then, in the backend (upon receiving new data) would store a calculated field based on the formula.
I considered using eval or f-strings, however would be unsafe with user input. What would be the best alternative that would allow for unsafe user input to be used?
Thanks!