Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b03db4a

Browse files
Merge pull request #159 from TTWShell/release/4.0.0
Release/4.0.0
2 parents d6506fd + bc389a4 commit b03db4a

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

‎README.md‎

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,47 @@ pipenv install -r requirements.txt --pre && pipenv install --dev pytest pytest-c
3131
pipenv shell
3232
```
3333

34-
## Run server:
34+
## flask cli:
35+
36+
```
37+
(demo) ➜ FLASK_APP=app.run:app flask
38+
Usage: flask [OPTIONS] COMMAND [ARGS]...
39+
40+
A general utility script for Flask applications.
41+
42+
An application to load must be given with the '--app' option, 'FLASK_APP'
43+
environment variable, or with a 'wsgi.py' or 'app.py' file in the current
44+
directory.
45+
46+
Options:
47+
-e, --env-file FILE Load environment variables from this file. python-
48+
dotenv must be installed.
49+
-A, --app IMPORT The Flask application or factory function to load, in
50+
the form 'module:name'. Module can be a dotted import
51+
or file path. Name is not required if it is 'app',
52+
'application', 'create_app', or 'make_app', and can be
53+
'name(args)' to pass arguments.
54+
--debug / --no-debug Set debug mode.
55+
--version Show the Flask version.
56+
--help Show this message and exit.
57+
58+
Commands:
59+
db Perform database migrations.
60+
routes Show the routes for the app.
61+
run Run a development server.
62+
shell Runs a shell in the app context.
63+
```
64+
65+
```
66+
(demo) ➜ FLASK_APP=app.run:app flask routes
67+
Endpoint Methods Rule
68+
------------ ------- -----------------------
69+
static GET /static/<path:filename>
70+
tools.option GET /api/options
71+
tools.ping GET /api/ping
72+
```
73+
74+
## Run server
3575

3676
```
3777
(demo) ➜ flask -A app/run.py run
@@ -41,6 +81,13 @@ WARNING: This is a development server. Do not use it in a production deployment.
4181
* Running on http://127.0.0.1:5000
4282
```
4383

84+
```
85+
➜ ~ curl http://127.0.0.1:5000/api/ping
86+
{"ping":"ok"}
87+
➜ ~ curl http://127.0.0.1:5000/api/options
88+
{}
89+
```
90+
4491
## Run test:
4592

4693
```
@@ -92,4 +139,10 @@ TOTAL 126 6 95%
92139

93140
```
94141
hobbit --help
142+
```
143+
144+
# dev
145+
146+
```
147+
pip install "hobbit-core[hobbit,hobbit_core]=={version}" --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/
95148
```

‎hobbit/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def format_commands(self, ctx, formatter):
9595
cls=HobbitGroup,
9696
epilog='More details: https://hobbit-core.readthedocs.io/zh/latest/',
9797
context_settings=CONTEXT_SETTINGS)
98-
@click.version_option()
98+
@click.version_option(package_name='hobbit_core')
9999
@click.option('--echo/--no-echo', default=False,
100100
help='Show the logs of command.')
101101
@click.pass_context

‎setup.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def gen_data(data_root='static'):
3232

3333
setup(
3434
name='hobbit-core',
35-
version='4.0.0rc0',
35+
version='4.0.0',
3636
python_requires='>=3.8, <4',
3737
description='Hobbit - A flask project generator.',
3838
long_description=long_description,
@@ -78,6 +78,6 @@ def gen_data(data_root='static'):
7878
],
7979
},
8080
entry_points={
81-
'console_scripts': 'hobbit = hobbit:main [hobbit]'
81+
'console_scripts': 'hobbit=hobbit:main'
8282
},
8383
)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /