The django-sproutcore library is made up of several parts.
- An
scgen
management command, which generates best-guess matching SproutCore models from you Django models. - A SproutCore admin interface for your server-side Django models that can replace (eventually) Django's own built-in admin app. The admin interface makes use of
scgen
's model generation. - Helpers for providing a RESTful API for custom SproutCore applications.
The scgen
command has no external dependencies (aside from Django, obviously).
To use the SproutCore admin interface, or the REST API helpers, it is necessary to install the wonderful django-piston framework, as it is used for providing the basic REST interface.
django-sproutcore comes with an scgen
Django management command which allows you to auto-generate best guess SproutCore models from your django models. This can help greatly speed up initial SproutCore development and prototyping.
The command can be run like any other Django management command. After adding the djangocore app to INSTALLED_APPS
in your project's settings.py
file, cd
to your project directory and run python manage.py scgen
. If successful, scgen
will create sproutcore
folder in your current working directory with the auto-generated models inside of it.
The scgen
command has a number of useful options for specifying exactly what models to generate and where to generate them.
Explicitly specify which apps (and/or specific models) should be auto-generated by scgen
using positional arguments. Any number of apps and/or models may be specified. Takes precedence over the exclude
argument.
The path to the directory where scgen
should auto-generate your SproutCore models. If the specified path is not absolute, it will be relative to your current working directory.
The name of an app to exclude from model auto-generation. Multiple apps can be excluded by using multiple -e
or --exclude
arguments. Will not exclude apps or models specified explicitly with positional arguments.
django-sproutcore makes use of a number of settings if given in your project's settings.py
file.
An absolute path to the folder where scgen
should auto-generate your SproutCore models. By default, models are generated inside of a sproutcore
folder within the current working directory.
An integer indicating the maximum number of objects a client can request at once. Defaults to 300.