Giter Site home page Giter Site logo

flask_survey's Introduction

ECIT Password Survey Application

This application is written in Flask; "Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions."

Purpose

To survey and gather relevant user data on passwords and their usage.

Project Structure

####Application Project Structure

app
  ├── __init__.py
  ├── decorators.py
  ├── email.py
  ├── forms.py
  ├── mixins.py
  ├── models.py
  ├── static
  │   └── (asset files: CSS/JS/images)
  │       * managed 'mostly' by Bower
  ├── templates
  │   └── (HTML template files)
  └── views.py
manage.py
config.py

####Application Configuration

  • config.py - will hold all configuration values for the application runtime
  • .bowerrc - instructs bower to install files in the specified location
  • bower.json - the project's Bower configuration file

Getting Started

#####Installing Packaged Dependencies

You are strongly encouraged to use a virtual environment for development, and virtualenv wrapper is the way to go.

Whether you use a virtualenv or not your first step is to install your Python dependencies:

  • with virtualenv wrapper
  • $ mkvirtualenv survey_env -r requirements.txt
  • without virtualenv wrapper
  • $ pip install -r requirement.txt

requirements.txt holds a record of all packaged Python dependencies. If you update or add any packages, please remember to run:

  • $ pip freeze > requirements.txt

#####Configuring/Initializing the Database

Configuration specifications will come in a later update. For now these are the config variables that will be utilized.

  • SQLALCHEMY_DATABASE_URI
  • SQLALCHEMY_ECHO
  • DATABASE_QUERY_TIMEOUT

To initialize the database, run:
$ python manage.py initdb

Running the App

#####Development To run the application in your development environment. After you initialize your database;

  • $ python manage.py runserver

The development server should start in DEBUG mode (this is specified in you config file) and with the reloader:

$ python manage.py runserver
* Running on http://127.0.0.1:5000/
* Restarting with reloader

#####Production In production the application uses gunicorn. The command to start the server is:

# <vitualenv>/gunicorn --bind 127.0.0.1:5000 --workers 2 app:app --log-level=debug --log-file=$LOGFILE 2>>$LOGFILE --daemon
  • this must run from within the project's directory
  • you can place these options in a config file for gunicorn as well

Tools and Dependencies

All packaged Python dependencies can be found in requirements.txt and are managed using pip.

Most other packages (related to the application's front end) are managed with Bower and you can see this list in bower.json.

The style for the applications front end is based on Bootstrap but is customized by using a modified bootstrap swatch theme from Bootswatch, namely 'Darkly'.

The custom style sheet is located in app/static/bootswatch.

We update styles by modifying the LESS files. These are compiled using Grunt:

$ grunt swatch:darkly
Running "swatch:darkly" (swatch) task
...
Done, without errors.

Contributors

Ryan Kuhl
Shiva Houshmand
Frank Valcarcel
Sai Prasad

flask_survey's People

Contributors

lame avatar shibba avatar frankv avatar

Watchers

rajib 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.