Lesson 2 - Development Tools
Lesson 2 - Development Tools
Demo 1 - Profile App
Step 1 - Visual Studio Code
- Install Visual Studio Code
- https://code.visualstudio.com
- Download and run installer
- Install Python extension
Step 2 - Github
- Setup Github Account
- Visit my repo
- Fork the "PythonWebApps" Repo
Step 2 - Clone your repo
- Install Git if missing from https://git-scm.com$ git
- Run Visual Studio Code
- Menu - View, Source Control, Clone Repository
- Clone Your Web App Repo
Step 3 - Setup Python Environment
- Install Python 3
- Setup a Virtual Environment
- Installing Python Packages
Install Python 3
Don't use system Python
Install from https://www.python.org/
Setup command path for Python
$ which python Should be Python 3.10.6
Setup virtual env
Create and activate virtual environment
$ python -m venv venv $ source venv/bin/activate # On Mac $ .\venv\Scripts\activate # On Windows
If it doesn't work right away then use the installed version
Installing Python Packages
Install django
$ pip install django
Test the install of packages
$ django-admin
Running a Django Application
Run Development Server in Terminal
$ cd 01/ProfileApp $ python manage.py runserver
Browse to http://localhost:8000
Edit Code
- Run Visual Studio Code
- Open Folder
- Customize file
- 01/ProfileApp/templates/index.html
- Refresh browser
Examine Files
.
├── config
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── db.sqlite3
├── manage.py
├── static
│ ├── images
│ │ ├── black_widow.jpg
│ │ ├── hulk.jpg
│ │ └── iron_man.jpg
│ ├── index.html
│ └── style.css
└── templates
└── index.html