Install Django under Mac

Source: Internet
Author: User
Tags install django

Reference articles

One: Write in front
The Django series of learning notes mainly to study, and did not have to write a product to do the market mentality. So many framework configuration bloggers are based on the principle of simplicity, if you want to find in the pursuit of stable, high-performance Django related content, I am afraid to be disappointed. But I think if you are a novice like me, we should learn together and progress together.

Two: About Python
Since it's a Python web Framework, of course you have to install Python. But the most stable Python is installed by default on Mac, so we don't have to worry about it. If you are a win under the classmate, you can refer to the installation of Python. With the most basic environment, we will begin the next step.

Three: Download Django
Download the latest stable version from here: Django-1.x.y.tar.gz, remember is the latest official version Oh. Where x.y is the version number. ~ Next go to the folder directory where you downloaded the file, execute the following command: (Mac default is/users/xxx/downloads,xxx is your username)

tar xzvf Django-1.x.y.tar.gz

IV: Installing Django
Installation directory:/system/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/ Django-1.7.2-py3.4.egg/django/bin

/*第三步中解压出来的文件夹*/cdDjango-1.x.ysudo python setup.py install

V: Test if localhost is successful
In general, the first step in building any site framework locally is to test localhost for successful access.

由于django-admin.py这个命令并没有在shell的查找路径当中,我门需要修改.bash_profile文件

Add the following code:

Path= "/system/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/ Django-1.7.2-py3.4.egg/django/bin:${path} "
Export PATH

Then we can test it out:

/*创建一个Django目录,以后我们所有的测试样例都将储存在这里*/sudo mkdir ~/Document/DJangocd~/Document/DJango /*创建一个用于测试Localhost的网站样例*/django-admin.py startproject testLocalHost /*启动网站服务*/cdtestLoacalHostpython manage.py runserver

At this point you will get some service startup information, in your browser input: http://localhost:8000 test it success? With it works you can

Install Django under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.