The use of inertial frames in Lagrangian mechanics is by no means compulsory and everything can be done in any reference frame provided one takes all forces, real and inertial, into account.
Actually there are two possibilities in interpreting the question.
We work in a non inertial frame $R'$ (instead of an inertial one $R$) because we are adopting coordinates $q'^k$ at rest with $R'$. In other words: If we keep all the $q'^k$ fixed, the points of matter the physical system stay at rest in $R'$.
We work in a non inertial frame $R'$ (instead of an inertial one $R$) because the Lagrangian encompasses all forces (real forces and inertial ones) appearing in $R'$.
These are two completely independent viewpoints whose interplay I go to illustrate.
Everything relies upon the following general result.
I will refer now to a generic pair of reference frames $R$ and $R'$ without assuming that one of both are inertial.
Proposition.
Suppose that a Lagrangian $L|_R(r,q, \dot{q})$ is both
(a) constructed out of the forces appearing in a reference frame $R$,
(b) using coordinates $q^k$ at rest with that frame.
If that Lagrangian is described passing to coordinates $q'^h$ ($*$) at rest with another reference frame $R'$, i.e,:
$$L'|_R(t, q', \dot{q}'):= L|_R(t, q(t,q'), \dot{q}(t,q', \dot{q}'))$$
then it produces the correct equations of motion in $R'$, though, in general it may happens that:
$$L'|_R(t, q', \dot{q}') \neq L|_{R'}(t, q', \dot{q}')$$
where, in the RHS a Lagrangian takes place directly constructed out of all the forces manifesting in $R'$ and referred to coordinates at rest with $R'$.
The said result has two remarkable consequences: (i) The Lagragian of a given system is not uniquely given, (ii) as soon as we make a choice of a Lagrangian of a system we can suppose that it transform as scalar without affecting the equations of motion, written in whatever reference frame.
The mentioned result implies something for the special case where $R$ is inertial and $R'$ is not. Let us start constructing $L|_R$ in $R$. For the sake of simplicity we stick to the form:
$$L|_R(t,q, \dot{q}) = T|_R(q,\dot{q}) - U|_R(q)\quad (1)$$
i.e. all forces are supposed to be conservative in $R$. The more general case of real forces due to a generalized potential (see below), like electromagnetic forces, does not involve any further difficulty.
In $R'$ the real forces associated with $U$ keep existing, but new inertial forces show up described by some added term $-V$ below, so the Lagrangian must be of the form:
$$L|_{R'}(t,q', \dot{q}') = T|_{R'}(q',\dot{q}') - U|_R(q(t,q')) - V(t, q', \dot{q}')\quad (2)$$
Making use of (1) and (2) we conclude that:
$$V(t,q',\dot{q}') = T|_{R'}- T|_R \quad (3)$$
It is easy to see, by direct inspection form (3), that:
$$V(t,q',\dot{q}') = \phi(t,q') + \sum_{k=1}^n A_k(t,q')\dot{q}'^k\quad (4)$$
This object is called a generalized potential. Physicists are familiar with it, because it appears when dealing with the Lagrangian of charged particles immersed in a given (non-stationary) electromagnetic field. Inertial forces are described by a similar theoretical object. A closer scrutiny of the motion equations:
$$\frac{d}{dt} \frac{\partial L|_{R'}}{\partial \dot{q}'} -
\frac{\partial L|_{R'}}{\partial q'}=0$$
namely:
$$\frac{d}{dt} \frac{\partial T|_{R'}}{\partial \dot{q}'} -
\frac{\partial T|_{R'}}{\partial q'}= -\frac{\partial U|_R(q(t,q')) }{\partial q'}
- \frac{\partial V}{\partial q'} + \frac{d}{dt} \frac{\partial V}{\partial \dot{q}'} $$
proves that the last two terms in the RHS are, in fact, responsible for all inertial forces (e.g. centrifugal and Coriolis' forces and all remaining ones for a generic motion of $R'$ with respect to $R$). In a sense, in particular Coriolis' force is similar to magnetic force and is associated with the functions $A_k$ in (4).
footnotes
($*$) I assume here that the coordinate transformation is adapted to the structure of the manifold on which $L$ is defined. The structure is that of a fiber bundle (a jet bundle) over the line of time $\mathbb R$. So:
$$t'=t\:, \quad q'^k = q'^k(t,q)\:, \quad \dot{q}'^k = \frac{\partial q'^k}{\partial t} + \sum_{h=1}^n \frac{\partial q'^k}{\partial q^h} \dot{q}^h$$