Skip to content

Hakhyun-Kim/flask-plate

 
 

Repository files navigation

flask-plate

This is yet another boiler plate for flask, with bootstrap, redis & formencode.

Get Started

  1. Install Redis & Run server

    http://redis.io

  2. Install latest formencode from Github

     git clone git://github.com/formencode/formencode.git
     cd formencode
     python setup.py install
     
  3. Clone flask-plate from Github.

    git clone https://github.com/haje01/flask-plate.git
  4. Rename 'flask-plate' folder as your project name, and cd into it.

  5. Install required python modules. ( Make virtual environment beforehand, if you want to )

    pip install -r requirements.txt
  6. Find 'myapp's in the following files and change it into your own app's name.

         ./admin
         ./application.py
         ./myapp/config.py
         ./myapp/util.py
         ./myapp.uwsgi.xml
         ./myapp  (change folder name)
     
  7. Run application, then test 'http://localhost:8000' with you browser.

    python application.py
  8. If everything goes well, remove .git folder and init new repository for your project.

  9. Edit as your own!

Unittest

To unittest your application, modify tests.py and run it. You can override settings by edit tests.cfg file.

Documentation by Sphinx

If you want to use Sphinx as document tool,

  1. download latest Sphinx source and install (Note: current PIP version(1.2b) has timezone error).

         wget https://bitbucket.org/birkenfeld/sphinx/get/default.zip
         python setup.py build
         python setup.py install
     
  2. Move into docs/ folder and init sphinx document root.

         sphinx-quickstart
     
  3. If you have more than one language to support, make locale folder in translations/ folder:

         mkdir -p translations/ko
     

    Then extract message strings into _build/locale by:

         make gettext
     

    And add locale_dirs = ['translations'] to the end of conf.py

    Init .po files by docs/babel-init. After translations is done, compile them by docs/babel-compile.

Command Line Completion

In order to activate admin script's tab completion:

  1. If you are using MacOSX, upgrade to bash 4.2 & install bash-completion.

    http://techscienceinterest.blogspot.kr/2010/05/change-to-new-bash-shell-41-for-mac-os.html

    http://blog.jeffterrace.com/2012/09/bash-completion-for-mac-os-x.html

  2. Admin Command line Completion

    https://pypi.python.org/pypi/argcomplete#global-completion

About

Poor boilerplate for using flask & bootstrap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published