Giter Club home page Giter Club logo

lcp-website's Introduction

LCP Website - Flask app

How to download the project contents

# Pull down the project contents
git clone https://github.com/MIT-LCP/lcp-website.git

# Change to the project directory
cd lcp-website

# Create a new Python3.5+ virtual environment
python3 -m venv env

# Activate the virtual environment
source env/bin/activate

# Install the package requirements
pip install -r requirements.txt

# When finished with everything:
# De-activate the virtual environment
deactivate

How to run the server locally

# Change to the project directory
cd lcp-website

# Activate the virtual environment
source env/bin/activate

# Copy the .env.example file:
cp config/.env.example .env

# Run the Flask App on localhost
# http://127.0.0.1:5000/
flask run

# When finished viewing the webpage:
# Quit the Flask App
<CTRL>+C

# When finished with everything:
# De-activate the virtual environment
deactivate

Deploying to the Bare Repository

Before deploying for the first time, make sure to set the variables in the post-receive file in the bare repository.

Add the remote bare repositories from your local development machines:

git remote add <production> <user>@<address>:/home/webuser/lcp-website.git

Push to the remotes when appropriate

git push <production> <production>

General Information

A bit of information for the main script files.

  • change.py - Takes as input three different lcp_references.html files and changes them to the version in the website
  • config.py - Has the connection to Postgres
  • main.py - The actual application file
  • Postgres.py - All the postgres functions

From NGINX the web application used to serve the files instead of apache/httpd, there are several IMPORTANT files that must NOT be touched.

  • /etc/uwsgi.sockets/lcp_uwsgi.sock - Auto generated file by lcp_website.service
  • wsgi_lcp.ini - The reference file that the lcp_website.service takes to serve the application
  • wsgi.py - The actual calling the application used by main.ini
  • main_nginx.conf - The nginx configuration file

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.