Giter Site home page Giter Site logo

hucares / company-website Goto Github PK

View Code? Open in Web Editor NEW

This project forked from originprotocol/origin-website

0.0 1.0 0.0 91.27 MB

Code for originprotocol.com

License: MIT License

Python 23.03% Shell 0.39% CSS 17.45% JavaScript 9.88% HTML 49.03% Mako 0.22%

company-website's Introduction

originprotocol.com

Official website for Origin Protocol

This is a Flask app with the source code for www.originprotocol.com. The code is all Python 2.7 with Postgres for the database (basically just for the mailing list). The database is not required to be configured if you're just working on the website.

Installing

Note: This site is set up differently from typical virtualenv/flask applications.

Setup a virtualenv

virtualenv company-website && cd company-website

Note: As of Feb 2018, Homebrew on MacOS defaults to Python 3. Therefore you'll need to specify Python 2.7

virtualenv --python=/usr/local/bin/python2 company-website && cd company-website

Clone

git clone https://github.com/OriginProtocol/company-website.git && cd company-website

Enter virtual environment

source env.sh

Install requirements

pip install -r requirements.txt

Rename the file sample.env to .env, and update env variables as desired.

mv sample.env .env

Run it!

python main.py

Open browser to view

open http://127.0.0.1:5000/

Problems? Hit us up in the engineering channel on Discord if you need help.

Localization

See README in translations directory

Database changes

We use Flask Migrate to handle database revisions. If you make changes to the database, use flask db migrate to generate the required migration file and then flask db upgrade to implement and test your changes on your local database before committing.

Recaptcha

To enable recaptcha, add the following environment variables to .env

RECAPTCHA_SITE_KEY = "<YOUR SITE KEY>"
RECAPTCHA_SECRET_KEY = "<YOUR SECRET KEY>"
RECAPTCHA_SIZE = "invisible"

You can get Recaptcha keys here: https://www.google.com/recaptcha/admin

Dev Deployment on Heroku

To deploy a dev copy of the site on Heroku, you'll follow the normal steps you would to deploy on Heroku, with two additional steps.

After the normal setup and linking, you'll need to ensure the site uses both the python and the nginx backend:

heroku buildpacks:set heroku/python
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nginx

As a minium, you must set these three Heroku config variables:

Config Value
FLASK_SECRET_KEY (make something up)
PROJECTPATH /app
HOST (domain name of your dev heroku app)

There are more optional config variables you can set. See sample.env for a full list.

company-website's People

Contributors

wanderingstan avatar joshfraser avatar matthewliu avatar evra6965 avatar coleman415 avatar micahalcorn avatar cvibhagool avatar ryana avatar bretfunk avatar unicyclejonathan avatar danielvf avatar jyotsna1820 avatar chun-lin avatar

Watchers

Alex Hu 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.