Skip to content

marchon/flylons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

###########################################################################
 _______  __      ____    ____  __        ______   .__   __.      _______.
|   ____||  |     \   \  /   / |  |      /  __  \  |  \ |  |     /       |
|  |__   |  |      \   \/   /  |  |     |  |  |  | |   \|  |    |   (----`
|   __|  |  |       \_    _/   |  |     |  |  |  | |  . `  |     \   \    
|  |     |  `----.    |  |     |  `----.|  `--'  | |  |\   | .----)   |   
|__|     |_______|    |__|     |_______| \______/  |__| \__| |_______/    
                                                                          
###########################################################################

A lightweight Pylons-like app template using Flask.

To setup, do the standard dance:

cd setup
sh ./bootstrap.sh

That creates a virtualenv and install all your packages. Here's some other stuff you can do:

1. Activate your environment
    - source env/bin/activate

2. Starting fresh
    - Remove the examples:
        - rm application/controllers/foo.py
        - rm application/models/foo.py

3. Configs
    - Edit the file this.environment and change your environment
    - All the configs can be found in application/config/config.py
    - To add a config, just add a class to config.py and inherit from Config
    - Add a key value pair to the environments dict in config.py like (k=name, v=class)

4. Database migrations
    - TODO: migrate stuff

5. Creating a controller
    - From the root dir, just run fab controller:NAME

6. Models and DB access:
    - Template assumes SQLAlchemy
    - Models go in application/models
    - from meta import Session
    - Session is wired up with your config's database connection when you run the app with manage.py. You can just run Session.query, etc. as you do in Pylons.

About

Pylons-esque template for larger projects using Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published