How-tos

Getting Started with Django on IBM Cloud

Share this post:

We just released a new starter kit on IBM Cloud App Service that makes it easy to get started on a production-ready Django app. IBM Cloud App Service helps developers build cloud native applications by generating pre-configured, production-ready starters. This post will teach you how to create the new Django starter. Django is a python web framework that follows the Model View Controller architectural pattern that emphasizes reusability and rapid development for complex, data driven websites. In this tutorial, we will go over how to create, build, run, and deploy a Django Web Basic starter.

 Prerequisites

I will also assume that you are logged into the Bluemix CLI and the Bluemix Container Registry CLI.  You should also have a Kubernetes cluster created in Bluemix, and configured with the Kubernetes CLI.

 Creating the Application

  1. Navigate to the AppService Console and click to create your Project from pre-defined Starter Kits.

  2. Click on Starter Kits and scroll down to select the Python Django Basic starter

  3. Enter a project name which will also be the Django project and app name.

  4. Click on Create Project to scaffold a Django application.

  5. [Optional] To add cognitive and data services, click on Add service.
  6. Click on Download Code

 Deploy to IBM Cloud

After your project code is downloaded, navigate to the project’s directory folder:

  1. To build your project, run bx dev build
  2. To run your project locally, run bx dev run
  3. To deploy your project to Cloud Foundry, run bx dev deploy
  4. To deploy your project to Kubernetes, run bx dev deploy –target container and follow the command prompts

You should see a splash page like this one if successful:

More How-tos stories

Securing your Python app with OpenID Connect (OIDC)

Some weeks back I introduced to a tutorial on how to analyse GitHub traffic. The tutorial combines serverless technology and Cloud Foundry to automatically retrieve statistics and store them in Db2. The data can then be accessed and analyzed using a Python Flask app. Today, I am going to show you how the web site is protected using OpenID Connect and IBM Cloud App ID.

Continue reading

Custom login page for App ID integration

When developing an application that integrates with App ID, the standard hosted login page has a few options to change the colours or logo. In some cases, this isn't enough and direct customisation is necessary. There exists a handy guide for a custom App ID login screen in mobile applications, however for web applications a little more effort is required.

Continue reading

Modernize your old JPetStore app with containers, Kubernetes and AI

Follow the GitHub tutorial and video to update JPetStore, a traditional Java web app, into a modern sales channel using Docker containers, Kubernetes, Watson Visual Recognition and text messaging.

Continue reading