Deployment of the Python-Django app to GCP

Note: Started with a reinstall of Mac OS X Mojave for a clean start:


  1. Installed pip (package manager)
  2. First attempt to setup Django w/ PostgreSQL
      "In addition to a database backend, you’ll need to make sure your Python database bindings are installed. If you’re using PostgreSQL, you’ll need the psycopg2 package."
      • Ran into an error!
  3. Downloading PostgreSQL with GUI Instead
      • Includes (PostgreSQL server, pgAdmin (for managing and developing databases), and StackBuilder (package manager for download/installing additional PostgreSQL tools and drivers)
      • Downloading Version 11.4 for Mac OS X
      • Success!!
    • Back to the GCP documentation "Running Django in the App Engine flexible environment"
      • Downloaded the Google Cloud SDK command line tools
      • Creating the Django project
        Question... "Don't I need a virtual environment?"
        The answer is YES
      • Installing/Setting up the virtual environment:
      • Initializing your Cloud SQL instance
        Run 3 different commands then use another terminal window
      • Set up the project files
        static folder
        templates folder (2)
        requirements.txt (command to create: pip list --format freeze > requirements.txt)
      • Download/install all tools into environment (see image below)

    technical-details (1)

    Helpful links

    Screenshot of environment

    Deployment was successful in the 4th trial!


1 Like