Giter Site home page Giter Site logo

victorkane / contact-app-vscode Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 59 KB

Hypermedia Systems Contacts App up and running in VS Code virtual environment

Python 6.09% JavaScript 87.55% CSS 0.76% HTML 5.59%
flask htmx hypermedia python hypermedia-systems

contact-app-vscode's Introduction

Contacts App

Setup

Install from repo

  • Based on book Hypermedia Systems by Carson Gross, Adam Stepinski, and Deniz Akşimşek; and their example app copied from bigskysoftware / contact-app
  • I'm going step by step, from the original "Web 1.0" hypermedia version onwards.
  • If you are working from this repo then open a system terminal and do the following (I'm on Linux Ubuntu with Python 3.8.10):
victor@victorpc:dev$ mkdir contact-app
victor@victorpc:dev$ cd contact-app
victor@victorpc:contact-app$ ls -l
total 0
victor@victorpc:contact-app$
  • copy in all files from repo (except .git dir)
  • add in our .vscode
victor@victorpc:contact-app$ cat .gitignore
env
.venv
__pycache__
/venv/
victor@victorpc:contact-app$
  • add in our .vscode/settings.json
victor@victorpc:contact-app$ cat .vscode/settings.json
{
  "workbench.preferredDarkColorTheme": "Default Dark Modern",
  "workbench.colorTheme": "Noctis Azureus",
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter"
  },
  "python.formatting.provider": "none"
}
  • In the terminal, do
code .

Open a terminal within VS Code to create virtual environment

victor@victorpc:contact-app$ python3 -m venv .venv
  • Perform developer reload window from command palette
  • now there appears a yellow warning on bash label in upper bar of terminal; hover over, and click on relaunch terminal link at bottom
  • If the Terminal doesn't restart, do a Terminal / New Terminal, should see (.venv) prefix showing environment activated:
  • (.venv) victor@victorpc:contact-app$

Install Flask and other dependencies

(.venv) victor@victorpc:contact-app$ pip install -r requirements.txt

Run app!

  • Open app.py in the editor (recognized as python program)
  • To run:
    • From menu: Run > Run without debugging
    • right button then select "Run Python file in Terminal"
    • or open another terminal and type (.venv) victor@victorpc:contact-app$ /home/victor/Work/Learn/Python/HypermediaSystemsBook/dev/contact-app/.venv/bin/python /home/victor/Work/Learn/Python/HypermediaSystemsBook/dev/contact-app/app.py
      • or simply python app.py

View in browser

  • Point browser at http://127.0.0.1:5000, it redirects to http://127.0.0.1:5000/contacts and the contacts are listed on the page

contact-app-vscode's People

Contributors

victorkane avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.