GithubHelp home page GithubHelp logo

sp-exhibition's Introduction

sp-exhibition

pip and virtualenv

To install third-party libraries, use virtualenv and pip. Pip allows us to easily install stuff, and virtualenv creates isolated python environments tied to specific projects.

Getting pip/virtualenv

Your installation of Python likely comes with both, but if not, install pip by following the instructions here. Then install virtualenv:

pip install virtualenv

You may need to run this as sudo:

sudo pip install virtualenv

Usage

First, create a virtualenv:

virtualenv venv

This will create a folder called venv in your current working directory. Note: you can use whatever name you like for your virtualenv.

Next you must activate the virtualenv:

source venv/bin/activate

Then you can install packages with pip:

pip install packagename
For jinja:
pip install -U Jinja2
pip install requests

Or simply install from the requirements.txt file:

$ pip install -r requirements.txt

Folders

  • Backend folder contains the python generator script (create-html) and the template files.
  • Frontend folder. This is where the generated pages end up. There is also a css and page assets here.
  • the html-pages is just where the html pages we develop can go. Before we configure them in the generator.

Running the page generator

The page generator uses Jinja:

https://palletsprojects.com/p/jinja/

To run the page generator in development mode (ie. not on a pi) we want the script to read the demo data from the demo-data folder. cd into the createHTML folder and run the python script with the DEV parameter.

python create_html.py DEV

This script will produce pages from page templates stored in the template folder. It takes the base template code and combines with the html in each of the template files. See this in line 88 and 89.

To add new pages, make new template files, and then add lines to this array in the create-html file to generate the pages.

sp-exhibition's People

Contributors

tegacodes avatar samseurynck avatar antiboredom avatar liyixun111 avatar

Watchers

 avatar  avatar  avatar

Forkers

yl8674

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.