Skip to content

Commit fa42dc7

Browse files
committed
[add] @new learn pipenv and pipfile usage
1 parent aa5eb9c commit fa42dc7

File tree

5 files changed

+123
-5
lines changed

5 files changed

+123
-5
lines changed

Pipfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
Flask = "===1.1.1"
10+
11+
[requires]
12+
python_version = "3.8"

Pipfile.lock

Lines changed: 95 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Playground repo for Python projects
2-
This repo has multiple branches and each branch represent different projects/proof of concepts for playing with Python technologies/frameworks.
3-
4-
P.S. `master` branch is empty and has only this `README.md` file
5-
1+
# Pipenv/Pipfile Understanding
2+
- `pipenv install` - Similar to `npm install`. Creates 2 files `Pipfile` and `Pipfile.lock` similar to `package-lock.json` in the javascript world with dependencies based on `requirements.txt`
3+
- `pipenv shell` - Activates the virtual environment. Much simpler than `virtualenv`
4+
- Once the shell is activated, run `python3 hello.py` to bring the Flask app UP!!
5+
- By default the flask app runs on 5000 port - `http://localhost:5000/hello`

hello.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
from flask import Flask
3+
# set the project root directory as the static folder, you can set others.
4+
app = Flask(__name__)
5+
6+
@app.route("/hello")
7+
def hello():
8+
return "Hello World!"
9+
10+
app.run(debug=True)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flask===1.1.1

0 commit comments

Comments
 (0)