Django Development on Mac

From Littledamien Wiki
Revision as of 17:26, 31 August 2015 by Video8 (talk | contribs) (Created page with "Category:Django Category:Python Category:Web Development == Software == === Python === Use version 3.x. As of 2015, version 2.7 comes pre-installed on Mac. It's...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Software[edit]

Python[edit]

Use version 3.x. As of 2015, version 2.7 comes pre-installed on Mac. It's necessary to manually install Python 3.

Django[edit]

If multiple versions of Python are installed on the system, it's necessary to create a virtualenv to install Python packages such as Django. See Python Virtual Environments

N.B. The iMac that was purchased in 2015 came with python 2.x installed. Python 3 was manually installed.

In this situation typing python on the command line invokes python 2.x.

To invoke python 3.x it's necessary to use python3. Similarly, pip will install for python 2.x, while pip3 installs for python 3.x.

Database[edit]

Recommended database is PostgreSQL.

The PostgreSQL server is running on littledamienii. It's not necessary to have a local database server.

However, python does require the psycopg2 package in order to connect to the database.

If multiple versions of Python are installed on the system, it's necessary to create a virtualenv to install Python packages such as psycopg2. See Python Virtual Environments
  • Download the PostgreSQL installer & run it.
  • Install pip: sudo easy_install pip
  • Django projects that use PostgreSQL databases depend on the psycopg2 package.
    • This should simply be a matter of sudo pip install psycopg2, but that install depends on pg_config, which appears to be part of the "Homebrew" install of PostgreSQL.
    • Don't install PostgreSQL using the EnterprisesDB installer.
    • Install with "Homebrew": brew install postgresql [1]
    • With the Homebrew installation of PostgreSQL, pip should be able to install psycopg2.

IDE[edit]

PyCharm[edit]

See Django Development on Windows for a list of PyCharm's features.

Other IDEs[edit]

  • Sublime Text
  • Atom
  • KDevelop

Articles & websites comparing Python IDEs[edit]

Notes[edit]

See also[edit]

References[edit]