Commit 83b5a12b authored by Hamid's avatar Hamid
Browse files

Interaction_server

parents
Le serveur web de notre projet,consiste la partie executable sur le web .
Pour executer le projet il suffit de suivre les etapes suivantes :
-Installer la version 3 de python ,
-Installer flask avec la commande suivante :
pip3 install flask
-Telecharger le projet du depot :
avec la commande : git clone https://depot.lipn.univ-paris13.fr/david/lipn-search.git
-Verifier que votre port 8011 est bien libre
-Se rendre sur le repertoire server et lancer votre serveur :
python3 severweb.py
VOus remarquerez que le server a demarer avec un message sur votre terminal
-Consulter votre navigateur avec l'url
https://localhost:8011
Et l'affichage de votre page html index serra afficher .
Enjoy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>lipn search</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="{{url_for('static',filename='../static/css/landing-page.min.css')}}">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="navbar-brand" href="{{ url_for('index') }}">Lipn Search</a>
</div>
</nav>
<!-- Masthead -->
<header class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<h1 class="mb-5">LIPN-SEARCH</h1>
</div>
<div class="container">
<div class="col-md-10 col-lg-8 col-xl-7 mx-auto">
<div class="form-row">
<div class="col-12 col-md-25 mb-8 mb-md-0">
<form id="formRecher" action="{{ url_for('recherche') }}" method="GET" class="form-group" >
<input id="inputsearch" class="form-control form-control-lg" type="search" placeholder="Effectuez une rechercher..." name="recherche"/>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>lipn search</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="{{url_for('static',filename='../static/css/landing-page.min.css')}}">
</head>
<body>
<nav class="navbar navbar-light bg-light" style="height: 100px;" >
<form class="form-inline" action="{{ url_for('recherche') }}" method="GET" id='formRecherche'>
<a class="navbar-brand" href="{{url_for('index')}}">Lipn Search</a>
<input class="form-control form-control-lg " type="search" placeholder="Effectuez une recherche" style="margin-left:2px;" >
<button class="btn btn-outline-success mr-sm-18" type="submit" style="margin-left:50px;">Recherche</button>
</form>
</nav>
<div class="container row h-100 justify-content-center align-items-center">
<div>
{% for tab in tab_resultat %}
<div>
<div>http://{{tab[0]}}</div>
</div>
{% endfor %}
</div>
</div>
</body>
</html>
\ No newline at end of file
from flask import Flask, render_template,request
import sys
sys.path.append('../index_inverse/index_inverse/src')
from IndexInverse import IndexInverse
#Initialize the Flask application
app = Flask(__name__, template_folder='.')
#creation de l'index_inverser
doc=['lipn.fr_1','lipn.fr_2','lipn.fr_3']
textes=['I love shanghai','i am from shanghai now i study in tongji university',
'i am from lanzhou now i study in lanzhou university of science and technolgy']
index=IndexInverse(doc,textes)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/index')
def route_index():
return render_template('index.html')
@app.route('/recherche', methods=['GET'])
def recherche():
return render_template("recherche.html",
requete =request.args.get('recherche',default=""),
tab_resultat = index.search(request.args.get('recherche',default="")))
if __name__ == '__main__':
app.run(
host="localhost",
port=int("8011")
#,debug=True
)
\ No newline at end of file
body{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:700}header.masthead{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;background-size:cover;padding-top:8rem;padding-bottom:8rem}header.masthead .overlay{position:relative;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}header.masthead h1{font-size:2rem}@media (min-width:768px){header.masthead{padding-top:12rem;padding-bottom:12rem}header.masthead h1{font-size:3rem}}.showcase .showcase-text{padding:3rem}.showcase .showcase-img{min-height:30rem;background-size:cover}@media (min-width:768px){.showcase .showcase-text{padding:7rem}}.features-icons{padding-top:7rem;padding-bottom:7rem}.features-icons .features-icons-item{max-width:20rem}.features-icons .features-icons-item .features-icons-icon{height:7rem}.features-icons .features-icons-item .features-icons-icon i{font-size:4.5rem}.features-icons .features-icons-item:hover .features-icons-icon i{font-size:5rem}.testimonials{padding-top:7rem;padding-bottom:7rem}.testimonials .testimonial-item{max-width:18rem}.testimonials .testimonial-item img{max-width:12rem;box-shadow:0 5px 5px 0 #adb5bd}.call-to-action{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;background-size:cover;padding-top:7rem;padding-bottom:7rem}.call-to-action .overlay{position:absolute;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}footer.footer{padding-top:4rem;padding-bottom:4rem}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment