Skip to content
Snippets Groups Projects
Commit 0b6ccca7 authored by Milo Hivert's avatar Milo Hivert
Browse files

merge+modif

parents 823d0286 5d765c9b
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -16,9 +16,8 @@ function f (){
var sucre = bouton_sucre.value;
var confiture = bouton_confiture.value;
var adresse = bouton_adresse.value;
if (parseInt(nature)+parseInt(sucre)+parseInt(nutella)+parseInt(confiture) !== 0 && adresse!==""){
window.location = "http://localhost:8000/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+confiture+"_"+adresse+"_";
window.location = "https://astegifetobegif.cs-campus.fr/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+confiture+"_"
}
else if (messageof) {
var paraph = document.createElement("p");
......
......@@ -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
......@@ -3,9 +3,11 @@ from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from campagne.models import utilisateur, commande_crepe
from django.shortcuts import redirect
# from campagne.models import clé
import requests
import json
# from cryptography.fernet import Fernet
from django.core.mail import send_mail
......@@ -67,6 +69,10 @@ def commande_passee(request, requete):
mail = r.json()['email']
commande=commande_crepe.objects.create(adresse_livraison=L[4], crepe_nature=L[0], crepe_nutella=L[1], crepe_sucre=L[2], crepe_confiture=L[3],commanditaire=utilisateur.objects.get(email=mail))
commande.save()
send_mail('commande crêpes',
'commande de {{commande.commanditaire}} de {{commande.crepe_nature}} crêpes natures, de {{commande.crepe_sucre}} crêpes sucres, de {{commande.crepe_confiture}} crêpes confiture et de {{commande.crepe_nutella}} crêpes nutella',
'stepgifimstuck@gmail.com',
['stepgifimstuck@gmail.com'])
return redirect(mes_commandes)
def mes_commandes(request):
......
File deleted
......@@ -27,6 +27,8 @@ SECRET_KEY = 'django-insecure-^pwp$p=!_g7hoyl&1kul+!v(!y9lu+6@-+1d_&auub18m^h@w(
DEBUG = True
ALLOWED_HOSTS = ["138.195.139.213", "localhost", "astegifetobegif.cs-campus.fr", "*"]
ALLOWED_HOSTS = ["138.195.139.213", "localhost", "astegifetobegif.cs-campus.fr", "*"]
# Application definition
......@@ -133,3 +135,9 @@ SESSION_ENGINE = 'encrypted_cookies'
ENCRYPTED_COOKIE_KEYS = ['HZJSZGQU3fiJaG53Ha1jYZGZkxrqGDF3m-nZN3fhe46=']
SESSION_COOKIE_SECURE = False
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 register or to comment