Skip to content
Extraits de code Groupes Projets
Valider 551c03e7 rédigé par Alexis ANDREANI's avatar Alexis ANDREANI
Parcourir les fichiers

Merge branch 'dev' of https://git.iiens.net/anteunis2018/pima_grp4 into dev

parents 5b3f2ccc 5ef1d687
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
{% load static %}
<!DOCTYPE HTML>
<!--
Spatial by TEMPLATED
templated.co @templatedco
Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
-->
<html>
<head>
<title>NutriForm</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{% static 'nutriform/assets/css/main.css' %}" />
</head>
<body class="landing">
{% block content %}
{% endblock %}
<!-- Footer -->
<footer id="footer">
<div class="container">
<ul class="icons">
<li><a href="#" class="icon fa-facebook"></a></li>
<li><a href="#" class="icon fa-twitter"></a></li>
<li><a href="#" class="icon fa-instagram"></a></li>
</ul>
<ul class="copyright">
<li>&copy; NutriForm</li>
<li>Design: <a href="http://templated.co">TEMPLATED</a></li>
<li>Images: <a href="http://unsplash.com">Unsplash</a></li>
</ul>
</div>
</footer>
<!-- Scripts -->
<script src="{% static 'nutriform/assets/js/jquery.min.js' %}"></script>
<script src="{% static 'nutriform/assets/js/skel.min.js' %}"></script>
<script src="{% static 'nutriform/assets/js/util.js' %}"></script>
<script src="{% static 'nutriform/assets/js/main.js' %}"></script>
</body>
</html>
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<h2>NutriForm</h2> <h2>NutriForm</h2>
<p>La solution pour vos conseils bien-être<br/> Par le super groupe de PIMA</p> <p>La solution pour vos conseils bien-être<br/> Par le super groupe de PIMA</p>
<ul class="actions"> <ul class="actions">
<li><a href="#" class="button special big">Je m'inscris</a></li> <li><a href="{% url 'login' %}" class="button special big">Je m'inscris</a></li>
</ul> </ul>
</section> </section>
...@@ -143,6 +143,7 @@ ...@@ -143,6 +143,7 @@
<p>N'hésitez pas à nous contacter !</p> <p>N'hésitez pas à nous contacter !</p>
</header> </header>
<form method="post" action="#"> <form method="post" action="#">
{% csrf_token %}
<div class="row uniform 50%" style="color: whitesmoke;"> <div class="row uniform 50%" style="color: whitesmoke;">
<div class="6u 12u$(xsmall)"> <div class="6u 12u$(xsmall)">
<input type="text" name="name" id="name" value="" placeholder="Nom" /> <input type="text" name="name" id="name" value="" placeholder="Nom" />
......
{% extends "../plateforme/base.html" %} {% extends "../nutriform/base.html" %}
{% block content %} {% block content %}
{% endblock %} <div class="container">
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
{{ form.username.label_tag }}
{{ form.username }}
{{ form.password.label_tag }}
{{ form.password }}
<input type="submit" value="login" style="margin-top: 5px;">
<input type="hidden" name="next" value="{{ next }}">
</form>
</div class="container">
{% endblock %}
\ No newline at end of file
from django.urls import path from django.urls import path, include
from . import views from . import views
urlpatterns = [ urlpatterns = [
path('', views.index, name='index'), path('', views.index, name='index'),
path('accounts/', include('django.contrib.auth.urls'))
] ]
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from django.core.mail import send_mail
def index(request): def index(request):
if request.method == 'POST' :
if request.POST['name'] and request.POST['email'] and request.POST['message'] :
send_mail(
'Contact: '+request.POST['name'],
'from : '+request.POST['email']+'\n\n'+request.POST['message'],
request.POST['email'],
['charles.anteunis@gmail.com',]
)
return render(request, 'nutriform/index.html') return render(request, 'nutriform/index.html')
# Create your views here. # Create your views here.
...@@ -22,6 +22,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -22,6 +22,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '2c^k19waap+)_bcypl^jyi83yvlt%da$)w!6hn)@8zs$3au5wh' SECRET_KEY = '2c^k19waap+)_bcypl^jyi83yvlt%da$)w!6hn)@8zs$3au5wh'
# SECURITY WARNING:
mdp = "dntzzrgabemlgbra"
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
...@@ -114,6 +117,16 @@ USE_L10N = True ...@@ -114,6 +117,16 @@ USE_L10N = True
USE_TZ = True USE_TZ = True
#paramètres mail
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'nutriformpima@gmail.com'
EMAIL_HOST_PASSWORD = mdp
EMAIL_USE_TLS = True
ADMINS = [('Charles', 'charles.anteunis@gmail.com'),]
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/ # https://docs.djangoproject.com/en/2.2/howto/static-files/
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter