Thanks to Docker, which abstracts from the conditions of any particular host, Divio Cloud gives you a guarantee that what works locally will also work in the Divio Cloud. However, this does depend upon following the same install/deploy cycle locally that takes place when a deployment is made via the Divio Control Panel, so although you get the guarantee, it can slow down your progress with interruptions of a few minutes each time you have to rebuild.

The deployment process is complex and has to resolve many conditions. It also has to cope with issues such as conflicting dependencies of different packages.

It's possible to shorten the cycle locally, as long as you also conduct a full test deployment locally before attempting to deploy to the cloud.

Faster local development cycles

Here is one way to obtain a faster development cycle:

Start your docker web container in the usual way. 

divio project up

Then drop into the container's bash prompt:

docker-compose run --rm --service-ports web bash

Run the Django development server inside the container: 

python manage.py runserver 0.0.0.0:8000

Now that you have checked the server runs, update/add Python packages as required (and keep an eye on any dependencies that are installed): 

pip install some-package

Run the server again:  

python manage.py runserver 0.0.0.0:8000

Rinse and repeat, adding packages as required.

Once you're confident about your changes, exit the container:

exit 

Add the packages you've installed earlier to requirements.in: container: 

echo "some-package" >> requirements.in

 and finally, test the rebuilding of the container:

docker-compose build 

This is the perfect time to get a coffee or tea.

Did this answer your question?