Skip to content
Snippets Groups Projects
Commit 4631b29f authored by Bertille Bouget's avatar Bertille Bouget
Browse files

notif

parent bbc37841
No related branches found
No related tags found
1 merge request!10Tiber
......@@ -17,8 +17,7 @@
<div class="text_box">
<p>ATTENTION: Pour accéder à la hotline, vous devez avoir signé <a href="https://cotiz.viarezo.fr/">la nouvelle charte du BDE</a> !!</p>
<br>
<br>
<a href="" style="background-color: #e7c021; color:white;padding: 1%;border-radius: 15px;margin-top: 1%;">Hotline</a>
<a href="{% url 'hotline' %}" style="background-color: #e7c021; color:white;padding: 1%;border-radius: 15px;margin-top: 1%;">Hotline</a>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -7,6 +7,7 @@ from django.shortcuts import redirect
import requests
import json
# from cryptography.fernet import Fernet
from django.core.mail import send_mail
......@@ -17,7 +18,7 @@ def login(request): #on a le state et le authorization code dans le request
code = str(request.GET['code']),
state = str(request.GET['state'])
url = 'https://auth.viarezo.fr/oauth/token'
redirect_url = 'https://astegifetobegif.cs-campus.fr/intermediaire'
redirect_url = 'http://localhost:8000/'
jso = requests.post(url, data={'grant_type':'authorization_code','code':code,'redirect_uri':redirect_url,'client_id':'2fe828e15647fc92437727b6646ce5c799c40991','client_secret':'f306614fc96833e80af693f2991901bc54a9cf9a'}).json()
access_token = jso['access_token']
r = requests.get("https://auth.viarezo.fr/api/user/show/me", headers={"Authorization" : "Bearer "+access_token})
......@@ -98,6 +99,10 @@ def commande_passee(request, requete):
commande.save()
commanditaaire=list(utilisateur.objects.filter(email=mail))[0]
mescommandes=commande_crepe.objects.filter(commanditaire=commanditaaire)
send_mail("commande crêpe",
'commande de {% commanditaaire.email %}',
'stepgifimstuck@gmail.com',
['stepgifimstuck@gmail.com'])
return render(request ,"campagne/mes_commandes.html", { 'mescommandes' : mescommandes})
def mes_commandes(request):
......
......@@ -133,3 +133,9 @@ SESSION_ENGINE = 'encrypted_cookies'
ENCRYPTED_COOKIE_KEYS = ['HZJSZGQU3fiJaG53Ha1jYZGZkxrqGDF3m-nZN3fhe46=']
SESSION_COOKIE_SECURE = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'stepgifimstuck@gmail.com'
EMAIL_HOST_PASSWORD = 'hotlineCrepesLeS'
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment