Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Define models and fields using YAML and generate app for Django with views, forms, templates etc.

Project description

PyPi TravisCI Coverage Requirements Status

Installation

This package is not yet on PyPI. Supported Python versions are: 2.7, 3.3, 3.4, 3.5 and pypy.

pip install --upgrade git+git://github.com/illagrenan/django-make-app.git#egg=django-make-app

Usage

If you want to generate app called library, create a file library.yaml in project’s root and define models:

app_name: library # all files will be generated into library/ directory (will be created)
models:
  - User: # model name
    - name:char # model field "name" of type "char"
    - email:char # model field "email" of type "char"
  - Book: # another model
    - library:fk # model field "library" of type "foreign key" to "library"
  - Library # empty model without fields

You can also print example configuration by:

django-make-app write_config

Now execute:

django-make-app generate library

Or run this if you need help:

django-make-app --help
django-make-app generate --help
django-make-app write_config --help

This structure will be generated:

LIBRARY
│   admin.py
│   api.py
│   apps.py
│   checks.py
│   forms.py
│   models.py
│   receivers.py
│   serializers.py
│   signals.py
│   urls.py
│   views.py
│   __init__.py
│
├───management
│   │   __init__.py
│   │
│   └───commands
│           library_command.py
│           __init__.py
│
├───migrations
│       __init__.py
│
├───templates
│   └───web
│           book_delete.html
│           book_detail.html
│           book_form.html
│           book_list.html
│           library_delete.html
│           library_detail.html
│           library_form.html
│           library_list.html
│           user_delete.html
│           user_detail.html
│           user_form.html
│           user_list.html
│
├───templatetags
│       web_tags.py
│       __init__.py
│
└───tests
        factories.py
        test_book.py
        test_library.py
        test_user.py
        __init__.py

License

The MIT License (MIT)

Copyright (c) 2016 Vašek Dohnal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page