Skip to content

Commit 4445109

Browse files
committed
first commit
Signed-off-by: Peng Xiao <[email protected]>
0 parents  commit 4445109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2132
-0
lines changed

.coveragerc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[run]
2+
source = skeleton
3+
omit =
4+
skeleton/tests/*
5+
*/__init__.py
6+
7+
[report]
8+
exclude_lines =
9+
def __repr__
10+
def __str__
11+
def parse_args
12+
pragma: no cover
13+
raise NotImplementedError
14+
if __name__ == .__main__.:
15+
16+
ignore_errors = True

.gitignore

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
48+
# Translations
49+
*.mo
50+
*.pot
51+
52+
# Django stuff:
53+
*.log
54+
local_settings.py
55+
56+
# Flask stuff:
57+
instance/
58+
.webassets-cache
59+
60+
# Scrapy stuff:
61+
.scrapy
62+
63+
# Sphinx documentation
64+
docs/_build/
65+
66+
# PyBuilder
67+
target/
68+
69+
# IPython Notebook
70+
.ipynb_checkpoints
71+
72+
# pyenv
73+
.python-version
74+
75+
# celery beat schedule file
76+
celerybeat-schedule
77+
78+
# dotenv
79+
.env
80+
81+
# virtualenv
82+
venv/
83+
ENV/
84+
85+
# Spyder project settings
86+
.spyderproject
87+
88+
# Rope project settings
89+
.ropeproject
90+
91+
*.sqlite

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Hacking Guide
2+
3+
## Code style
4+
5+
Step 1: Read http://www.python.org/dev/peps/pep-0008/
6+
7+
Step 2: Read http://www.python.org/dev/peps/pep-0008/ again
8+
9+
Step 3: Read on
10+
11+
## Running Tests
12+
13+
Run tox
14+
15+
```
16+
$ cd skeleton
17+
$ tox
18+
```

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:2.7.14-alpine
2+
3+
LABEL author="Peng Xiao <[email protected]>"
4+
5+
RUN apk add --no-cache gcc musl-dev openssl-dev libffi-dev
6+
COPY . /skeleton
7+
WORKDIR /skeleton
8+
RUN pip install -r requirements.txt
9+
EXPOSE 5000
10+
ENTRYPOINT ["sh", "scripts/dev.sh"]

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2016 Michael Herman
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Flask Skeleton
2+
3+
Flask starter project...
4+
5+
## Quick Start
6+
7+
### Basics
8+
9+
1. Activate a virtualenv
10+
1. Install the requirements
11+
12+
### Set Environment Variables
13+
14+
Update *skeleton/server/config.py*, and then run:
15+
16+
```sh
17+
$ export APP_SETTINGS="skeleton.server.config.DevelopmentConfig"
18+
```
19+
20+
or
21+
22+
```sh
23+
$ export APP_SETTINGS="skeleton.server.config.ProductionConfig"
24+
```
25+
26+
### Create DB
27+
28+
```sh
29+
$ python manage.py create_db
30+
$ python manage.py db init
31+
$ python manage.py db migrate
32+
$ python manage.py create_admin
33+
$ python manage.py create_data
34+
```
35+
36+
### Run the Application
37+
38+
```sh
39+
$ python manage.py runserver
40+
```
41+
42+
So access the application at the address [http://localhost:5000/](http://localhost:5000/)
43+
44+
> Want to specify a different port?
45+
46+
> ```sh
47+
> $ python manage.py runserver -h 0.0.0.0 -p 8080
48+
> ```
49+
50+
### Testing1
51+
52+
```
53+
$ tox
54+
```
55+
56+
## Docker
57+
58+
```
59+
docker run -d -p 8080:5000 imooc-course/docker-cloud-demo:latest
60+
```

0 commit comments

Comments
 (0)