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

AttributeError: Setting variables on Sanic instances is not allowed. You should change your Sanic instance to use instance.ctx._startup instead. #56

Closed
sooswastaken opened this issue Jan 6, 2022 · 1 comment

Comments

@sooswastaken
Copy link

sooswastaken commented Jan 6, 2022

When I run this code on sanic 21.12.0, it errors and can't run. It works on older versions of sanic though.

from sanic import Sanic, response
from sanic_cors import CORS
app = Sanic(__name__)
CORS(app)

@app.route("/")
async def index(request):
    return response.text("Hello, World!")

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=80)
@ashleysommer
Copy link
Owner

This is an incompatibility with Sanic-CORS v1.0.1 and Sanic v21.12.0
Please update to Sanic-CORS v2.0 to get compatibility with Sanic v21.12.0

adodge added a commit to adodge/chaiNNer that referenced this issue Feb 23, 2023
There's an incompatibility between sanic-cors 1.0.1 and sanic 21.12.0

ashleysommer/sanic-cors#56
joeyballentine pushed a commit to chaiNNer-org/chaiNNer that referenced this issue Feb 23, 2023
Bump sanic-cors to 2.2.0

There's an incompatibility between sanic-cors 1.0.1 and sanic 21.12.0

ashleysommer/sanic-cors#56
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

No branches or pull requests

2 participants