Project 1 - Set Up Development Tools

Project 1 - Setup Development Tools

Overview

Set up all of the development tools on your local computer.

Demonstrated Skills

  • Set up Github repo
  • Set up development tools (VS Code, Git, Python/Django)

Project Goals

Set up a git repository stored at Github that will be used for all the code you will write for BACS 350. Your code repository will be forked from

https://github.com/Mark-Seaman/PythonWebApps

and named

https://github.com/your-name/PythonWebApps

User Stories

  • Install a new version of Python 3.10 to use for building Django apps
  • Setup Virtual Environment for Python Packages
  • Install Django library in Virtual Environment
  • Setup your Github repo with code from "Mark-Seaman/PythonWebApps"
  • Install Visual Studio Code
  • Clone repo with Visual Studio Code

Requirements

Business Requirements

  • You have created and debugged a Django application with your Profile
  • Your page displays your photo

Technical Requirements

Step 1 - Install Python Visual Code

Go to Visual Studio Code at https://code.visualstudio.com/

Download and install on your machine

Run Visual Studio

Install extension for Python in Visual Studio Code

Step 2 - Create Github Repo

Setup a git repository stored at Github that will be used for all the code you will write for BACS 350. All grading will be done by examining the code in this course repo.

  • Visit the Github website at https://github.com
  • Select a name that will be your permanent Github user name
  • Sign up for a free account at Github
  • Login to your account
  • Create a Git Repo
  • Use the Github website to create code repositories for each project
  • Create a git repository for this class
  • Build a repo named PythonWebApps
  • Example:
  • Use a .gitignore file for "Python"
  • Test .gitignore at the top of your repo
  • Make sure that the file has lots of content to avoid adding Python temp files to the Git repo.

Step 3 - Clone Your Git Repo

  • Run Visual Studio Code
  • If you are missing git, install it from "https://git-scm.com/downloads".
  • Clone repo from Github
  • Set permissions to access Github account from VS Code

Step 4 - Install Python 3

Install Python 3.10 from Python.org

Setup virtual env

$ python -m venv venv

$ source venv/bin/activate      # On Mac
$ source venv/Scripts/activate  # On Windows

Installing Python Packages

$ pip install django

Step 5 - Test Your Project

Create the database

$ python manage.py migrate

Run the web server

$ python manage.py runserver

Browse to the web page at http://localhost:8000

Change the photo at "project/01/static/me.jpg" and text at "demo/01/ProfileApp/templates/profile.html"

Refresh the browser.

Step 6 - Commit and Push Code

Commit your code from a terminal window

Add source code to the index for Git. This will stage the changes to be committed. The next step is to commit the changes into your local repository with the commit message to say what you did. Then you need to push all of the code changes to the remote repo at Github.

$ git add .

$ git commit -m 'Initial application'

$ git push


Complete and Continue