Code Monkey home page Code Monkey logo

djangostocks's Introduction

Django Quotes

A simple app that reads and presents stock data from JSON

Data

Data for the application is found in ./quotes/static/quotes_data.json. It's called via HTTP to mimic the spirit of an external API request. The URL can be defined via settings in .env.

Running Locally with manage.py runserver

Requirements:

  • Python 3 (tested and written on 3.6.5)
  • pip
  • Virtualenv recommended

Check out the repository, then:

$ cd djangostocks
# Create and activate virtualenv
$ virtualenv .
$ source bin/activate

$ pip install -r requirements.txt
$ ./startserver.sh

The app is available at http://localhost:8000/

Running Locally with docker

Install docker for your platform, then clone the repository and build the container:

$ cd djangostocks
$ docker build -t djangostocks .
$ docker run -it -p 8000:8000 djangostocks

The app is available at http://localhost:8000/

If you want to work interactively and let django runserver restart when it detects code changes, mount your working directory to the application like so:

$ docker run -it -p 8000:8000 -v $(pwd):/app djangostocks

You may also customize .env settings via --env:

docker run -it -p 8000:8000 --env QUOTES_URL=http://example.com/other_file.json djangostocks

Running locally with docker-compose

Install docker and the docker-compose tool. The docker-compose.yml file sets up a two container stack to handle static files via nginx, as an example of a "production" style deployment.

docker-compose up

The app is available at http://localhost:8000/

djangostocks's People

Contributors

mshade avatar

Watchers

 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.