From f097047b8ba575cc81b053764447d5e7f91cbc52 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 11 May 2014 10:41:34 +0530 Subject: [PATCH] Introduce python-bootstrapform as dependency Twitter Bootstrap provides good styling for forms. Our current theme does not ouput forms in bootstrap styles although for everything else, it does. The python-bootstrap from is a simple Django helper application to render Django forms into bootstrap theme. Django forms themselves provide numerous advantages over the current incomplete homegrown solution. It also has solutions for problems such as CSRF attacks which the current application is vulnerable to. --- INSTALL | 4 +++- Makefile | 2 +- fabfile.py | 2 +- plinth.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index 3df4655b0..d62bc8835 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Install the pandoc, python-augeas, and bjsonrpc: -apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson sudo +apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform sudo Unzip and untar the source into a directory. Change to the directory containing the program. Run: @@ -40,6 +40,8 @@ The documentation has some dependencies too. * *GNU Make* processes /doc/Makefile. +* *python-bootstrapform* - Render django forms for Twitter Bootstrap + ## Building the Documentation Documentation has been collected into a pdf that can be built using diff --git a/Makefile b/Makefile index b2211c6d3..a5a050b85 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ default: config dirs css docs all: default predepend: - sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson sudo" + sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform sudo" git submodule init git submodule update touch predepend diff --git a/fabfile.py b/fabfile.py index cbffef8b2..5a4633004 100644 --- a/fabfile.py +++ b/fabfile.py @@ -150,7 +150,7 @@ def apache(): @task def deps(): "Basic plinth dependencies" - sudo('apt-get install --no-install-recommends -y python make pandoc python-simplejson python-pyme python-augeas python-bjsonrpc python-django') + sudo('apt-get install --no-install-recommends -y python make pandoc python-simplejson python-pyme python-augeas python-bjsonrpc python-django python-bootstrapform') @task def update(): diff --git a/plinth.py b/plinth.py index 2c7490db2..1b428b6e8 100755 --- a/plinth.py +++ b/plinth.py @@ -206,7 +206,8 @@ def main(): # Configure Django template_directories = get_template_directories() - django.conf.settings.configure(TEMPLATE_DIRS=template_directories) + django.conf.settings.configure(TEMPLATE_DIRS=template_directories, + INSTALLED_APPS=['bootstrapform']) cherrypy.engine.start() cherrypy.engine.block()