IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Python Discussion :

creation d'un site minimaliste


Sujet :

Python

  1. #1
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut creation d'un site minimaliste
    bonjour,
    j'ai telecharger cherrypy 3.6 amd 64

    j'ai créer le fichier tutoriel.conf
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [global]
    server.socket_host="127.0.0.1"
    server.socket_port=8080
    server.thread_pool=5
    tools.sessions.on=true
    tools.encode.encoding="Utf-8"
    [/annexes]
    tools.staticdir.on=true
    tools.staticdir.dir="annexes"
    et le script

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    import cherrypy
    class MonSiteWeb(object):
        def index(self):
            return "<h1>bonjour a tous </h1>"
     
        index.exposed=true
    cherrypy.quickstart(MonSiteWeb(),config="tutoriel.conf")
    j'ai l'erreur suivante
    Traceback (most recent call last):
    File "C:/Users/jm18c/AppData/Local/Programs/Python/Python36-32/test.py", line 1, in <module>
    import cherry
    ModuleNotFoundError: No module named 'cherry'

    le message d'erreur

    Traceback (most recent call last):
    File "C:/Users/jm18c/AppData/Local/Programs/Python/Python36-32/test.py", line 2, in <module>
    class MonSiteWeb(object):
    File "C:/Users/jm18c/AppData/Local/Programs/Python/Python36-32/test.py", line 6, in MonSiteWeb
    index.exposed=true
    NameError: name 'true' is not defined

    merci

  2. #2
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    True

  3. #3
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    en fait j'ai une page d'erreur

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    Traceback (most recent call last):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 218, in as_dict
        value = unrepr(value)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 477, in unrepr
        return b.build(obj)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 360, in build
        return m(o)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 438, in build_Name
        raise TypeError("unrepr could not resolve the name %s" % repr(name))
    TypeError: unrepr could not resolve the name 'true'
     
    During handling of the above exception, another exception occurred:
     
    Traceback (most recent call last):
      File "C:/Users/jm18c/AppData/Local/Programs/Python/Python36-32/test.py", line 7, in <module>
        cherrypy.quickstart(monsiteweb(),config="tutoriel.conf")
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\__init__.py", line 169, in quickstart
        _global_conf_alias.update(config)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\_cpconfig.py", line 158, in update
        reprconf.Config.update(self, config)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 160, in update
        config = Parser().dict_from_file(config)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 233, in dict_from_file
        return self.as_dict()
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\lib\reprconf.py", line 224, in as_dict
        raise ValueError(msg, x.__class__.__name__, x.args)
    ValueError: ("Config error in section: 'global', option: 'tools.sessions.on', value: 'true'. Config values must be valid Python.", 'TypeError', ("unrepr could not resolve the name 'true'",))
    >>>

  4. #4
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    en installation la version 2.7 de python j'ai le message suivant
    Traceback (most recent call last):
    File "C:\Python27\test.py", line 1, in <module>
    import cherrypy
    ImportError: No module named cherrypy
    >>>

  5. #5
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    Je viens de le dire, il faut mettre True avec un T majuscule et non minuscule.

    Si tu ne montres pas les lignes où se passent l'erreur, difficile d'aider plus...

    donc

    Comme dans la 1ère page de la doc.

    Ensuite c'est

    Comme toujours dans la 1ère page de la doc.

    Ces erreurs se trouvant dans votre fichier test.py

  6. #6
    Membre très actif

    Homme Profil pro
    Bidouilleur
    Inscrit en
    Avril 2016
    Messages
    721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Bidouilleur

    Informations forums :
    Inscription : Avril 2016
    Messages : 721
    Billets dans le blog
    1
    Par défaut
    Bah il te faut l'installer aussi pour python2.

    Quant à ton erreur, il suffit de lire, dans ton fichier de config, c'est aussi True qu'il faut renseigner.

    Grillé de 4 minutes

  7. #7
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    import cherrypy
    class monsiteweb(object):
        def index(self):
            return "<h1> bonjour</h1>"
        index.exposed=True
    cherrypy.quickstart(monsiteweb(),config="tutoriel.conf")

    tutoriel.conf

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [global]
    server.socket_host="127.0.0.1"
    server.socket_port=8080
    server.thread_pool=5
    tools.sessions.on=True
    tools.encode.encoding="Utf-8"
    [/annexes]
    tools.staticdir.on=True
    tools.staticdir.dir="annexes"
    liste d'erreur

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    = RESTART: C:/Users/jm18c/AppData/Local/Programs/Python/Python36-32/test.py =
    [28/Feb/2018:15:47:09] ENGINE Listening for SIGTERM.
    [28/Feb/2018:15:47:09] ENGINE Bus STARTING
     
    Warning (from warnings module):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\_cpchecker.py", line 176
        % (msg, section, root, dir))
    UserWarning: dir is a relative path and no root provided.
    section: [/annexes]
    root: None
    dir: 'annexes'
    [28/Feb/2018:15:47:09] ENGINE Started monitor thread 'Autoreloader'.
    [28/Feb/2018:15:47:09] ENGINE Started monitor thread '_TimeoutMonitor'.
    [28/Feb/2018:15:47:10] ENGINE Serving on http://127.0.0.1:8080
    [28/Feb/2018:15:47:10] ENGINE Bus STARTED
    je n'ai fais qu'installer python 3.6.4 et cherrypy 3.6

  8. #8
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    Alors déjà ton problème de départ est résolu, ce qui implique une autre erreur, donc un autre problème !

    Dans ton fichier tutoriel.conf, ligne 7: Retire le / devant annexes. Est-ce que l'erreur perdure ?

  9. #9
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    toujours

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    = RESTART: C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\test.py =
    [28/Feb/2018:16:36:46] ENGINE Listening for SIGTERM.
    [28/Feb/2018:16:36:46] ENGINE Bus STARTING
    [28/Feb/2018:16:36:46] ENGINE Started monitor thread '_TimeoutMonitor'.
    [28/Feb/2018:16:36:46] ENGINE Started monitor thread 'Autoreloader'.
    [28/Feb/2018:16:36:51] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x05BE97F0>>
    Traceback (most recent call last):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 205, in publish
        output.append(listener(*args, **kwargs))
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\_cpserver.py", line 168, in start
        ServerAdapter.start(self)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\servers.py", line 170, in start
        wait_for_free_port(*self.bind_addr)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\servers.py", line 438, in wait_for_free_port
        raise IOError("Port %r not free on %r" % (port, host))
    OSError: Port 8080 not free on '127.0.0.1'
     
    [28/Feb/2018:16:36:51] ENGINE Shutting down due to error in start listener:
    Traceback (most recent call last):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 243, in start
        self.publish('start')
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 223, in publish
        raise exc
    cherrypy.process.wspbus.ChannelFailures: OSError("Port 8080 not free on '127.0.0.1'",)
     
    [28/Feb/2018:16:36:51] ENGINE Bus STOPPING
    [28/Feb/2018:16:36:51] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) already shut down
    [28/Feb/2018:16:36:51] ENGINE Stopped thread 'Autoreloader'.
    [28/Feb/2018:16:36:51] ENGINE Stopped thread '_TimeoutMonitor'.
    [28/Feb/2018:16:36:51] ENGINE Bus STOPPED
    [28/Feb/2018:16:36:51] ENGINE Bus EXITING
    [28/Feb/2018:16:36:51] ENGINE Bus EXITED

  10. #10
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    tu as vu le message d'erreur qui dit que le port 8080 n'est pas libre

  11. #11
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    Euh non pas toujours, je viens encore de te résoudre un problème, j'y peux rien si tu en as des centaines

    Apparemment le port par défaut de CherryPy est le 8080 et il est déjà utilisé, solution: Changer le port par défaut de CherryPy

    Après l'importation du module CherryPy (ligne suivante), ajoute

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    cherrypy.config.update({'server.socket_port': 3030,})
    Un exemple ICI.

  12. #12
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    ca donne ca comme erreur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    [28/Feb/2018:17:08:42] ENGINE Listening for SIGTERM.
    [28/Feb/2018:17:08:42] ENGINE Bus STARTING
     
    Warning (from warnings module):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\_cpchecker.py", line 176
        % (msg, section, root, dir))
    UserWarning: dir is a relative path and no root provided.
    section: [/annexes]
    root: None
    dir: 'annexes'
    [28/Feb/2018:17:08:42] ENGINE Started monitor thread 'Autoreloader'.
    [28/Feb/2018:17:08:42] ENGINE Started monitor thread '_TimeoutMonitor'.
    [28/Feb/2018:17:08:42] ENGINE Serving on http://127.0.0.1:8080
    [28/Feb/2018:17:08:42] ENGINE Bus STARTED

    autre question avez vous un lien pour cherrypy pour Windows
    merci

  13. #13
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    Je l'ai déjà dis, tutoriel.conf, ligne 7, tu vires le /

  14. #14
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    vous me conseillez quoi comme version de python pour w10
    et comme cherrypy

  15. #15
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    je vire le / et j'ai comme erreur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    = RESTART: C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\test.py =
    [28/Feb/2018:17:42:28] ENGINE Listening for SIGTERM.
    [28/Feb/2018:17:42:28] ENGINE Bus STARTING
    [28/Feb/2018:17:42:28] ENGINE Started monitor thread 'Autoreloader'.
    [28/Feb/2018:17:42:28] ENGINE Started monitor thread '_TimeoutMonitor'.
    [28/Feb/2018:17:42:34] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x05D99810>>
    Traceback (most recent call last):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 205, in publish
        output.append(listener(*args, **kwargs))
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\_cpserver.py", line 168, in start
        ServerAdapter.start(self)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\servers.py", line 170, in start
        wait_for_free_port(*self.bind_addr)
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\servers.py", line 438, in wait_for_free_port
        raise IOError("Port %r not free on %r" % (port, host))
    OSError: Port 8080 not free on '127.0.0.1'
     
    [28/Feb/2018:17:42:34] ENGINE Shutting down due to error in start listener:
    Traceback (most recent call last):
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 243, in start
        self.publish('start')
      File "C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cherrypy\process\wspbus.py", line 223, in publish
        raise exc
    cherrypy.process.wspbus.ChannelFailures: OSError("Port 8080 not free on '127.0.0.1'",)
     
    [28/Feb/2018:17:42:34] ENGINE Bus STOPPING
    [28/Feb/2018:17:42:34] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) already shut down
    [28/Feb/2018:17:42:34] ENGINE Stopped thread '_TimeoutMonitor'.
    [28/Feb/2018:17:42:34] ENGINE Stopped thread 'Autoreloader'.
    [28/Feb/2018:17:42:34] ENGINE Bus STOPPED
    [28/Feb/2018:17:42:34] ENGINE Bus EXITING
    [28/Feb/2018:17:42:34] ENGINE Bus EXITED
     
    =============================== RESTART: Shell ===============================
    >>>

  16. #16
    Membre très actif

    Homme Profil pro
    Bidouilleur
    Inscrit en
    Avril 2016
    Messages
    721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Bidouilleur

    Informations forums :
    Inscription : Avril 2016
    Messages : 721
    Billets dans le blog
    1
    Par défaut
    Si le port 8080 est déjà utilisé par une autre application, change le port.

    En espérant que l'autre application en question ne soit pas déjà le même script que tu aurais déjà lancé.

  17. #17
    Expert confirmé
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 127
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 127
    Par défaut
    Je l'ai déjà dis ICI

  18. #18
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    j'ai mis python2.7 et cherrypy 3.4
    jai moins d'erreur

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    Traceback (most recent call last):
      File "C:\Python27\test.py", line 1, in <module>
        import cherrypy
      File "C:\Python27\lib\site-packages\cherrypy\__init__.py", line 68, in <module>
        from cherrypy import _cpdispatch as dispatch
      File "C:\Python27\lib\site-packages\cherrypy\_cpdispatch.py", line 200, in <module>
        punctuation_to_underscores = str.maketrans(
    AttributeError: type object 'str' has no attribute 'maketrans'

  19. #19
    Membre très actif

    Homme Profil pro
    Bidouilleur
    Inscrit en
    Avril 2016
    Messages
    721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Bidouilleur

    Informations forums :
    Inscription : Avril 2016
    Messages : 721
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par fred1599 Voir le message
    Je l'ai déjà dis ICI
    Arf, désolé, j'avais pas vu

  20. #20
    Membre confirmé
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Février 2016
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Formateur en informatique

    Informations forums :
    Inscription : Février 2016
    Messages : 188
    Par défaut
    test
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    import cherrypy
    cherrypy.config.update({'server.socket_port': 3030,})
    class monsiteweb(object):
        def index(self):
            return "<h1> bonjour</h1>"
        index.exposed=True
    cherrypy.quickstart(monsiteweb(),config="tutoriel.conf")
    tutorial
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [global]
    server.socket_host="127.0.0.1"
    server.socket_port=8080
    server.thread_pool=5
    tools.sessions.on=True
    tools.encode.encoding="Utf-8"
    [annexes]
    tools.staticdir.on=True
    tools.staticdir.dir="annexes"
    erreur avec python 3.6 4 et cherrypy 3.4

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    = RESTART: C:\Users\jm18c\AppData\Local\Programs\Python\Python36-32\test.py =
    [28/Feb/2018:19:12:12] ENGINE Listening for SIGTERM.
    [28/Feb/2018:19:12:12] ENGINE Bus STARTING
    [28/Feb/2018:19:12:12] ENGINE Started monitor thread 'Autoreloader'.
    [28/Feb/2018:19:12:12] ENGINE Started monitor thread '_TimeoutMonitor'.
    [28/Feb/2018:19:12:12] ENGINE Serving on http://127.0.0.1:8080
    [28/Feb/2018:19:12:12] ENGINE Bus STARTED
    merci

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Creation onglet de site
    Par benoitL39 dans le forum SharePoint
    Réponses: 4
    Dernier message: 25/01/2008, 16h51
  2. creation d'un sites web dynamique
    Par chat blanc dans le forum Autres langages pour le Web
    Réponses: 3
    Dernier message: 02/11/2007, 19h59
  3. Réponses: 1
    Dernier message: 02/10/2007, 11h06
  4. Creation d'un site de WEB + UML
    Par chat blanc dans le forum UML
    Réponses: 7
    Dernier message: 12/09/2007, 08h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo