A library of plugins for configuring a production-ready Django site when you convert your nanodjango single page app.
Project description
Nanodjango Compose
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.
- See Command usage for more options
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.
- See Converting to a full Django project for more information
Project Information
- Issues: https://github.com/StuartMacKay/nanodjango-compose/issues
- Repository: https://github.com/StuartMacKay/nanodjango-compose
License
nanodjango-compose is available under the terms of the MIT licence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nanodjango_compose-0.0.0.dev0.tar.gz.
File metadata
- Download URL: nanodjango_compose-0.0.0.dev0.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4bb9e7b8d000207256f96c811b94809a8bb269408be469af6ab60fdc910b57f
|
|
| MD5 |
c0a6842518fbc1618b7bc8439a07e1e5
|
|
| BLAKE2b-256 |
d71b2c18cc84fcbcaa1a17f3914a1d059bfa6d43955f0738b3b113e51f897988
|
File details
Details for the file nanodjango_compose-0.0.0.dev0-py3-none-any.whl.
File metadata
- Download URL: nanodjango_compose-0.0.0.dev0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9671e94b29ec685d75c3e1a90aa1995d1abb9f68a440b063c5238acad5392aa
|
|
| MD5 |
0b8a4bbc5eb02f96603dac99b50518a6
|
|
| BLAKE2b-256 |
d1e72c16d1b2e5e9c6130f7b8b34b58bcc7fff85c2a50fef11b0e9f9ef48402d
|