Django Cloud Deployer
This package facilitates hybrid cloud deployment (IaaS/PaaS and FaaS) of Django web applications. By annotating project urls with the plugin's wrapper functions, a developer can indicate in which cloud deployment model each url resource should be executed.
Requirements
To use this package, you will need the following Software tools:
You will also need the CLI tools of the cloud providers you will be using:
Setup
First, install the package:
pip install django-cloud-deployer
Then, make sure to add the package (and its requirements) to your project's requirements file:
pip freeze > requirements.txt
Usage
The package features two functions, runInPaaS and runInFaaS, that may be used to indicate in which cloud deployment model (PaaS or FaaS, respectively) a url resource should be executed.
Example:
# urls.py
from django.urls import include, path
from django_cloud_deployer import runInPaaS, runInFaaS
from . import views
urlpatterns = [
path('', views.home, name='home'),
runInPaaS(path('faq/', views.faq, name='faq')),
runInPaaS(path('polls/', include('polls.urls'))),
runInFaaS(path('auth/', include('auth.urls'))),
]
Note that, by default, url resources with run in FaaS.
CLI tool
The package may be used as a CLI tool:
$ python -m django_cloud_deployer
Usage: django_cloud_deployer <operation>
Available operations:
- deploy
- check_deploy
- destroy
Check Deploy
The check_deploy command allows the developer to observe, based on the annotated urls, where each resource will be deployed and executed.
Usage:
$ python -m django_cloud_deployer check_deploy
Example:
$ python -m django_cloud_deployer check_deploy
Please enter the name of the Django settings module (e.g., 'mysite.settings'):
> mysite.settings
The following urls will run in the FaaS provider:
^/?$
^auth/login/?$
^auth/logout/?$
The following urls will run in the PaaS provider:
^polls/?$
^polls/(?P<pk>[0-9]+)/?$
^polls/(?P<pk>[0-9]+)/results/?$
^polls/(?P<question_id>[0-9]+)/vote/?$
Deploy
The deploy command allows the developer to deploy the django project, based on the annotated urls.
Usage:
$ python -m django_cloud_deployer deploy <paas provider> <faas provider>
Available PaaS providers:
- heroku
Available FaaS providers:
- azure
Note that you will need to be logged in to the chosen PaaS and FaaS providers CLIs. If you are not, you will be asked to login first.
After the deployment is completed, a django_cloud_deployer.json configuration file will be produced:
{
"projectName": "...",
"paasConfig": {
"provider": "...",
"resource": "...",
"url": "..."
},
"faasConfig": {
"provider": "...",
"resource": "...",
"url": "..."
}
}
Destroy
The destroy command allows the developer to delete all the infrastructure resources created with the deployment of the Django project.
Usage:
$ python -m django_cloud_deployer destroy
Metadata
Release files for django-cloud-deployer 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_cloud_deployer-1.0.2.tar.gz | 9.1 kB | Without provenance | Details for django_cloud_deployer-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_cloud_deployer-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for django_cloud_deployer-1.0.2-py3-none-any.whl |
Total release size: 77.7 kB
Release files / django_cloud_deployer-1.0.2.tar.gz
| Download URL | django_cloud_deployer-1.0.2.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7c6b1e03d1bc69af4ebb10deab1bf161cf1b3032ee7a6981bed7ab58f710d18
|
|
BLAKE2b-256 checksum How to use checksums |
83caef2e9a2b67f9615e170c4f47464ca8ed3cb6e2d2432322c730388c7e74c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Release files / django_cloud_deployer-1.0.2-py3-none-any.whl
| Download URL | django_cloud_deployer-1.0.2-py3-none-any.whl |
|---|---|
| Size | 68.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44bbb8199f4c08935eb21a22f196e53cc8a38c37b5667f2120ba052ab94b20e6
|
|
BLAKE2b-256 checksum How to use checksums |
299bc52dd939e2499b6065aa7fe1312e9c11b356bbc41057a6c98dd19faceb95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Security for django-cloud-deployer 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.