Installing the required software

简介: Installing Python on Mac OSXInstalling virtualenv$ pip3 install virturalenv -- 安装虚拟环境$ virtualenv ENV -- 创建自己的虚拟环境,会创建如图下的目录结构virtualenv-15.
  1. Installing Python on Mac OSX
    • Installing virtualenv
      $ pip3 install virturalenv -- 安装虚拟环境
      $ virtualenv ENV -- 创建自己的虚拟环境,会创建如图下的目录结构
      virtualenv-15.0.3

      Paste_Image.png

使用虚拟环境的原因:

1. for example, if one of your web applications requires 
one version of the library and another application, 
due to some legacy or compatibility issues, r
equires another version of the same library,
or if changes made in one library or 
application break the rest of the applications
2. Virtualenv can be used to avoid such problematic situations. 
It will create its own environment so that 
it will not mess with your global settings. 
It usually creates its own directories and 
shared libraries to make virtualenv work 
without any external interference
  1. Installing Django
    $ pip3 install Django==1.10.3 -- 安装Django不指定版本的话安装最新版本
    验证是否安装成功
    $ django-admin.py --version
    显示版本表示安装成功

Paste_Image.png

django-admin作用说明:
django-admin.py
This utility is the heart of Django's project management facilities,
as it enables the user to do a range of project management tasks, including these:
• Creating a new project
• Creating and managing the project's database
• Validating the current project and testing for errors
• Starting the development web server

启动服务:

$ python3 manage.py runserver 0.0.0.0:<port number>

Paste_Image.png

注意:我们只是用了pip3安装了django,所以启动时使用命令python3 manage.py runserver,如果使用python manage.py runserver会报异常提示未安装django

目录
相关文章
kali2022.1The following packages were automatically installed and are no longer required
kali2022.1The following packages were automatically installed and are no longer required
82 1
|
6月前
|
自然语言处理 IDE Java
GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag
GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag
87 0
CMake 3.7.2 or higher is required. You are running version 2.8.12.2
CMake 3.7.2 or higher is required. You are running version 2.8.12.2
282 0
configure: error: Library requirements (libpcre >= 7.8) not met
configure: error: Library requirements (libpcre >= 7.8) not met
136 0
成功解决The following specifications were found to be incompatible with the existing python installation
成功解决The following specifications were found to be incompatible with the existing python installation
|
Python Windows
"The TARGETDIR variable must be provided when invoking this installer"的解决方案
"The TARGETDIR variable must be provided when invoking this installer"的解决方案
329 0
"The TARGETDIR variable must be provided when invoking this installer"的解决方案