Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

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 Your Venv, Django, and GeoDjango

Give Feedback

It’s finally time to get started on our Django project and get to work in Python. We’ll start by creating a virtual environment, then install Django with Pip, and then enable GeoDjango.

Make sure you have the following items installed and working before you continue:

  • PostgreSQL with PostGIS
  • A shops database with PostGIS extension; and
  • Our geographic drivers, either installed on their own or as part of QGIS.

With that foundation in place you’re ready to start the web server portion of your project using the Django and GeoDjango frameworks.

Comments & Discussion

Milan NIkolic on May 1, 2019

Thank you Jackie, That was flawless. I truly enjoyed the course and finally signed up for RealPython. It was a matter of time. Just couldn’t resist finishing this series. After checking out the site, I am extremely happy I made that decision. Thanks and all the best to you and everybody at RealPython! M

Jackie Wilson RP Team on May 1, 2019

I think that’s one of the nicest compliments I’ve received. Thank you so much Milan. Real Python is full of great stuff; I’m grateful and honored to be a part of it.

Milan NIkolic on May 1, 2019

You are very welcome Jackie. I am looking forward to your future releases.

suneel0310 on May 9, 2019

Thanks in advance Jackie,

I am facing one issue that shops sub folder is not creating after enterning the command like django-admin.py startprojects shops .

Can you help me on that what i am missing.

Jackie Wilson RP Team on May 9, 2019

Do you get any error when you try to run the script? Did your pip command correctly install Django? Also, are you on Windows?

suneel0310 on May 31, 2019

Thanks for your reply. I was busy with office work for the past 3 weeks, so i did not check your reply.

I was not getting any error when i ran the script. I hope pip command installed Django properly. yes i am on windows.

Let me check again by installing the Django andI will let you know if i am not getting again, please help me out.

hithard on Sept. 11, 2019

Hi Jackie,

I do not see shops directory being created after i run “django-admin.py startproject shops .” I just see the django-admin.py file open in pycharm when above command is run. django is installed as shown in previous step. even i reinstalled django but same issue. i m using win10 operating system. pls advice

Koldaman on Sept. 20, 2019

Hi Jackie,

Thanks for your very easy explanation and teaching methods. I am facing same thing @hithard mentioned.

Koldaman on Sept. 20, 2019

@ Hithard i founda way use this command line

django-admin startproject shops .

hithard on Sept. 22, 2019

@Koldaman it works. thanks a lot

Mahesh on April 12, 2020

While activating Source code im getting below error -

python -m venu myvenv – Created and next line i was giving below command source myvenv/bin/activate Error :Source is not recognized as an internal o0r external command,operable program or batch file PLs hellp

Mahesh on April 12, 2020

Above issue was in Windows …``

Ricky White RP Team on April 13, 2020

Hi maheshtpmail. That is the command for a UNIX OS. For Windows create you venv as before, then activate it with this instead:

myvenv\Scripts\activate.bat

If you are using Powershell instead of CMD use this one:

myvenv\Scripts\Activate.ps1

Mahesh on April 13, 2020

Thanks Rick - now its working — another problem im facing is after running below command django-admin.py startproject shops . it is creating only admin folder im not getting geoshops and shops folder

Ricky White RP Team on April 14, 2020

What does your folder structure look like?

Mahesh on April 17, 2020

Do we have any option to share screen(On your available time) and solve issue instead of waiting for a day to week and lossing time.

Ricky White RP Team on April 19, 2020

@maheshtpmail As you will see in the video you run django-admin startproject shops . inside the geoshops directory. Make sure you have created your geoshops directed first, then cd into the directory before your run the startproject command.

Mahesh on April 19, 2020

Thanks rick … Going through Django basic video - I will try again and update you… Little confusion with Mac installation commands and Windows Installation ....

Thanks for your quick support.

Mahesh on April 25, 2020

If we have screenshot feasibility it will be easy to send error –

Hey Rick issue now is after activating in Windows with below command myvenv\Scripts\activate.bat

(myvenv) C:\Users\Mahesh\geoshops1>charm . ‘charm’ is not recognized as an internal or external command, operable program or batch file.

Charm . comman is not recognizing and when i open pycharm directly from winodws geoshops1 folder and myvenv folder is not created in pycharm

Ricky White RP Team on April 26, 2020

Hi @maheshtpmail.

If you are to open Pycahrm from the terminal is then you need to type pycharm . not charm ..

Also you will need to tell Pycharm which interpreter you are using in the project settings. If you’re new to Pycharm, I’d recommend starting here: realpython.com/pycharm-guide/

Mahesh on April 27, 2020

Thanks Ricky - I will go though the link…

Become a Member to join the conversation.