GithubHelp home page GithubHelp logo

isabella232 / shortstack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfpb/shortstack

0.0 0.0 0.0 390 KB

An extensible site rendering system

License: Creative Commons Zero v1.0 Universal

Python 96.45% CSS 0.06% HTML 3.48%

shortstack's Introduction

image

Shortstack

Current Status

Shortstack was an experiment to extract a more general-purpose tool from _Sheer.

We've decided to go forward with Django, instead, and will most likely not be revisiting this project.

Today

Shortstack is a Python web application that does a very simple thing: render Jinja2 templates from an on-disk project folder that resembles a traditional website (so, the URL /foo/ will be served by the template foo/index.html). You might find it useful for prototypes and simple websites.

Make it go

Serve a site ~~~~~

We're working on a simpler demo project, but in the meantime, give it a try with Owning a Home!

Follow the instructions to build the front-end resources (node, grunt, bower, etc) while ignoring the stuff about Sheer and Elasticsearch.

Make and activate a new virtualenv using your favorite method (we like virtualenvwrapper), and check out this repository to a folder on your computer somewhere.

Install shortstack (and all of it's dependencies) into your virtualenv with:

pip install -e /path/to/shortstack

Then, start the local server with:

cd /path/to/owning-a-home/dist/

shorts serve --url /owning-a-home/

You should then be able to open your web browser to http://localhost:7000/ and view the site!

What just happened?

The page you're looking at has been rendered through Jinja2. You may have noticed that you were redirected to /owning-a-home/. This "site" was actually built to be deployed at that path on a server, so we passed that --url argument so that links keep working.

Build a static site

Let's also build a static HTML version of that site. It's as easy as:

cd /path/to/owning-a-home/dist/

shorts build --url /owning-a-home/

The generated site is now in the _build directory, which you can serve with any other web server (like Apache or nginx). Let's try it with the simple web server that comes with Python.

:

cd /path/to/owning-a-home/dist/_build/

# Python 2: python -m SimpleHTTPServer

# Python3: python -m http.server 8000

Run the tests

We use tox to test against Python versions 2.6,2.7,3.3, and 3.4

cd /path/to/shortstack
pip install tox
tox

If you are missing any of those Python versions, tox will complain. You can limit tox to testing a particular python, like so:

tox -e py27,py34

If you just want to see the coverage report, or pylint output:

tox -e coverage
tox -e pylint

Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy

shortstack's People

Contributors

rosskarchner avatar dpford avatar scotchester 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.