Updated asyncio debugging.
This commit is contained in:
parent
c745f60997
commit
3ccbe8be5c
@ -9,8 +9,8 @@ services:
|
||||
environment:
|
||||
- PYTHONDONTWRITEBYTECODE="1"
|
||||
- PYTHONUNBUFFERED="1"
|
||||
entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
||||
#["python","-m","snek.app"]
|
||||
#entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"]
|
||||
entrypoint: ["python","-m","snek.app"]
|
||||
snecssh:
|
||||
build:
|
||||
context: .
|
||||
|
@ -1,5 +1,7 @@
|
||||
import pathlib
|
||||
|
||||
import asyncio
|
||||
|
||||
from aiohttp import web
|
||||
from aiohttp_session import (
|
||||
get_session as session_get,
|
||||
@ -29,6 +31,7 @@ from snek.view.web import WebView
|
||||
from snek.view.upload import UploadView
|
||||
from snek.view.search_user import SearchUserView
|
||||
|
||||
|
||||
SESSION_KEY = b"c79a0c5fda4b424189c427d28c9f7c34"
|
||||
|
||||
|
||||
@ -121,8 +124,11 @@ class Application(BaseApplication):
|
||||
return await super().render_template(template, request, context)
|
||||
|
||||
|
||||
app = Application(db_path="sqlite:///snek.db")
|
||||
async def main():
|
||||
app = Application(db_path="sqlite:///snek.db")
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.set_debug(True)
|
||||
await web._run_app(app, port=8081, host="0.0.0.0")
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
web.run_app(app, port=8081, host="0.0.0.0")
|
||||
asyncio.run(main())
|
||||
|
Loading…
Reference in New Issue
Block a user