UNC BACS 350

Web Apps with Python/Django

Logo

Project 3 - Web App Hosting

Goals

Steps

Get Ready

Setup your web server

Step 1 - Create a virtual environment at Python Anywhere

Step 2 - Install Django in the environment

Run Terminal Window

Step 3 - Clone your git repository

Step 4 - Create Web App

Create Web App

Configure the Code Settings

Configure Web App

Configure the Code Startup

WSGI.py - Web Service Gateway Interface

/var/www/markseaman_pythonanywhere_com_wsgi.py

# +++++++++++ DJANGO +++++++++++
# To use your own django app use code like this:
import os
import sys

## assuming your django settings file is at '/home/markseaman/BACS350/week3/Superhero/settings.py'
## and your manage.py is is at '/home/markseaman/BACS350/week3/Superhero/manage.py'
path = '/home/markseaman/BACS350/week3/Superhero'
if path not in sys.path:
    sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings'

## then:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Python Anywhere Static Files

Python Anywhere Database

Step 5 - Debug and Test

Startup the Server

Debug and Test

Read the Log

Register your server

Requirements