Lesson 7 - Python Anywhere
LEARN
Web Hosting with Python Anywhere
- Free accounts for Django Hosting
- Register your account on Student Dashboard
Why use Python Anywhere
- Suitable for Simple & Intermediate sites
- Automates many complex tasks
- Great for beginners
- Python Anywhere
How to set up Django Hosting at Python Anywhere
- Watch video tutorial (7 steps)
Sign up for Account
- Plans & Pricing
- Sign up for free account
Learn Linux Commands
- Master a few command line basics
- Read Command Line
- Essential Linux commands: pwd, cd, ls
BUILD
Create a Web App
- Steps to deploy your app
- 1 - Create a virtual environment at Python Anywhere
- 2 - Install Django
- 3 - Git Clone
- 4 - Create Web App
- 5 - Debug and Test
Run Terminal Window
- Select "Consoles, New console, Bash"
- pwd
- cd
- ls -al
Clone your git repository
- Visit your Github Repo
-
Clone your repo (this is mine)
git clone https://github.com/Mark-Seaman/BACS350.git
Create Virtual Environment
- Create an isolated python environment
- mkvirtualenv --python=/usr/bin/python3.8 .venv
- Install Django in the environment
- pip install django
Create Web App
- Visit your main page
- Login to Python Anywhere account
- Bookmark this page on your bookmark toolbar
- Select Web tab in top menu
Configure Your Web App
- Your Python Anywhere account supports one free Web App
- Free accounts must be enabled every three months
- Click on "Run until 3 months from today" button
- This is not a problem for when you are actively developing code
Configure Web App
- Find your source code
- Modify your code for Python Anywhere
- Create WSGI connection
- Allow host at "markseaman.pythonanywhere.com"
- Setup static server
- Run the server
- Load the page
- Debug