From 703c1c623892d69d8e24af68b31d84495301ca02 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Synck Date: Sun, 1 Mar 2020 15:14:15 +0100 Subject: initial files --- fonctions.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 fonctions.py (limited to 'fonctions.py') diff --git a/fonctions.py b/fonctions.py new file mode 100644 index 0000000..f227b0c --- /dev/null +++ b/fonctions.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import psycopg2 +import mod_python + +def codeHTML(titre, corps): + content=(""" + + + """ + titre + """ + + + + """ + corps + """ +""") + + return content + +def connexionBD(): +# connexion=psycopg2.connect ("host='aquabdd' dbname='etudiants' user='11802407' password='153067690FG'") + connexion=psycopg2.connect ("host='localhost' dbname='devweb' user='devweb' password='123456'") + return connexion + +def lien(url, texte): + content=("""""" + texte + """""") + return content + +def redirectionSiNonConnecte(req,sess): + if sess.is_new(): + mod_python.util.redirect(req, "form-connexion.py") -- cgit v1.2.3