Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mariomartinezsz/a8879293de31522af6c9297902e07948 to your computer and use it in GitHub Desktop.

Select an option

Save mariomartinezsz/a8879293de31522af6c9297902e07948 to your computer and use it in GitHub Desktop.
Setup Python 3 + Django 1.10 + Virtual Environment on MacOS Sierra

How to Set Up Python 3 + Django 1.10 + a Virtual Environment on MacOS Sierra

You will need an open Terminal.

Note: If you don't have Homebrew go to https://brew.sh in order to install it. It's simple. Maybe something as:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If you don't have Python 3

brew install python3

Creating a directory for a new project

mkdir my_new_project

Let's go into the new directory:

cd my_new_project

Creating a Virtual Environment for the project

python3 -m venv myNewEnv

From here we need to activate the new environment:

source myNewEnv/bin/activate

Installing libraries with Pip

pip install django

Pillow is for images:

pip install pillow

If you gonna use PostgreSQL

pip install psycopg2

Creating a Django project

django-admin.py startproject my_new_project .

Creating a Django app

./manage.py startapp my_new_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment