Hint: You can adjust the default video playback speed in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Set Up the PostgreSQL Database

Give Feedback

Welcome back! You’re ready to build the foundation for a GIS enabled web application. This video will walk you through installing the necessary components for our app, starting with our database system. For review, these are the components of our application:

The data is stored in PostGreSQL with the PostGIS extension. Because we have a GIS enabled database, we will also want a GIS-enabled model, which is able to recognize and work with geographic queries. We can achieve this on our Django web application by enabling the GeoDjango framework.

GeoDjango needs a few dependencies to operate correctly, such as GDAL, GEOS and PROJ.4. These drivers can be installed individually, but getting them to install and work correctly can be tricky.

Since the objective of this tutorial is to get you up and running quickly with a simple location-aware app, we will install an open-source GIS application called QGIS, which just happens to install these drivers correctly and efficiently. The only caveat is, at the time of this video recording, QGIS does not yet work with Python 3.7 so if you don’t have it installed already you’ll need a copy of Python 3.6 on your system as well.

You’ll be installing our components in this order: PostgreSQL with PostGIS extension, followed by a copy of Python 3.6 (if you don’t have it already installed). After that, QGIS (so we have an easy driver installation), then Django through Pip followed by enabling GeoDjango. And if you stick around, I’ve also included a bonus video on adding Leaflet mapping to your web page.

Comments & Discussion

rootxy on April 30, 2019

Thank you!

Abby Jones on July 25, 2019

I accidentally ran it with upgrade checked, and now I don’t see the example DB in pgadmin. Is that a dealbreaker?

Abby Jones on July 25, 2019

Nevermind, I broke out the Mac Mini and it went in np. Now my problem is downgrading to 3.6.

Abby Jones on July 25, 2019

Yeah, I don’t know how to install Python 3.6 from the source apparently (even though I did the ./configure, make, and make install. I’m going to have to pass on this tutorial unfortunately.

kilodalton on Aug. 8, 2019

The tool pyenv is an easy way to install different Python versions on one machine. https://github.com/pyenv/pyenv

lesgod on June 11, 2020

Hello I Have a problem. I dont now how to deal with it

“could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “localhost” (127.0.0.1) and accepting TCP/IP connections on port 5432?”

Become a Member to join the conversation.