Install python3 on MacOS:

brew install python3

Come alone with python3, there are also some other tools are installed as well, for examlpe: 'pip, setuptools'...

We need 'pip' to help us install virtualenv.

Why virtualenv?

Main reason is to resolve the libaraies conflict for different django project. So for each project, you should create new virtual env, and install libraries only for this project, NEVER globally!

Install:

pip3 install virtualenv

Before create a new virtual env, we need to check the python3 location:

which python3

And in my case, it is:

/usr/local/bin/python3

Create new virtual env:

virtualenv -p /usr/local/bin/python3 myFirstProject

Go to the env folder we just create and start working on this env:

cd myFirstProject
. bin/activate

Now we are in the virtual env, we can start install django:

pip install django

To make sure and get familiar where those libraries are installed, we can go to:

ls lib/python3./site-packages

And you should be able to find django is there.

And also you can type:

python   // type paython

>>> import django   // import django lib
>>> django.VERSION // see the verison (, , , 'final', ) // prints out


Other way to create new env with >python3.3 only:

python3 -m venv demo

Deactive you env:

deactivate

List all the libararies:

pip list

[Django] Get started with Django -- Install python and virtualenv的更多相关文章

  1. Install Python+Django+Nginx+UWSGI

    一.软件环境: CentOS6.6_64bit 需要用到的软件: [root@django tools]# ll 总用量 33336 -rw-r--r-- 1 root root 7497785 3月 ...

  2. install python+twisted+mysqldb+django on mac

    一. install python 1) check install or not 在mac终端输入命令:which python 即可查看python的路径 2)未安装时,手动下载安装包 地址:ht ...

  3. CentOS 5系统安装Django、Apache 、mod_wsgi部署Python环境教程

    Django,是一款针对Python环境的WEB开发框架,能够帮助我们构架快捷.简单的WEB框架设置,Django框架非常适合开发内容应用环境,所以在本文中,麦子将整理基于Centos系统部署安装Dj ...

  4. python框架之Django(1)-第一个Django项目

    准备 自己写一个简单的webServer import socket # 生成socket实例对象 sk = socket.socket() # 绑定IP和端口 sk.bind(("127. ...

  5. python 全栈开发,Day69(Django的视图层,Django的模板层)

    昨日内容回顾 相关命令: 1 创建项目 django-admin startproject 项目名称 2 创建应用 python manage.py startapp app名称 3 启动项目 pyt ...

  6. django中将views.py中的python方法传递给html模板文件

    常规的模板渲染 from django.db import models # Create your models here. class ArticalType(models.Model): cap ...

  7. [python][django学习篇][4]django完成数据库代码翻译:迁移数据库(migration)

    上一篇我们已经完成数据库的设计,但是仅仅是python语言,并没有真正创建了数据库表.翻译成数据库语言,真正创建数据库表由django manage.py来实现,这一过程专业术语:迁移数据库 切换到m ...

  8. Django入门到进阶-更适合Python小白的系统课程

    Django入门到进阶-更适合Python小白的系统课程 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程本身 ...

  9. [Django 1]安装Django并创建虚拟虚拟环境项目

    1)安装Django 使用pip来安装,命令如下: pip3 install Djangopip install Django(安装到python2)python3 -m pip install Dj ...

随机推荐

  1. cocos2d-x嵌入移动MM短代支付IAP2.4的SDK,点击支付崩溃的解决的方法

    凡是用IAP2.4,调用purchase.order 游戏崩溃.logcat报错是: 06-16 18:43:42.944: E/AndroidRuntime(8526): FATAL EXCEPTI ...

  2. ontouch、dispatchtouchevent、interceptouchevent-相关事件

    这几天一直在研究onTouch的相关方法,今天我们就来看看onTouchEvent.dispatchTouchEvent.onIntercepTouchEvent这三个方法在控件之间的传递顺序 pub ...

  3. 21.Spring Boot 使用Java代码创建Bean并注册到Spring中

    转自:https://blog.csdn.net/catoop/article/details/50558333

  4. 79.cgi硬盘查询个人信息

    运行截图: 把cgi编码转为char*类型 //把cgi编码转为char*类型 char* change(char *str) { //分配内存 ); //x是tempstr的下标,y是str的下标 ...

  5. AndroidStudio 内存泄漏分析 Memory Monitor

    ok.写一段内存泄漏的code private TextView txt; @Override protected void onCreate(Bundle savedInstanceState) { ...

  6. Python数据结构同Json类型数据相互转换的用法

    在做Python接口自动化的时候,经常要用到Python数据结构同Json类型数据相互转换来供我们做进一步的验证提供数据,在此做个记录和总结 Python数据结构同Json类型数据相互转换的函数有:j ...

  7. 大家好,我是FansUnion,雷文

    友情提示 以下是我在CSDN Code讨论组的自我介绍. 很多CSDN网友,总是重复地问我一些比较常见的问题. 我已经开始机械性地回答网友的问题了. 自我介绍 我的CSDN等媒体的ID,大多带有Fan ...

  8. Dotfuscator use for .net4.0 error solve

    在混淆的时候报错了,错误描述大致如下: Could not find a compatible version of ildasm to run on assembly C:\xxx.dll This ...

  9. 【习题 6-11 UVA - 10410】Tree Reconstruction

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 可以先确定当前这棵子树的dfs序的范围. 然后第一个元素肯定是这棵子树的根节点. 那么只要在这棵子树的范围里面枚举节点. 看看有没有 ...

  10. Java Web学习总结(16)——JSP的九个内置对象

    一.JSP运行原理 每个JSP 页面在第一次被访问时,WEB容器都会把请求交给JSP引擎(即一个Java程序)去处理.JSP引擎先将JSP翻译成一个_jspServlet(实质上也是一个servlet ...