Skip to main content

A plugin for django-simple-deploy, supporting deployments to CodeRed.

Project description

dsd-codered

A plugin for deploying Django projects to CodeRed, using django-simple-deploy.

Quick Start

To deploy your project to CodeRed, you'll need to take some steps through the CodeRed web site. But once you set up an initial project there, django-simple-deploy can make all the necessary changes to your project for a successful deployment.

Prerequisites

Deployment to CodeRed requires the following:

  • You must be using Git to track your project.
  • You need to be tracking your dependencies with a requirements.txt file, or be using Poetry or Pipenv.
  • You'll need a CodeRed account, and an API token.
  • You need to create a Django project in the CodeRed admin interface:
    • Choose Django, and set the database to Postgres.

Configuration-only deployment

First, install dsd-codered and add django_simple_deploy to INSTALLED_APPS in settings.py:

$ pip install dsd-codered
# Add "django_simple_deploy" to INSTALLED_APPS in settings.py.
$ git commit -am "Added django_simple_deploy to INSTALLED_APPS."

When you install dsd-codered, it will install django-simple-deploy as a dependency.

Now run the deploy command:

$ python manage.py deploy

This is the deploy command from django-simple-deploy, which makes all the changes you need to run your project on CodeRed.

At this point, you should review the changes that were made to your project. Running git status will show you which files were modified, and which files were created for a successful deployment. If you want to continue with the deployment process, commit these changes. Then set an environment variable with your CodeRed API token, and run the cr deploy command:

$ git add .
$ git commit -m "Configured for deployment to CodeRed."
$ export CR_TOKEN=<api-token>
$ cr deploy <codered-app-name>

Here, <codered-app-name> is the name you chose when you created a new project in the CodeRed admin interface. The last line of output will show you the URL for your deployed project. You can also find this URL in your CodeRed admin interace.

You can find a record of the deployment process in dsd_logs/. It contains most of the output you saw when running deploy.

Automated deployment

You can automate most of this process:

  • Create a Django project in the CodeRed admin interface. Choose Django, and set the database to Postgres.
  • Next, install dsd-codered and add django_simple_deploy to INSTALLED_APPS in settings.py:
$ pip install dsd-codered
# Add "django_simple_deploy" to INSTALLED_APPS in settings.py.

Now, set an environment variable with your CodeRed API token and run deploy in the fully automated mode:

$ export CR_TOKEN=<api-token>
$ python manage.py deploy --automate-all

You'll be prompted for the name of the project you created in the CodeRed dashboard. Your project will then be configured, all changes will be committed, and your project will be deployed to CodeRed's servers. When everything's complete, your project should open in a new browser tab.

Deleting a project from CodeRed

If you want to delete a project from CodeRed, you can do so in their dashboard. Look at the bottom of the Settings page.

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

dsd_codered-0.2.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

dsd_codered-0.2.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file dsd_codered-0.2.1.tar.gz.

File metadata

  • Download URL: dsd_codered-0.2.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/8.5.0 pkginfo/1.12.0 requests/2.26.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.12.8

File hashes

Hashes for dsd_codered-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fa1b9a75f5fa7ce2de36e45c5836d1c90696f0ab5e834b1ddfe4e487e9ca4ec8
MD5 93963decad6d972cdec6624163088870
BLAKE2b-256 3d43479e6c26e26eadbf1b2994e09502c4ea2056b6f60ce5892ece7f5eae374d

See more details on using hashes here.

File details

Details for the file dsd_codered-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dsd_codered-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/8.5.0 pkginfo/1.12.0 requests/2.26.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.12.8

File hashes

Hashes for dsd_codered-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a21c325eb56391f360b953090acf816287e98d2b47bb8a335c00744fa69e4181
MD5 84247c9c177bbf147ac9c7c192a84dd9
BLAKE2b-256 f02de0512fe45f6a91f3ccb9ec64327f0771697bfdb7a90d1d62a23694ca68f9

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