Package: djangosenchatools
#################djangosenchatools#################Django management commands for the JSBuilder commands in `Sencha SDK Tools`_.Unfortunately, the JSBuilder commands provided by Sencha Tools needs someworkarounds to work when the HTML document and resources are not in the samedirectory. We have turned these workarounds into a Django management commandavailable in the *djangosenchatools* app.Issues/contribute=================Report any issues at the `github project page <djangosenchatools>`_, and feel freeto add your own guides/experiences to the wiki, and to contribute changes usingpull requests.Install=======Install the python package::$ pip install djangosenchatoolsAdd it to your django project::INSTALLED_APPS = [...'djangosenchatools']Usage=====First, we need a Django ExtJS4 application. See `django_extjs4_examples`_ foran example application. We use the ``minimal_extjs4_app`` as our example... note:: The ``senchatoolsbuild`` management command runs ``collectstatic``... note:: You need to run the Django server (``manage.py runserver``) for all commands except --listall.Build one app-------------Run::$ python manage.py senchatoolsbuild --url http://localhost:8000/minimal_extjs4_app/ --outdir /path/to/outdirWith ``--url`` and ``--outdir``, the senchatoolsbuild command runs ``senchacreate jsb`` and ``sencha build``, and puts the result in the ``--outdir``.Run with ``-v3`` for full debug output if you want to see what the command does.Build all INSTALLED_APPS------------------------``senchatoolsbuild`` can autodetect sencha apps and build them all in theirrespective static directories. Run with ``--help`` and see the help for``--buildall`` to see how apps are detected.To list detected apps, their ``--outdir`` and ``--url``, run::$ python manage.py senchatoolsbuild --listallAdd ``-v3`` to see skipped apps, and why they are skipped.To build all detected apps, run::$ python manage.py senchatoolsbuild --buildallBuild one app by name---------------------You can build a single app in ``INSTALLED_APPS`` using the same method ofdetecting outdir and url as ``--buildall`` using ``--app``::$ python manage.py senchatoolsbuild --app minimal_extjs4_appUsing --watch-------------Use ``--watch`` to automatically rebuild on file changes:$ python manage.py senchatoolsbuild --app minimal_extjs4_app --watch /path/to/directory/containing/minimal_extjs4_appUse ``-v2`` for debug out. By default, only ``*.js``-files trigger rebuildevents, however you can change this using these settings (shown with their defaults):#: Files to includeDJANGOSENCHATOOLS_WATCH_INCLUDE = ['*.js']#: Files to exclude#: - Matched after INCLUDE, so you can include a general pattern, and#:   exclude specific files or dirs.DJANGOSENCHATOOLS_WATCH_EXCLUDE = ['*.*.swp', '*~', '*.pyc', '*.pyo','*app-all.js', '*all-classes.js']_Note_: All patterns match against the absolute path of the file.Integration with django_extjs4==============================This app is made to work with `django_extjs4`_, however they are loselycoupled. The only place where you are likely to notice that they work togetheris that ``senchatoolsbuild`` checks that ``settings.EXTJS4_DEBUG==True``. Youcan disable this check using ``--no-check-settings``.Building apps that require authentication=========================================Add the following to your ``settings.py``::MIDDLEWARE_CLASSES += ['djangosenchatools.auth.SettingUserMiddleware']AUTHENTICATION_BACKENDS = ('djangosenchatools.auth.SettingUserBackend',)SENCHATOOLS_USER = 'myuser'Where ``SENCHATOOLS_USER`` is the user that you want to be authenticated as(the user must exist). **NEVER** use this backend/middleware in production.Reccommended setup------------------We reccommend that you create a separate settings.py for ``senchatoolsbuild``where you set the required settings. Here is our ``djangosenchatools_settings.py``::from settings import *EXTJS4_DEBUG = TrueMIDDLEWARE_CLASSES += ['djangosenchatools.auth.SettingUserMiddleware']AUTHENTICATION_BACKENDS = ('djangosenchatools.auth.SettingUserBackend',)SENCHATOOLS_USER = 'grandma'We use this settings module whenever we build apps using ``senchatoolsbuild``::$ python manage.py senchatoolsbuild --buildall --settings djangosenchatools_settings.. _`Sencha SDK Tools`: http://www.sencha.com/products/sdk-tools.. _`django_extjs4`: https://github.com/espenak/django_extjs4.. _`django_extjs4_examples`: https://github.com/espenak/django_extjs4_examples.. _`djangosenchatools`: https://github.com/espenak/djangosenchatools