This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method = "POST" action="resultat.html"> {% csrf_token %} | |
<select name="entry_to_delete"> | |
{% for product_name, product_id in history %} | |
<option value={{ product_id }}>{{ product_name }}</option> | |
{% endfor %} | |
</select> | |
<input type = "submit" value = "Submit"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django import forms | |
class Niveau(forms.Form): | |
choix_niveau=( | |
('deb', 'debutant'), | |
('int', 'intermédiaire'), | |
('av', 'avancé')) | |
niveau=forms.ChoiceField(choices=choix_niveau) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exponential backoff in Ruby | |
begin | |
make_request | |
rescue RequestError => e | |
if retries <= max_retries | |
retries += 1 | |
sleep 2 ** retries + rand(20) | |
retry | |
else | |
raise "Timeout: #{e.message}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<ActionResult> NylasAuthenticationResult(string code) | |
{ | |
using (HttpClient httpClient = new HttpClient()) | |
{ | |
// tried as x-www-form-encoded | |
var postData = new List<KeyValuePair<string, string>>(); | |
postData.Add(new KeyValuePair<string, string>("client_id", "cf7jhxlkkvimkxvd2vnkkzci")); | |
postData.Add(new KeyValuePair<string, string>("client_secret", "your_secret")); | |
postData.Add(new KeyValuePair<string, string>("grant_type ", "authorization_code")); |