[Django] Get started with Django -- Install python and virtualenv
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的更多相关文章
- Install Python+Django+Nginx+UWSGI
一.软件环境: CentOS6.6_64bit 需要用到的软件: [root@django tools]# ll 总用量 33336 -rw-r--r-- 1 root root 7497785 3月 ...
- install python+twisted+mysqldb+django on mac
一. install python 1) check install or not 在mac终端输入命令:which python 即可查看python的路径 2)未安装时,手动下载安装包 地址:ht ...
- CentOS 5系统安装Django、Apache 、mod_wsgi部署Python环境教程
Django,是一款针对Python环境的WEB开发框架,能够帮助我们构架快捷.简单的WEB框架设置,Django框架非常适合开发内容应用环境,所以在本文中,麦子将整理基于Centos系统部署安装Dj ...
- python框架之Django(1)-第一个Django项目
准备 自己写一个简单的webServer import socket # 生成socket实例对象 sk = socket.socket() # 绑定IP和端口 sk.bind(("127. ...
- python 全栈开发,Day69(Django的视图层,Django的模板层)
昨日内容回顾 相关命令: 1 创建项目 django-admin startproject 项目名称 2 创建应用 python manage.py startapp app名称 3 启动项目 pyt ...
- django中将views.py中的python方法传递给html模板文件
常规的模板渲染 from django.db import models # Create your models here. class ArticalType(models.Model): cap ...
- [python][django学习篇][4]django完成数据库代码翻译:迁移数据库(migration)
上一篇我们已经完成数据库的设计,但是仅仅是python语言,并没有真正创建了数据库表.翻译成数据库语言,真正创建数据库表由django manage.py来实现,这一过程专业术语:迁移数据库 切换到m ...
- Django入门到进阶-更适合Python小白的系统课程
Django入门到进阶-更适合Python小白的系统课程 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程本身 ...
- [Django 1]安装Django并创建虚拟虚拟环境项目
1)安装Django 使用pip来安装,命令如下: pip3 install Djangopip install Django(安装到python2)python3 -m pip install Dj ...
随机推荐
- 深度学习 Deep Learning UFLDL 最新Tutorial 学习笔记 3:Vectorization
1 Vectorization 简述 Vectorization 翻译过来就是向量化,各简单的理解就是实现矩阵计算. 为什么MATLAB叫MATLAB?大概就是Matrix Lab,最根本的差别于其它 ...
- ListView-divider 分割线的设置
1.去掉分割线 android:divider="@null" 2.设置分割线颜色跟宽度 android:divider="#19000000" android ...
- 00089_字节输出流OutputStream
1.字节输出流OutputStream (1)OutputStream此抽象类,是表示输出字节流的所有类的超类.操作的数据都是字节,定义了输出字节流的基本共性功能方法: (2)输出流中定义都是写wri ...
- Swift iOS tableView static cell动态计算高度
TableView是iOS开发中经常使用的组件.有些表格由于UILabel包括的文本字数不一样,须要显示的高度也会不同,因此须要动态计算static cell的高度.我用的是static cell,注 ...
- JS中的闭包问题总结
严格意义上的闭包,严格闭包通过栈内存不销毁,保护内部变量,而且下一级作用域可以访问内部变量 更严格意义上的闭包,函数可以在父函数外面调用父函数作用域的值 在函数执行的时候,函数体中有返回值,函数执行的 ...
- python3 格式化输出给定时间的下一秒
# 功能:输入一个时间,格式化输出该时间的下一秒 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan # 功能:输入一个 ...
- Hypervisor scheduler
Techniques for configuring a hypervisor scheduler to make use of cache topology of processors and ph ...
- python opencv3 —— 改变颜色空间(color space)
OpenCV: Changing Colorspaces 1. 查看 opencv 支持的颜色空间转换 opencv 中色彩空间转换由一些定义的全局的宏给出,使用如下的代码,将它们调出: >&g ...
- UVA 10943 - How do you add? 递推
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...
- [Angular] Angular Advanced Features - ng-template , ng-container, ngTemplateOutlet
Previously we have tab-panel template defined like this: <ul class="tab-panel-buttons" ...