Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error using livereload with flask #270

Open
obnoxiousmods opened this issue May 17, 2023 · 3 comments · May be fixed by #271
Open

error using livereload with flask #270

obnoxiousmods opened this issue May 17, 2023 · 3 comments · May be fixed by #271

Comments

@obnoxiousmods
Copy link

obnoxiousmods commented May 17, 2023

from flask import Flask, render_template, request, redirect, url_for, session
from livereload import Server

app = Flask(
    __name__,
    static_url_path='/static',
    static_folder='static'
)

@app.route('/', methods=['GET', 'POST'])
def index():
    return ''

if __name__ == "__main__":
    app.debug = True
    server = Server(app.wsgi_app)
    server.watch('templates/*.*')
    server.serve()

this is my code, getting this error TypeError: WSGIContainer.environ() missing 1 required positional argument: 'request'
everytime i visit 127.0.0.1:5500?

@istride
Copy link

istride commented May 17, 2023

I also encountered this error while trying out PyFyre. I found that there has been a change in Tornado where WSGIContainer.environ() is no longer a static method as of version 6.3.0.

My issue was fixed by specifying tornado<6.3.0 in my project's requirements.txt.

@lty2002
Copy link

lty2002 commented Jun 11, 2023

I also encountered this error while trying out PyFyre. I found that there has been a change in Tornado where WSGIContainer.environ() is no longer a static method as of version 6.3.0.

My issue was fixed by specifying tornado<6.3.0 in my project's requirements.txt.

It's really helpful.

@nacho00112 nacho00112 linked a pull request Jun 19, 2023 that will close this issue
@nacho00112
Copy link

Until PyPI livereload get updated this solves the issue:

pip install https://github.com/nacho00112/python-livereload/archive/refs/heads/master.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants