Skip to content

Commit f248358

Browse files
author
Vic Shóstak
committed
Update npm dependencies, switch to Pipenv, rebase install.py
1 parent 23b1eb0 commit f248358

File tree

8 files changed

+407
-232
lines changed

8 files changed

+407
-232
lines changed

Pipfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[packages]
9+
10+
bottle = "*"
11+
bottle-sqlalchemy = "*"
12+
"Jinja2" = "*"
13+
MarkupSafe = "*"
14+
SQLAlchemy = "*"
15+
16+
17+
[dev-packages]
18+

Pipfile.lock

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![bottle-vue-kickstart-main](https://cloud.githubusercontent.com/assets/11155743/24041455/9fbd99ec-0b1e-11e7-9ba0-a429a28591b0.jpg)
22

33
# Very basic kickstart Bottle kit with Vue.js
4-
[![GitHub release](https://img.shields.io/badge/version-0.4.1-brightgreen.svg?style=flat-square)](https://github.com/koddr/bottle-vue-kickstart) [![licence](https://img.shields.io/badge/Python-2.7_or_3.4+-red.svg?style=flat-square)](https://www.python.org/downloads/) [![licence](https://img.shields.io/badge/licence-MIT-blue.svg?style=flat-square)](https://github.com/koddr/bottle-vue-kickstart/blob/master/LICENSE.md)
4+
[![GitHub release](https://img.shields.io/badge/version-0.4.2-brightgreen.svg?style=flat-square)](https://github.com/koddr/bottle-vue-kickstart) [![licence](https://img.shields.io/badge/Python-2.7_or_3.4+-red.svg?style=flat-square)](https://www.python.org/downloads/) [![licence](https://img.shields.io/badge/licence-MIT-blue.svg?style=flat-square)](https://github.com/koddr/bottle-vue-kickstart/blob/master/LICENSE.md)
55

66
Simplify development of reactive web applications on [Bottle](http://bottlepy.org/) – lightweight WSGI micro web-framework for Python! A simple process of installing and deploying. Everything has already been done for you. Just enjoy writing your code!
77

@@ -33,16 +33,19 @@ $ npm install && npm run build
3333

3434
Third, prepare your virtual environment:
3535

36+
Since `0.4.2` we use [Pipenv](https://github.com/pypa/pipenv) project for manage virtual environments.
37+
3638
```bash
37-
$ python3 -m venv venv
38-
$ source venv/bin/activate
39+
$ pip install pipenv
3940
```
4041

41-
Next, install Bottle and all extensions:
42+
> More info here: https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies
43+
44+
Next, install Bottle with all extensions and go to your environment shell:
4245

4346
```bash
44-
(venv) $ pip install -r requirements.txt
45-
(venv) $ deactivate
47+
$ pipenv install
48+
$ pipenv shell
4649
```
4750

4851
Finally, run development server:
@@ -63,7 +66,7 @@ Hit Ctrl-C to quit.
6366
(Optional) Install database with example objects:
6467
6568
```bash
66-
$ python3 install.py
69+
$ python3 _devtools/install_init_database.py
6770
```
6871
6972
Now, your yellow section on http://localhost:8080/ will look like this:
@@ -75,6 +78,8 @@ And we done!
7578
## Final app structure
7679
7780
``` html
81+
├── _devtools
82+
│   └── install_init_database.py
7883
├── static
7984
│   ├── assets
8085
│   │   ├── js
@@ -92,9 +97,8 @@ And we done!
9297
│   └── layout
9398
│   └── base.html
9499
├── articles.db
95-
├── install.py
96100
├── package.json
97-
├── requirements.txt
101+
├── Pipfile
98102
├── run.py
99103
└── webpack.config.js
100104
```

install.py renamed to _devtools/install_init_database.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# Import Python packages
2-
import os.path, sqlite3
2+
import os, sqlite3
3+
4+
# Define DB file
5+
db_file = 'articles.db'
36

47
# Check if database file `articles.db` already exist
5-
if os.path.isfile('articles.db'):
8+
if os.path.isfile(db_file):
69
# If exist...
710
# Print error message
811
print('[ERROR] Database file already exists. Delete them first and try again.')
912
else:
1013
# Else...
1114
# Create database `articles`
12-
db = sqlite3.connect('articles.db')
15+
db = sqlite3.connect(db_file)
1316
db.execute(
1417
"CREATE TABLE articles ("
1518
"id INTEGER PRIMARY KEY, "

0 commit comments

Comments
 (0)