django-simple-deploy icon indicating copy to clipboard operation
django-simple-deploy copied to clipboard

Chronicle first use case with platform.sh

Open tataraba opened this issue 2 years ago • 13 comments

I'm going to chronicle my steps using django-simple-deploy with very little experience.

Thought to use Fly.io for the test, as I've never used it before. Unfortunately, didn't have my credit card handy to verify my identity, so I'll try this one later. However, I do have a platform.sh account, so that will be my test.

First, I'll open up my django application and install the library... Using my django-slideshow demo app.

What follows is my experience and any questions/issues that come up.

tataraba avatar Oct 20 '22 18:10 tataraba

First step, adding django-simple-deploy to my project... easy enough: image

tataraba avatar Oct 20 '22 18:10 tataraba

Make sure my project is running locally with no issue:

image

huzzah...

tataraba avatar Oct 20 '22 18:10 tataraba

The docs mention that I need the platformshconfig library, so I installed that as well:

image

tataraba avatar Oct 20 '22 19:10 tataraba

Don't forget to add simple_deploy to the INSTALLED_APPS in settings.py

image

Done...

tataraba avatar Oct 20 '22 20:10 tataraba

Going to try the configuration-only deployment.

First, need to create a platform app... Made sure I could log in with the platform CLI. Ran the platform command and was prompted to log in (this is the intended step for logging in with the CLI)

Now, should be ready to create a platform app using:

platform create

Okay, looks like that worked. image

tataraba avatar Oct 20 '22 20:10 tataraba

So now I can run the command:

python manage.py simple_deploy --platform platform_sh

Let's see what happened.

tataraba avatar Oct 20 '22 20:10 tataraba

Whoops.

image

Looks like I didn't activate my virtual environment.... 🤦‍♂️

tataraba avatar Oct 20 '22 20:10 tataraba

Okay, after activating environment and running command, got this:

image

Hmm...

tataraba avatar Oct 20 '22 20:10 tataraba

So going to commit my previous changes... These are related to adding django-simple-deploy and platformshconfig to my list of dependencies (pyproject.toml) and adding simple_deploy to my INSTALLED_APPS...

tataraba avatar Oct 20 '22 20:10 tataraba

Okay, so went ahead and committed to git with those things added and ran the command again....

image

Looking good...

tataraba avatar Oct 20 '22 21:10 tataraba

Looks like since I am using PDM as my dependency manager, simple_deploy is finding my pyproject.toml file and determining that I am using Poetry instead of PDM. Using pip show doesn't work in this case ... (the pdm command would actually be pdm list)

image

tataraba avatar Oct 20 '22 21:10 tataraba

Okay, after activating environment and running command, got this:

image

Hmm...

Thanks! See #136.

ehmatthes avatar Oct 20 '22 21:10 ehmatthes

Looks like since I am using PDM as my dependency manager, simple_deploy is finding my pyproject.toml file and determining that I am using Poetry instead of PDM. Using pip show doesn't work in this case ... (the pdm command would actually be pdm list)

image

Thanks again. See #137.

ehmatthes avatar Oct 20 '22 21:10 ehmatthes