You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
djscript is a Python package for using RapydScript in your Django application. This package installs NodeJS/npm/RapydScript in an isolated virtual environment and includes utilities for writing RapydScript *.pyj files in your web application.
What is RapydScript?
From the RapydScript README: "RapydScript (pronounced 'RapidScript') is a pre-compiler for JavaScript, similar to CoffeeScript, but with cleaner, more readable syntax. The syntax is very similar to Python, but allows JavaScript as well."
Convenient djurl templatetag for compiling javascript on page load (settings.DEBUG = True)
Exceptions are logged to django.request or custom logger (which can be emailed to admins, etc)
Parses Django templatetags before attempting to compile javascript
Usage
For Django development, there is a convenient djurl template tag which will freshly compile your RapydScript on each page request. On production, the static compiled javascript is served directly from your static/ folder.
Your source file (e.g. path/to/rapydscript/file.pyj) must end in the .pyj extension. Your target file destination is the value specified in settings.py. Your web server must have correct file permissions to write to your static/ folder.