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

目录
相关文章
|
算法 Java Go
Go语言GC:详解GC的五个阶段
【2月更文挑战第20天】
388 0
|
JavaScript 前端开发
location.href和 window.location的区别有这些!
location.href和 window.location的区别有这些!
3427 3
|
1天前
|
人工智能 运维 安全
|
4天前
|
SpringCloudAlibaba 负载均衡 Dubbo
微服务架构下Feign和Dubbo的性能大比拼,到底鹿死谁手?
本文对比分析了SpringCloudAlibaba框架下Feign与Dubbo的服务调用性能及差异。Feign基于HTTP协议,使用简单,适合轻量级微服务架构;Dubbo采用RPC通信,性能更优,支持丰富的服务治理功能。通过实际测试,Dubbo在调用性能、负载均衡和服务发现方面表现更出色。两者各有适用场景,可根据项目需求灵活选择。
377 124
微服务架构下Feign和Dubbo的性能大比拼,到底鹿死谁手?
|
6天前
|
人工智能 JavaScript 测试技术
Qwen3-Coder入门教程|10分钟搞定安装配置
Qwen3-Coder 挑战赛简介:无论你是编程小白还是办公达人,都能通过本教程快速上手 Qwen-Code CLI,利用 AI 轻松实现代码编写、文档处理等任务。内容涵盖 API 配置、CLI 安装及多种实用案例,助你提升效率,体验智能编码的乐趣。
627 107
|
3天前
|
Java 数据库 数据安全/隐私保护
Spring 微服务和多租户:处理多个客户端
本文介绍了如何在 Spring Boot 微服务架构中实现多租户。多租户允许单个应用实例为多个客户提供独立服务,尤其适用于 SaaS 应用。文章探讨了多租户的类型、优势与挑战,并详细说明了如何通过 Spring Boot 的灵活配置实现租户隔离、动态租户管理及数据源路由,同时确保数据安全与系统可扩展性。结合微服务的优势,开发者可以构建高效、可维护的多租户系统。
200 127
|
3天前
|
Web App开发 前端开发 API
在折叠屏应用中,如何处理不同屏幕尺寸和设备类型的样式兼容性?
在折叠屏应用中,如何处理不同屏幕尺寸和设备类型的样式兼容性?
226 124