Giter VIP home page Giter VIP logo

quips's Introduction

smash

a bash.org clone built with Flask This version was forked by denmojo. It is run locally using SQLite.

Technologies

  • python3
  • Flask
  • SQLite3
  • SQLAlchemy

Functionalities

  • Quote database
  • Tags for grouping and classifying quotes
  • Moderation queue, admin approval required for adding new quotes
  • Pagination
  • Ratings

How to run

This program is designed to be easy to deploy via Heroku. It can also run locally.

First, you have to edit the config file (config.json). APPNAME is the name that will be displayed in the title bar in the browser, while APPBRAND is the name that will be displayed in the navbar on every page.

SECRETKEY will be used to encrypt and sign session cookies, so it needs to be a cryptographically-secure random string. ADMINSECRET will be used to elevate privileges to allow approving and deleting new quotes. There are no user accounts since there are no user-specific functionalities.

MOTD will be displayed on the index page.

APPNAME and APPBRAND will be loaded from the environment if they're left empty in the config.

Smash uses SQLite. Before you start, you need to set DATABASE_URL environment variable to a valid URL leading to your database. If you install the Heroku plugin, it will be done automatically for you - you only need to do this manually if you want to run Smash locally. The DATABASE_URL will take the form: sqlite:////path/to/dbfile.db.

After basic config is done, run this to start the development server:

python run.py

The program looks for HEROKU in the environment; if that variable is equal to 1, it interprets this as a sign that it's running in a production environment and starts in the externally visible mode with debug turned off. It also needs the PORT environment variable to have some sensible value; this is configured automatically when deploying on heroku.

The first time it's started it will create the local database and all required tables, as specified by models. After that it's ready to be used.

All logging is done by printing to stdout - heroku adds that to the app logs visible in the dashboard.

Running under gunicorn

To productionalize this app, set up nginx or other upstream proxy route to this app under gunicorn wsgi. To run using gunicorn, simply do:

gunicorn --bind 0.0.0.0:5000 wsgi:app

Screenshots

index

quotes

tags

adding a new quote

quips's People

Contributors

nukeop avatar denmojo avatar psukys avatar jch avatar

Watchers

James Cloos avatar  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.