Hello,
I am working on my first ever Django project and have been trying to do something that I have been stuck with for weeks and looking for any assistance, please.
each of my views uses a CLIENT_ID, CLIENT_SECRET and I have a page with a drop-down to select one of the OAuth Accounts that I would like to use.
HTML Snippet
<h2>Select Menu</h2>
<p>To style a select menu in Bootstrap 5, add the .form-select class to the select element:</p>
<label for="cust" class="form-label">Select list (select one):</label>
<select class="form-select" id="cust" name="customer">
<option>Auth 1</option>
<option>Auth 2</option>
<option>Auth 3</option>
<option>Auth 4</option>
</select>
<input type="submit" value="click" class="btn btn-primary">
Views.py snippet
def data(request):
# OAuth when using Client Credentials
CLIENT_ID = CLIENT_ID
CLIENT_SECRET = CLIENT_SECRET
def getdata(request):
# OAuth when using Client Credentials
CLIENT_ID = CLIENT_ID
CLIENT_SECRET = CLIENT_SECRET
When an Auth Selection is made via the dropdown, I would like to set the CIENT_ID and CLIENT_SECRET to be used for all of my views. Ultimately I would like to use dotenv as well.
I am struggling to get the selection and then set the CIENT_ID and CLIENT_SECRET to each view.
Thank you very much.