Giter Site home page Giter Site logo

qpxu007 / overholt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattupstate/overholt

0.0 1.0 0.0 362 KB

Example Flask application illustrating some of my common practices

Home Page: http://mattupstate.com/python/2013/06/26/how-i-structure-my-flask-applications.html

License: MIT License

Ruby 0.14% Python 81.78% Mako 0.62% CoffeeScript 1.00% CSS 9.43% JavaScript 3.01% HTML 4.03%

overholt's Introduction

Overholt

Overholt is an example Flask application illustrating some of my common practices

Development Environment

At the bare minimum you'll need the following for your development environment:

  1. Python
  2. MySQL
  3. Redis

It is strongly recommended to also install and use the following tools:

  1. virtualenv
  2. virtualenvwrapper
  3. Vagrant
  4. Berkshelf

Local Setup

The following assumes you have all of the recommended tools listed above installed.

1. Clone the project:

$ git clone [email protected]:mattupstate/overholt.git
$ cd overholt

2. Create and initialize virtualenv for the project:

$ mkvirtualenv overholt
$ pip install -r requirements.txt

3. Install the required cookbooks:

$ berks install

4. Install the Berkshelf plugin for Vagrant:

$ vagrant plugin install vagrant-berkshelf

5. Start virtual machine:

$ vagrant up

6. Upgrade the database:

$ alembic upgrade head

7. Run the development server:

$ python wsgi.py

8. In another console run the Celery app:

$ celery -A overholt.tasks worker

Development

If all went well in the setup above you will be ready to start hacking away on the application.

Database Migrations

This application uses Alembic for database migrations and schema management. Changes or additions to the application data models will require the database be updated with the new tables and fields. Additionally, ensure that any new models are imported into the consolidated models file at overholt.models. To generate a migration file based on the current set of models run the following command:

$ alembic revision --autogenerate -m "<a description of what was modified>"

Review the resulting version file located in the alembic/versions folder. If the file is to your liking upgrade the database with the following command:

$ alembic upgrade head

For anything beyond this workflow please read the Alembic documentation.

Management Commands

Management commands can be listed with the following command:

$ python manage.py

These can sometimes be useful to manipulate data while debugging in the browser.

Tests

To run the tests use the following command:

$ nosetests

overholt's People

Contributors

iepathos avatar jonathanchu avatar mattsonier avatar

Watchers

 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.