Jump to content

study

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by study

  1. Hi... please help me...

    I'm just have one of problem.

    I want to use python but i don't know to setting to flask.

    i did searching google,

     

    file: public-html/cgi-bin/cgi.cgi

     

    #!/usr/bin/python
    from wsgiref.handlers import CGIHandler
    from views import app
    import os
    import cgitb; cgitb.enable()
    os.environ['SERVER_NAME'] = '127.0.0.1'
    os.environ['SERVER_PORT'] = '5000'
    os.environ['REQUEST_METHOD'] = 'GET'
    os.environ['PATH_INFO'] = ""
    CGIHandler().run(app)

     

    file: views.py

     

    from flask import Flask
    app = Flask(__name__)
    @app.route("/")
    def hello():
    return "This is Hello World!\n"
    if __name__ == "__main__":
    app.run()

     

    file: .htaccess

     

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /home/USERNAME/public_html/cgi-bin/cgi.cgi/$1 [L]

     

    ...

    i had connect to host on web

    it's just show me that text '/Index'

     

    also i was uploaded files that i made to python files and html files in templates folder but it is not working.

     

    My english is so bad...sorry. please help me ㅠㅠㅠㅠ

×
×
  • Create New...