Posts
Variable Management for Django on Upsun
Why Upsun for Django? Upsun stands out as a comprehensive platform for Django developers that addresses many common pain points in Django deployment and development.
Ready-to-use services: Redis, PostgreSQL, Kafka, Elastic Search, Open Search and more Environment cloning for testing and development (great for teams working together) Infrastructure-as-code for version-controlled server setups Local development boost through service tunneling Integrated Blackfire profiling for performance optimization These features collectively create an ecosystem that streamlines Django development, from local coding to production deployment.
read morePosts
Compile your Python code to Pycache on Upsun
When the python interpreter executes python files, it compiles them to bytecode and saves it as files in a directory called __pycache__ in the same directory as the code itself. You might have seen such files, here’s an example from a Django project:
$ ls -1 __pycache__/ __init__.cpython-311.pyc admin.cpython-311.pyc apps.cpython-311.pyc models.cpython-311.pyc tests.cpython-311.pyc views.cpython-311.pyc This saves time by allowing the compile step to be skipped in subsequent executions.
On Upsun, python code is deployed onto a read-only file system.
read morePosts
Develop Django Locally - PostgreSQL and Redis on Upsun
This post shows how to develop Django locally using the PostgreSQL and Redis servers in the cloud, on Upsun.
There are several reasons why a developer would want to develop without installing a copy of the services on their local computer:
Time and effort: why install services you don’t need if they’re available elsewhere? Data: If you’re working on a production site, there’s likely production data that influences how the app works.
read morePosts
Background Tasks using Celery with Redis in Django on Upsun
In this post I show a minimal Django application that runs on Upsun. It has a PostgreSQL database, a Python Gunicorn application server, a Gunicorn Worker that runs Celery tasks, and a Redis server that manages the state of the Celery queue. I recommend reading my previous two articles on running Django on Upsun for information on how to get this code deployed.
This Django appplication is simple, with a single file upload field.
read morePosts
Install Django with PostgreSQL and PGVector on Upsun
In my article “Install Django with SQLite on Upsun”, I explain why I love the Upsun PaaS and some of the great features you get when you use it. The next step in developing a production-worthy Django site on Upsun is to move to using an enterprise-grade database, PostgreSQL. In this tutorial, I also show how to install and use the PGVector extension because the apps that I’m building need the ability to do semantic queries on vectors, in part to do Retrieval Augmented Generation (RAG) with Large Language Models (LLM) such as ChatGPT or Claude.
read morePosts
Install Django with SQLite on Upsun
What is Upsun? Upsun is a new Platform-as-a-Service (PaaS) offering from Platform.sh. As a PaaS, it is for developers who want to focus on writing the application code and not on the infrastructure that runs it. Here are some of the features that you get with Upsun:
Support for many languages, including Python, PHP, Ruby, and many others. Support for many databases, including PostgreSQL, MariaDB, MongoDB and others. Support for other neat services like Redis, OpenSearch, Kafka, and Vault.
read more