Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install djangosenchatools

How to install djangosenchatools

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install djangosenchatools
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.4
1.0.5Never BuiltWhy not?
1.0.4 Available View build log
Windows (64-bit)
1.0.4
1.0.5Never BuiltWhy not?
1.0.4 Available View build log
Mac OS X (10.5+)
1.0.4
1.0.5Never BuiltWhy not?
1.0.4 Available View build log
Linux (32-bit)
1.0.4
1.0.5Never BuiltWhy not?
1.0.4 Available View build log
Linux (64-bit)
1.0.5 Available View build log
1.0.4 Available View build log
 
License
BSD
Dependencies
Lastest release
version 1.0.5 on Jan 9th, 2014

Django management commands for the JSBuilder commands in Sencha SDK Tools. Unfortunately, the JSBuilder commands provided by Sencha Tools needs some workarounds to work when the HTML document and resources are not in the same directory. We have turned these workarounds into a Django management command available in the djangosenchatools app.

Issues/contribute

Report any issues at the github project page, and feel free to add your own guides/experiences to the wiki, and to contribute changes using pull requests.

Install

Install the python package:

$ pip install djangosenchatools

Add it to your django project:

INSTALLED_APPS = [
    ...
    'djangosenchatools'
]

Usage

First, we need a Django ExtJS4 application. See django_extjs4_examples for an 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/outdir

With --url and --outdir, the senchatoolsbuild command runs sencha create 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 their respective 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 --listall

Add -v3 to see skipped apps, and why they are skipped.

To build all detected apps, run:

$ python manage.py senchatoolsbuild --buildall
Build one app by name

You can build a single app in INSTALLED_APPS using the same method of detecting outdir and url as --buildall using --app:

$ python manage.py senchatoolsbuild --app minimal_extjs4_app
Using --watch

Use --watch to automatically rebuild on file changes:

$ python manage.py senchatoolsbuild --app minimal_extjs4_app --watch /path/to/directory/containing/minimal_extjs4_app

Use -v2 for debug out. By default, only *.js-files trigger rebuild events, however you can change this using these settings (shown with their defaults):

#: Files to include DJANGOSENCHATOOLS_WATCH_INCLUDE = ['*.js']

System Message: WARNING/2 (<string>, line 96); backlink

Inline emphasis start-string without end-string.

#: 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',

System Message: WARNING/2 (<string>, line 99); backlink

Inline emphasis start-string without end-string.

System Message: ERROR/3 (<string>, line 103)

Unexpected indentation.

'*app-all.js', '*all-classes.js']

System Message: WARNING/2 (<string>, line 103); backlink

Inline emphasis start-string without end-string.

System Message: WARNING/2 (<string>, line 103); backlink

Inline emphasis start-string without end-string.

_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 losely coupled. The only place where you are likely to notice that they work together is that senchatoolsbuild checks that settings.EXTJS4_DEBUG==True. You can 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 = True
MIDDLEWARE_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

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.