Skip to content

Commit dbc8971

Browse files
authored
Merge pull request #17 from TTWShell/release/1.2.0
Release/1.2.0
2 parents 85ad45c + c9f5761 commit dbc8971

File tree

5 files changed

+306
-64
lines changed

5 files changed

+306
-64
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
[![Documentation Status](https://readthedocs.org/projects/hobbit-core/badge/?version=latest)](https://hobbit-core.readthedocs.io/en/latest/?badge=latest)
55
[![](https://img.shields.io/:license-mit-blue.svg?style=flat-square)](https://hobbit-core.mit-license.org)
66

7-
A flask project generator.
7+
A flask project generator. Based on Flask + SQLAlchemy + marshmallow + webargs.
88

9-
[Readmedocs](https://hobbit-core.readthedocs.io/en/latest/)
9+
[https://hobbit-core.readthedocs.io/en/latest/](https://hobbit-core.readthedocs.io/en/latest/)

docs/api.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Hobbit-core's API Documentation
2+
===============================
3+
4+
hobbit_core.hobbit
5+
------------------
6+
7+
hobbit - A flask project generator.
8+
9+
.. autofunction:: hobbit_core.hobbit.bootstrap.startproject
10+
11+
hobbit_core.flask_hobbit
12+
------------------------
13+
14+
A flask extension that take care of base utils.
15+
16+
.. automodule:: hobbit_core.flask_hobbit
17+
:members:
18+
:undoc-members:
19+
20+
db
21+
^^
22+
23+
.. automodule:: hobbit_core.flask_hobbit.db
24+
:members:
25+
:undoc-members:
26+
:exclude-members: SurrogatePK
27+
28+
.. autoclass:: SurrogatePK
29+
:members: __repr__
30+
31+
pagination
32+
^^^^^^^^^^
33+
34+
.. automodule:: hobbit_core.flask_hobbit.pagination
35+
:members:
36+
:undoc-members:
37+
38+
schemas
39+
^^^^^^^
40+
41+
.. automodule:: hobbit_core.flask_hobbit.schemas
42+
:members:
43+
:undoc-members:
44+
:exclude-members: PagedSchema
45+
46+
.. autoclass:: PagedSchema
47+
:members:
48+
49+
utils
50+
^^^^^
51+
52+
.. automodule:: hobbit_core.flask_hobbit.utils
53+
:members:
54+
:undoc-members:
55+
56+
57+
response
58+
^^^^^^^^
59+
60+
.. automodule:: hobbit_core.flask_hobbit.response
61+
:members:
62+
:undoc-members:
63+
64+
err_handler
65+
^^^^^^^^^^^
66+
67+
.. automodule:: hobbit_core.flask_hobbit.err_handler
68+
:members:
69+
70+
71+

docs/changelog.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Change history
22
==============
33

4-
1.2.0 (unreleased)
4+
1.2.0 (2018-10-10)
55

66
* Gitlab CI/CD support.
7-
* Some useful cmds.
7+
* Add secure_filename util.
8+
* Enhance deploy, can deploy to multiple servers.
9+
* Add --port option for startproject cmd.
810

911
1.1.0 (2018-09-29)
1012
******************

docs/index.rst

Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
Welcome to hobbit-core's documentation!
2-
=======================================
1+
Hobbit-core's documentation
2+
===========================
33

44
`changelog <changelog.html>`_ //
55
`github <https://github.com/TTWShell/hobbit-core>`_ //
66
`pypi <https://pypi.org/project/hobbit-core/>`_ //
7-
`issues <https://github.com/TTWShell/hobbit-core/issues>`_
7+
`issues <https://github.com/TTWShell/hobbit-core/issues>`_ //
8+
`API doc <api.html>`_ //
9+
`中文文档 <index_cn.html>`_
10+
11+
A flask project generator. Based on Flask + SQLAlchemy + marshmallow + webargs.
12+
13+
A hobbit app contains RESTful API, unit test, gitlab-ci/cd、docker compose etc.
814

915
**Why do we need this project?** Answer is `Convention over configuration. <https://en.wikipedia.org/wiki/Convention_over_configuration>`_
1016

@@ -18,7 +24,7 @@ Get it right now::
1824

1925
Create your flask project::
2026

21-
hobbit --echo startproject -n demo -d . --example
27+
hobbit --echo startproject -n demo -d . --example -p 5000
2228

2329
Run flask app::
2430

@@ -46,6 +52,7 @@ Project Tree
4652
If not skip example(Please see --example/--no-example options), you can get project tree like this::
4753

4854
.
55+
├── Dockerfile
4956
├── app
5057
│   ├── __init__.py
5158
│   ├── configs
@@ -69,13 +76,21 @@ If not skip example(Please see --example/--no-example options), you can get proj
6976
│   └── views
7077
│   ├── __init__.py
7178
│   └── example.py
79+
├── deploy.sh
80+
├── docker-compose.yml
7281
├── docs
82+
├── logs
7383
├── requirements.txt
7484
└── tests
7585
├── __init__.py
7686
├── conftest.py
7787
└── test_example.py
7888

89+
Dockerfile
90+
----------
91+
92+
Build image for run web server. For more information about dockerfile, please visit : `Dockerfile reference <https://docs.docker.com/engine/reference/builder/#usage>`_.
93+
7994
app
8095
---
8196

@@ -86,86 +101,65 @@ configs
86101

87102
In a hobbit app, we auto load config by FLASK_ENV. If FLASK_ENV=production, used ``configs/production.py`` file.
88103

89-
exts
104+
core
90105
^^^^
91106

92-
`Why use exts.py to instance extension? <https://stackoverflow.com/questions/42909816/can-i-avoid-circular-imports-in-flask-and-sqlalchemy/51739367#51739367>`_
93-
107+
All complicated function, base class etc.
94108

95-
API
96-
===
97-
98-
hobbit_core.hobbit
99-
------------------
100-
101-
hobbit - A flask project generator.
102-
103-
.. autofunction:: hobbit_core.hobbit.bootstrap.startproject
109+
exts.py
110+
^^^^^^^
104111

105-
hobbit_core.flask_hobbit
106-
------------------------
112+
To avoid circular imports in Flask and flask extention, exts.py used. `Why use exts.py to instance extension? <https://stackoverflow.com/questions/42909816/can-i-avoid-circular-imports-in-flask-and-sqlalchemy/51739367#51739367>`_
107113

108-
A flask extension that take care of base utils.
114+
models
115+
^^^^^^
109116

110-
.. automodule:: hobbit_core.flask_hobbit
111-
:members:
112-
:undoc-members:
117+
Create your models here.
113118

114-
db
115-
^^
119+
run.py
120+
^^^^^^
116121

117-
.. automodule:: hobbit_core.flask_hobbit.db
118-
:members:
119-
:undoc-members:
120-
:exclude-members: SurrogatePK
122+
schemas
123+
^^^^^^^
121124

122-
.. autoclass:: SurrogatePK
123-
:members: __repr__
125+
Create your marshmallow scheams here.
124126

125-
pagination
126-
^^^^^^^^^^
127+
utils
128+
^^^^^
127129

128-
.. automodule:: hobbit_core.flask_hobbit.pagination
129-
:members:
130-
:undoc-members:
130+
All common utils here.
131131

132-
schemas
133-
^^^^^^^
132+
views
133+
^^^^^
134134

135-
.. automodule:: hobbit_core.flask_hobbit.schemas
136-
:members:
137-
:undoc-members:
138-
:exclude-members: PagedSchema
135+
Create your views here.
139136

140-
.. autoclass:: PagedSchema
141-
:members:
137+
deploy.sh
138+
---------
142139

143-
utils
144-
^^^^^
140+
A script for deploy.
145141

146-
.. automodule:: hobbit_core.flask_hobbit.utils
147-
:members:
148-
:undoc-members:
142+
docker-compose.yml
143+
^^^^^^^^^^^^^^^^^^
149144

145+
Base docker compose file. Run app::
150146

151-
response
152-
^^^^^^^^
147+
docker-compose up
153148

154-
.. automodule:: hobbit_core.flask_hobbit.response
155-
:members:
156-
:undoc-members:
149+
docs
150+
----
157151

158-
err_handler
159-
^^^^^^^^^^^
152+
API doc etc.
160153

161-
.. automodule:: hobbit_core.flask_hobbit.err_handler
162-
:members:
154+
logs
155+
----
163156

157+
All logs for app, nginx etc.
164158

165-
Indices and tables
166-
==================
159+
tests
160+
-----
167161

168-
* :ref:`search`
162+
Create your tests here. Recommended use `pytest <https://docs.pytest.org/en/latest/>`_.
169163

170164

171165
Others
@@ -175,3 +169,4 @@ Others
175169
:maxdepth: 2
176170

177171
changelog
172+
api

0 commit comments

Comments
 (0)