Skip to content

Commit 9a02486

Browse files
Arfeyjettify
authored andcommitted
updated the code to new version of aiohttp, fixed some typos and decorated html (#339)
1 parent 39ceaca commit 9a02486

10 files changed

Lines changed: 46 additions & 26 deletions

File tree

demos/blog/README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Installation
88

99
Clone repo and install library::
1010

11-
$ git clone git@github.com:aio-libs/aiohttp_admin.git
11+
$ git clone https://github.com/aio-libs/aiohttp_admin.git
1212
$ cd aiohttp_admin
1313
$ pip install -e .
1414
$ pip install -r requirements-dev.txt
@@ -32,6 +32,10 @@ Open browser::
3232

3333
http://127.0.0.1:9001/admin
3434

35+
Login::
36+
37+
username: admin
38+
password: admin
3539

3640
Requirements
3741
============

demos/blog/aiohttpdemo_blog/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def init(loop):
6767
app, loader=jinja2.FileSystemLoader(str(TEMPLATES_ROOT)))
6868

6969
admin = setup_admin(app, pg)
70-
app.router.add_subapp('/admin/', admin)
70+
app.add_subapp('/admin/', admin)
7171

7272
# setup views and routes
7373
handler = SiteHandler(pg)
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>aiohttp admid blog demo</title>
65
<meta name="viewport" content="width=device-width">
6+
<title>aiohttp admid blog demo</title>
77
</head>
88
<body>
9-
<h1>Blog admin demo: <a href="/admin">admin page</a></h1>
9+
<h1>Blog admin demo: <a href="/admin">admin page</a></h1>
1010
</body>
11+
</html>

demos/blog/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def read_version():
2323
'trafaret',
2424
'aiohttp_jinja2',
2525
'pyyaml',
26-
'aiopg']
26+
'aiopg',
27+
'faker']
2728

2829

2930
setup(name='aiohttpdemo_blog',

demos/motortwit/README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installation
99

1010
Clone repo and install library::
1111

12-
$ git clone git@github.com:aio-libs/aiohttp_admin.git
12+
$ git clone https://github.com/aio-libs/aiohttp_admin.git
1313
$ cd aiohttp_admin
1414
$ pip install -e .
1515
$ pip install -r requirements-dev.txt
@@ -33,6 +33,10 @@ Open browser::
3333

3434
http://127.0.0.1:9001/admin
3535

36+
Login::
37+
38+
username: admin
39+
password: admin
3640

3741
Requirements
3842
============

demos/motortwit/motortwit/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async def init(loop):
6868
setup_jinja(app)
6969

7070
admin = setup_admin(app, mongo)
71-
app.router.add_subapp('/admin', admin)
71+
app.add_subapp('/admin', admin)
7272

7373
app.router.add_static('/static', path=str(PROJ_ROOT / 'static'))
7474

demos/polls/README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installation
99

1010
Clone repo and install library::
1111

12-
$ git clone git@github.com:aio-libs/aiohttp_admin.git
12+
$ git clone https://github.com/aio-libs/aiohttp_admin.git
1313
$ cd aiohttp_admin
1414
$ pip install -e .
1515
$ pip install -r requirements-dev.txt
@@ -33,6 +33,10 @@ Open browser::
3333

3434
http://127.0.0.1:9002/admin
3535

36+
Login::
37+
38+
username: admin
39+
password: admin
3640

3741
Requirements
3842
============
Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
<link rel="stylesheet" type="text/css"
2-
href="{{ url('static', filename='style.css') }}" />
3-
4-
{% if questions %}
5-
<ul>
6-
{% for question in questions %}
7-
<li><a href="{{ url('poll', question_id=question.id) }}">{{ question.question_text }}</a></li>
8-
{% endfor %}
9-
</ul>
10-
{% else %}
11-
<p>No polls are available.</p>
12-
{% endif %}
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width">
6+
<title>aiohttp admid polls demo</title>
7+
<link rel="stylesheet" type="text/css" href="{{ url('static', filename='style.css') }}" />
8+
</head>
9+
<body>
10+
<h1>Poll admin demo: <a href="/admin">admin page</a></h1>
11+
{% if questions %}
12+
<ul>
13+
{% for question in questions %}
14+
<li><a href="{{ url('poll', question_id=question.id) }}">{{ question.question_text }}</a></li>
15+
{% endfor %}
16+
</ul>
17+
{% else %}
18+
<p>No polls are available.</p>
19+
{% endif %}
20+
</body>
21+
</html>

demos/polls/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def read_version():
2323
'trafaret',
2424
'aiohttp_jinja2',
2525
'pyyaml',
26-
'aiopg']
26+
'aiopg',
27+
'faker']
2728

2829

2930
setup(name='aiohttpdemo_polls',

demos/polls/static/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
li a {
22
color: green;
33
}
4-
5-
body {
6-
background: white url("images/background.gif") no-repeat right bottom;
7-
}

0 commit comments

Comments
 (0)