Skip to main content

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.

Metadata

Release files for dsd-codered 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dsd-codered 0.2.1
File Size Uploaded
dsd_codered-0.2.1.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dsd-codered 0.2.1
File Interpreter ABI Platform
dsd_codered-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / dsd_codered-0.2.1.tar.gz

Download URL dsd_codered-0.2.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa1b9a75f5fa7ce2de36e45c5836d1c90696f0ab5e834b1ddfe4e487e9ca4ec8
BLAKE2b-256 checksum
How to use checksums
3d43479e6c26e26eadbf1b2994e09502c4ea2056b6f60ce5892ece7f5eae374d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / dsd_codered-0.2.1-py3-none-any.whl

Download URL dsd_codered-0.2.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a21c325eb56391f360b953090acf816287e98d2b47bb8a335c00744fa69e4181
BLAKE2b-256 checksum
How to use checksums
f02de0512fe45f6a91f3ccb9ec64327f0771697bfdb7a90d1d62a23694ca68f9
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page