Compare commits

..

No commits in common. '25cd1944e1672b09aec6a88ad0214a0ef26dcbcd' and '76b970dac6ebac08f31544f439fc9891c94083ae' have entirely different histories.

  1. 1
      .gitignore
  2. 5
      demo/routes.py
  3. 5
      demo/templates/index.html
  4. 1
      demo/views/frontend.py
  5. 7
      entry.py
  6. 2
      requirements.txt

1
.gitignore vendored

@ -1,3 +1,2 @@
venv
demo/__pycache__ demo/__pycache__
demo/views/__pycache__ demo/views/__pycache__

@ -1,7 +1,6 @@
from .views import frontend from .views import frontend
import aiohttp import aiohttp
def setup_routes(app): def setup_routes(app):
app.router.add_routes( app.router.add_routes([aiohttp.web.get('/', frontend.index), aiohttp.web.post('/button-clicked', frontend.button_clicked)])
[aiohttp.web.get('/', frontend.index), aiohttp.web.post('/button-clicked', frontend.button_clicked)])

@ -62,7 +62,6 @@
-moz-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5); -moz-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5); box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
} }
#myResult { #myResult {
text-align: center; text-align: center;
color: white; color: white;
@ -76,9 +75,7 @@
<h1>Знакомство с aiohttp</h1> <h1>Знакомство с aiohttp</h1>
<div id="root"> <div id="root">
<div class="form"> <div class="form">
<div class="form__button"> <div class="form__button"><button id='myButton'>Отправить</button></div>
<button id='myButton'>Отправить</button>
</div>
<p id="myResult"></p> <p id="myResult"></p>
</div> </div>
</div> </div>

@ -3,6 +3,7 @@ import aiohttp
from aiohttp_jinja2 import template from aiohttp_jinja2 import template
@template('index.html') @template('index.html')
async def index(request): async def index(request):
return {} return {}

@ -1,7 +1,14 @@
import aiohttp import aiohttp
from demo import create_app from demo import create_app
app = create_app() app = create_app()
if __name__ == '__main__': if __name__ == '__main__':
aiohttp.web.run_app(app) aiohttp.web.run_app(app)

@ -1,2 +0,0 @@
aiohttp~=3.8.4
Jinja2~=3.1.2
Loading…
Cancel
Save