Get started with the Python framework Django on Mac OS X

A note to get started with the Python framework Django tutorial in a Mac environment.

Environmental check

% uname -a
Darwin grappa.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64

% python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

%  which python 
/usr/bin/python

Installation

Install Python package manager pip

sudo easy_install pip

Install django

sudo pip install django

Confirm installation at the Python prompt

% python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print django.get_version()
1.6.5

1.6.5 has been installed!

By the way, I found a useful guy on Homebrew.

brew install homebrew/completions/django-completion

Start the tutorial

Although it is for Django 1.4, there was a Japanese tutorial, so I will try it first.

% django-admin.py startproject mysite
% tree mysite
mysite
├── manage.py
└── mysite
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

1 directory, 5 files
% python manage.py runserver
Validating models...

0 errors found
June 13, 2014 - 23:18:08
Django version 1.6.5, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Open http://127.0.0.1:8000/ in your browser and you'll see Welcome to Django!

Welcome to Django

Django Site Admin

-> % python manage.py syncdb
Creating tables ...
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'tumf'): 
Email address: [email protected]
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Recommended Posts

Get started with the Python framework Django on Mac OS X
[Blender x Python] Let's get started with Blender Python !!
Continuation ・ Notes on preparing the Python development environment on Mac OS X
Install lp_solve on Mac OS X and call it with python.
Django 1.11 started with Python3.6
Run Zookeeper x python (kazoo) on Mac OS X
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
Get started with Python on macOS Big Sur
Shpinx (Python documentation builder) on Mac OS X
How to get started with the 2020 Python project (windows wsl and mac standardization)
Get started with Django! ~ Tutorial ⑤ ~
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
Python3 + Django ~ Mac ~ with Apache
Getting Started with Python Django (1)
Get started with Django! ~ Tutorial ④ ~
Getting Started with Python Django (4)
Getting Started with Python Django (3)
Get started with Django! ~ Tutorial ⑥ ~
Build a Python development environment on Mac OS X
Install PyQt5 with homebrew on Mac OS X Marvericks (10.9.2)
Getting Started with Python Django (6)
Memo on Mac OS X
Get started with Python! ~ ② Grammar ~
Getting Started with Python Django (5)
Steps to use the AWS command line interface (Python / awscli) on Mac OS X
Word Count with Apache Spark and python (Mac OS X)
Using multiple versions of Python on Mac OS X (2) Usage
Let's get started with Python ~ Building an environment on Windows 10 ~
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Minimum knowledge to get started with the Python logging module
Test Python with Miniconda on OS X and Linux with travis-ci
How to install Theano on Mac OS X with homebrew
Get started with Python! ~ ① Environment construction ~
Link to get started with python
Get started with MicroPython (on macOS)
Install Sphinx on Mac OS X
Get the weather with Python requests
Get the weather with Python requests 2
How to get started with Python
How to get started with Django
Install mitmproxy on Mac OS X
Getting started with Python 3.8 on Windows
Get started with Python in Blender
Install pgmagick on Mac OS X 10.9
How is the progress? Let's get on with the boom ?? in Python
Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
Quickly install OpenCV 2.4 (+ python) on OS X and try the sample
I tried to get started with Bitcoin Systre on the weekend
Step notes to get started with django
CRUD GET with Nuxt & Django REST Framework ②
[Python] Get the variable name with str
Follow active applications on Mac with Python
Installed aws-cli On Mac OS X Lion
How to erase Python 2.x on Mac.
CRUD GET with Nuxt & Django REST Framework ①
Download files on the web with Python
Get started with the documentation tool Sphinx
Build Python environment with Anaconda on Mac
Get Started with TopCoder in Python (2020 Edition)
How Python beginners get started with Python with Progete
Installing PIL with Python 3.x on macOS