Web Development with Python Step1

Step1 - Project Setup & Flask Basics

1.Create a project on GitHub

2.Open up the project on Replit and Vscode

Sign Up - Replit

 click save

3.Create and run a Flask web server

 

maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % pwd
/Users/maxwellpan/selflearn/maxwell-careers-website
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % ls -ltr
total 24
-rw-r--r--  1 maxwellpan  staff  1066 Apr 24 09:41 LICENSE
-rw-r--r--  1 maxwellpan  staff    67 Apr 24 09:41 README.md
-rw-r--r--  1 maxwellpan  staff    20 Apr 24 09:41 app.py
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % python3 -m venv .venv
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % . .venv/bin/activate
(.venv) maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % pip3 install Flask
Collecting Flask
  Using cached flask-3.0.3-py3-none-any.whl.metadata (3.2 kB)
Collecting Werkzeug>=3.0.0 (from Flask)
  Using cached werkzeug-3.0.2-py3-none-any.whl.metadata (4.1 kB)
Collecting Jinja2>=3.1.2 (from Flask)
  Using cached Jinja2-3.1.3-py3-none-any.whl.metadata (3.3 kB)
Collecting itsdangerous>=2.1.2 (from Flask)
  Using cached itsdangerous-2.2.0-py3-none-any.whl.metadata (1.9 kB)
Collecting click>=8.1.3 (from Flask)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting blinker>=1.6.2 (from Flask)
  Using cached blinker-1.7.0-py3-none-any.whl.metadata (1.9 kB)
Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->Flask)
  Using cached MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl.metadata (3.0 kB)
Using cached flask-3.0.3-py3-none-any.whl (101 kB)
Using cached blinker-1.7.0-py3-none-any.whl (13 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Using cached Jinja2-3.1.3-py3-none-any.whl (133 kB)
Using cached werkzeug-3.0.2-py3-none-any.whl (226 kB)
Using cached MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl (18 kB)
Installing collected packages: MarkupSafe, itsdangerous, click, blinker, Werkzeug, Jinja2, Flask
Successfully installed Flask-3.0.3 Jinja2-3.1.3 MarkupSafe-2.1.5 Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 itsdangerous-2.2.0
(.venv) maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website %

4.Push changes back to GitHub

maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git init
Reinitialized existing Git repository in /Users/maxwellpan/selflearn/maxwell-careers-website/.git/
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git add .
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   test.py

maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git commit -m "just add a test.py for testing"
[main 1e9ee1d] just add a test.py for testing
 1 file changed, 1 insertion(+)
 create mode 100644 test.py
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git remote add origin https://github.com/psmaxwell/maxwell-careers-website.git
error: remote origin already exists.
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % git push -u origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 301 bytes | 301.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/psmaxwell/maxwell-careers-website.git
   d428d5f..1e9ee1d  main -> main
branch 'main' set up to track 'origin/main'.
maxwellpan@maxwellpans-MacBook-Pro maxwell-careers-website % 

 

FYI:GitHub - psmaxwell/maxwell-careers-website: a career for web development with python

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值