modocache / django-generate-scaffold

Generate a Django model, views, URLconf, and templates using a single command.
139 stars 39 forks source link

django-generate-scaffold build-status endorse

Generate a Django model, views, URLconf, and templates using a single command.

Quickstart

A screencast introducing django-generate-scaffold is available here.

Usage

Generating Models, Views, URL Patterns, and Templates

Generating Views, etc. Based on Existing Models

Limitations When Using Existing Models

For best results, existing models should implement a get_absolute_url method which conforms to the urlpatterns used by django-generate-scaffold:

    @models.permalink
    def get_absolute_url(self):
        return ('<app_name>_<model_name>_detail', (), {'pk': self.pk})

Not conforming to this model will lead to broken links and potentially other issues when rendering templates.

Development

django-generate-scaffold is currently in ALPHA.

Running Tests

In order to run the test suite, install your local version of django-generate-scaffold and start a Selenium server and issue the following commands:

    $ cd django-generate-scaffold
    $ python setup.py install --force
    $ cd test_project
    $ python test_app/tests/runtests.py

Consult .travis.yml for the exact steps necessary to run the test suite.

Autotesting via watchr

By installing the gems in the Gemfile, you can automatically run all non-Selenium based tests every time a file is modified:

    $ watchr autotest.rb

How to Contribute

Issues

If you experience any issues, please create an issue on Github.