Skip to content

Commit f358066

Browse files
authored
Merge pull request #28 from aio-libs/updates_in_template_static_bg_docs
Updates in template static bg docs
2 parents 65753e0 + aeea8d0 commit f358066

File tree

11 files changed

+68
-41
lines changed

11 files changed

+68
-41
lines changed

Diff for: README.rst

+24-16
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,35 @@ Simple polls application with postgresql storage.
4848
:width: 460px
4949

5050

51-
Improvement plan
52-
----------------
53-
(in no particular order)
51+
Contributing
52+
------------
53+
Things you need for local development::
54+
55+
$ pip install -r requirements-dev.txt
5456

55-
- Update `polls` app and related `tutorial.rst` sections
57+
After that - follow setup instructions from particular demo project.
5658

57-
- [x] create configuration steps (venv, pip install, db initialization)
58-
- [x] fix or recreate tests
59-
- [ ] revise `tutorial.rst`
59+
To check documentation locally click the ``open file`` link from the output
60+
of this command::
6061

61-
- `tutorial.rst`
62+
$ make doc
6263

63-
- add "What's next" section
64+
To make sure everything is ok before committing::
6465

65-
- add Issues
66+
$ make ci
6667

67-
- engage community
6868

69-
- [ ] setup communication channels (gitter?)
70-
- [ ] discuss roadmap
71-
- [ ] issues
72-
- [ ] examples
69+
Improvement plan
70+
----------------
7371

74-
- in case of success - fix urls from `aiohttp/tutorial`
72+
Polls:
73+
74+
- [+] create configuration steps (venv, pip install, db initialization)
75+
- [+] fix or recreate tests
76+
- [~] revise `tutorial.rst`
77+
- [+] fix urls from `aiohttp/tutorial`
78+
- [x] setup communication channels (aio-libs gitter channel is enough)
79+
- [~] create missing issues
80+
- [+] add "Contributing" section
81+
- [ ] add "What's next" section
82+
- [ ] discuss roadmap

Diff for: demos/README.rst

-2
This file was deleted.

Diff for: demos/polls/README.rst

+21-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ similar to Django one.
88
Preparations
99
------------
1010

11+
Details could be found in :ref:`aiohttp-demos-polls-preparations-database`.
12+
In short.
13+
1114
Run Postgres DB server::
1215

1316
$ docker run --rm -it -p 5432:5432 postgres:10
1417

1518
Create db and populate it with sample data::
1619

17-
$ python tests/init_db.py
20+
$ python init_db.py
1821

1922

2023
Run
@@ -34,16 +37,30 @@ Open browser::
3437
Tests
3538
-----
3639

37-
Run integration tests::
40+
.. code-block:: shell
41+
42+
$ pytest tests
3843
39-
$ pytest tests/test_integration.py
44+
or:
4045

41-
or::
46+
.. code-block:: shell
4247
4348
$ pip install tox
4449
$ tox
4550
4651
52+
Development
53+
-----------
54+
Please review general contribution info at `README <https://github.com/aio-libs/aiohttp-demos#contributing>_`.
55+
56+
57+
Also for illustration purposes it is useful to show project structure when it changes,
58+
like in :ref:`aiohttp-demos-polls-preparations-project-structure`. Here is how you
59+
can do that::
60+
61+
$ tree -I "__pycache__|aiohttpdemo_polls.egg-info" --dirsfirst
62+
63+
4764
Requirements
4865
============
4966
* aiohttp_
6.8 KB
Loading

Diff for: demos/polls/aiohttpdemo_polls/static/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ li a {
33
}
44

55
body {
6-
background: white url("images/background.gif") no-repeat right bottom;
6+
background: white url("images/background.png") no-repeat;
77
}

Diff for: demos/polls/aiohttpdemo_polls/templates/results.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block content %}
66
<ul>
77
{% for choice in choices %}
8-
<li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes }}</li>
8+
<li>{{ choice.choice_text }} -- {{ choice.votes }} vote(s)</li>
99
{% endfor %}
1010
</ul>
1111

File renamed without changes.
File renamed without changes.

Diff for: demos/polls/tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from aiohttpdemo_polls.main import init_app
44
from aiohttpdemo_polls.settings import BASE_DIR, get_config
5-
from .init_db import (
5+
from init_db import (
66
setup_db,
77
teardown_db,
88
create_tables,

Diff for: docs/preparations.rst

+19-15
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ web projects:
2323
.. code-block:: none
2424
2525
.
26-
├── Makefile
27-
├── README.rst
2826
├── aiohttpdemo_polls
2927
│   ├── static
28+
│   │   ├── images
29+
│   │   │   └── background.png
3030
│   │   └── style.css
3131
│   ├── templates
3232
│   │   ├── 404.html
@@ -35,24 +35,28 @@ web projects:
3535
│   │   ├── detail.html
3636
│   │   ├── index.html
3737
│   │   └── results.html
38+
│   ├── db.py
3839
│   ├── __init__.py
3940
│   ├── __main__.py
40-
│   ├── db.py
4141
│   ├── main.py
4242
│   ├── middlewares.py
4343
│   ├── routes.py
44+
│   ├── settings.py
4445
│   ├── utils.py
4546
│   └── views.py
4647
├── config
47-
│   ├── polls.yaml
48-
│   └── polls_test.yaml
48+
│   ├── polls_test.yaml
49+
│   └── polls.yaml
50+
├── tests
51+
│   ├── conftest.py
52+
│   ├── __init__.py
53+
│   └── test_integration.py
54+
├── init_db.py
55+
├── Makefile
56+
├── README.rst
4957
├── requirements.txt
5058
├── setup.py
51-
└── tests
52-
   ├── __init__.py
53-
   ├── conftest.py
54-
   ├── init_db.py
55-
   └── test_integration.py
59+
└── tox.ini
5660
5761
5862
.. _aiohttp-demos-polls-preparations-environment:
@@ -80,16 +84,16 @@ environment. For example, ``$ pip install aiopg`` before database related sectio
8084
Check you python version (tutorial requires Python 3.5 or newer)::
8185

8286
$ python -V
83-
Python 3.6.3
87+
Python 3.6.5
8488

8589
Install ``aiohttp`` ::
8690

8791
$ pip install aiohttp
8892

89-
Check the aiohttp version (tutorial requires v2.0 or newer)::
93+
Check the aiohttp version::
9094

9195
$ python3 -c 'import aiohttp; print(aiohttp.__version__)'
92-
2.3.1
96+
3.1.3
9397

9498

9599
.. _aiohttp-demos-polls-preparations-database:
@@ -131,7 +135,7 @@ Use ``\l`` and ``\du`` *psql* commands to check results.
131135
.. note::
132136

133137
If you decided to run the application from the repo - this script
134-
( :download:`init_db.py <../demos/polls/tests/init_db.py>` ) will create db
138+
( :download:`init_db.py <../demos/polls/init_db.py>` ) will create db
135139
at running server, create tables and populate them with sample data ::
136140

137-
$ python tests/init_db.py
141+
$ python init_db.py

Diff for: docs/tutorial.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Helper script can do that for you. Create new file::
340340
Install ``aiopg[sa]`` package to interact with database and run the script::
341341

342342
$ pip install aiopg[sa]
343-
$ python aiohttpdemo_polls/init_db.py
343+
$ python init_db.py
344344

345345
.. note::
346346

0 commit comments

Comments
 (0)