Skip to main content

A library of plugins for configuring a production-ready Django site when you convert your nanodjango single page app.

Project description

Nanodjango Compose

PyPI

nanodjango-compose is a library of plugins that let you convert your nanodjango app to a production-ready Django project with maximum flexibility, and a minimum of fuss.

With Cookiecutter projects and repository templates you can quickly setup a production-ready Django site. However, these can only offer either a limited set of choices or predefined configurations. Since every Django project is different, the minimum set of viable features is often not sufficient and you then have add various chunks of boilerplate or config files. Conversely add too many features and you then waste time removing all the features you don't need.

nanodjango delivers rapid prototyping for Django projects. Once you have the features you want you can then convert your single page app to a full Django project. nanodjango-compose takes this a step further. Using nanodjango's plugin system, you can control the conversion process to add all the features you need for a production-ready site.

Quickstart

Install nanodjango-compose:

pip install nanodjango-compose

Write your nanodjango app in single .py file, importing a plugin for each feature you want to include in the full Django project when it is converted.

from nanodjango import Django

from compose import postgres, sentry

app = Django()

app.pm.register(postgres)
app.pm.register(sentry)

@app.route("/")
def hello_world(request):
    return "<p>Hello, World!</p>"

Save that as hello_world.py, then use nanodjango to run it:

nanodjango run hellow_world.py

This will create migrations and a database, and run your project in development mode. IMPORTANT: Although the plugins to configure the project with PostgreSQL and Sentry, these are only added when the project is converted. Right now nanodjango-compose does not change nanodjango'srun command - so it will still initially create an SQLite database.

Conversion

Once your project has the initial set of features you want, you can convert it into a full Django site:

nanodjango convert hello_world.py path/to/site

Now the plugins you included will be used to update Django's settings and add any configuration files.

Project Information

License

nanodjango-compose is available under the terms of the MIT licence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanodjango_compose-0.0.0.dev0.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanodjango_compose-0.0.0.dev0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file nanodjango_compose-0.0.0.dev0.tar.gz.

File metadata

File hashes

Hashes for nanodjango_compose-0.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 f4bb9e7b8d000207256f96c811b94809a8bb269408be469af6ab60fdc910b57f
MD5 c0a6842518fbc1618b7bc8439a07e1e5
BLAKE2b-256 d71b2c18cc84fcbcaa1a17f3914a1d059bfa6d43955f0738b3b113e51f897988

See more details on using hashes here.

File details

Details for the file nanodjango_compose-0.0.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for nanodjango_compose-0.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9671e94b29ec685d75c3e1a90aa1995d1abb9f68a440b063c5238acad5392aa
MD5 0b8a4bbc5eb02f96603dac99b50518a6
BLAKE2b-256 d1e72c16d1b2e5e9c6130f7b8b34b58bcc7fff85c2a50fef11b0e9f9ef48402d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page