diff --git a/ChangeLog.rst b/ChangeLog.rst index 01b01f0..eb31150 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -1,6 +1,11 @@ importd ChangeLog ================= +0.3.3 - 24-Feb-2015 +------------------- + +* added livereload command/feature. + 0.3.2 - 27-Jan-2015 ------------------- @@ -26,7 +31,7 @@ importd ChangeLog * Add importd-boilerplate hyperlink. * Auto Add coffin/django-jinja. * Added support for Django1.7 and Python3.4, removed support for python3.3. -* Added autoimport keyword argument, to control if views etc should be auto +* Added autoimport keyword argument, to control if views etc should be auto imported. * Added a blueprint like framework inspired from flask diff --git a/README.rst b/README.rst index 68d47c9..4bedb8c 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Issues you can help with right now: |waffle| Build Status: |build-status| -.. |waffle| image:: https://badge.waffle.io/amitu/importd.png?label=ready&title=Ready +.. |waffle| image:: https://badge.waffle.io/amitu/importd.png?label=ready&title=Ready :target: https://waffle.io/amitu/importd :alt: 'Stories in Ready' @@ -81,6 +81,7 @@ Features * Auto Add django-debug-toolbar (Needs to add it manually to INSTALLED_APPS) * Auto SECRET_KEY: If no SECRET_KEY on settings, try to read SECRET_KEY from ./secret.txt , if no ./secret.txt generate a random string then write it to ./secret.txt and finally return it as SECRET_KEY. * Auto Add coffin/django-jinja (jinja2 integration) +* Support for livereload Installation ============ @@ -106,7 +107,7 @@ Contributors * Dmytro Vorona (https://github.com/alendit) * Jannis Leidel (https://twitter.com/jezdez) * Lukasz Balcerzak (https://github.com/lukaszb) -* Juan Carlos (https://github.com/juancarlospaco) +* Juan Carlos (https://github.com/juancarlospaco) * Josep Cugat (https://github.com/jcugat) * Yu Byunghoo (https://github.com/if1live) diff --git a/docs/source/conf.py b/docs/source/conf.py index e078b0c..d576d65 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,7 +45,7 @@ # built documents. # # The short X.Y version. -version = '0.3.2' +version = '0.3.3' # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/source/index.rst b/docs/source/index.rst index 0617f5a..e76037a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -60,7 +60,7 @@ d.main() acts as management command too: $ python hello.py help shell python hello.py help shell (02-18 21:14) - Usage: hello.py shell [options] + Usage: hello.py shell [options] Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available. @@ -103,7 +103,7 @@ calling d(dont_configure=True) before any other importd functionality. wsgi server ----------- -importd based hello.py is a `wsgi app`_ without any more work. +importd based hello.py is a `wsgi app`_ without any more work. ... wsgi example http://www.tornadoweb.org/documentation/wsgi.html ... @@ -168,7 +168,7 @@ For testing many a times sqlite is sufficient, and for those times importd automatically configures django with sqlite3 as database, with sqlite file stored in `db.sqlite` in the same folder as hello.py. -This can be disabled by passing actual database settings DATABASES to d(). +This can be disabled by passing actual database settings DATABASES to d(). @d decorator ------------ @@ -374,7 +374,7 @@ Usage: Content-Type: text/html; charset=utf-8 Location: http://localhost:8000/asd - $ curl -b "csrftoken=cnoaUDrr08haTTAMjpGWaPPBgt5rG1ZW" -d "csrfmiddlewaretoken=cnoaUDrr08haTTAMjpGWaPPBgt5rG1ZW&x=10&y=1" "http://localhost:8000/fhurl/?json=true" + $ curl -b "csrftoken=cnoaUDrr08haTTAMjpGWaPPBgt5rG1ZW" -d "csrfmiddlewaretoken=cnoaUDrr08haTTAMjpGWaPPBgt5rG1ZW&x=10&y=1" "http://localhost:8000/fhurl/?json=true" {"response": 10, "success": true} @@ -382,7 +382,7 @@ views can return non HttpResponse objects ----------------------------------------- Django views are expected to only return HttpResponse based objects. importd -allows you to do more than this. +allows you to do more than this. A view can return a string, which is treated as name of template, which is rendered with RequestContext and returned. A view can also return a tuple of @@ -581,6 +581,37 @@ If you want to use more advanced features, you pass a dictionary. :: blueprints={"app3-clone": {"blueprint": "app3.views.bp", "url_prefix": "app3-clone/"}} +livereload support +------------------ + +ImportD comes with livereload support. + +To activate it you have to pass keyword argument "lr", which is a dict. + +eg. + +.. code-block:: python + + d( + DEBUG=True, + lr={ + "static/scss,static/js": "make build" + } + ) + +Subsequently, you can run python app.py livereload, which will listen on port +8000 and watch the folders "static/scss" and "static/js" and run "make build" +if any file is modified in either folder. + +You can pass any number of patterns as key value, eg if you want different cmds +to run for css files and different for js files etc. + +In order to use this feature, please install livereload package first. + +This feature injects a auto reload js in each page, and runs a websocket in +background, which signals the JS to reload the page everytime one of the watched +file changes and command is finished. + a more detailed example ----------------------- diff --git a/setup.py b/setup.py index db4d598..d4ad7a5 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ description="a django based miniframework, inspired by sinatra", long_description=long_description, - version="0.3.2", + version="0.3.3", author='Amit Upadhyay', author_email="upadhyay@gmail.com",