其他分享
首页 > 其他分享> > Pycharm前期准备_Pycharm安装Pycharm激活码使用流程开发Django项目

Pycharm前期准备_Pycharm安装Pycharm激活码使用流程开发Django项目

作者:互联网

 

一、Pycharm激活码2021年11月Pycharm软件前期准备

1、Pycharm软件专业版本使用前期准备

2、在官网下载Pycharm软件2018.3版本以上的建议下载比较新的 2020或者2021年版本的

3、我这里参考的其他博主Pycharm激活码获取方法,这里我把原文放在下面(参考地址上);

参考地址:https://www.jianshu.com/go-wild?ac=2&url=https%3A%2F%2Fvrg123.com

5、安装完成pycharm软件后打开根据提示到最后一步会弹出窗口让你输入激活码的

6、或者创建一个项目后依次点击菜单上的 help - register - Activate Pycharm - Activation code

 

二、 创建Django项目


1.开放式pycharm软件
2.单击菜单栏中的〖文件〗→〖新建项目〗,系统将弹出如下对话框,如下图所示:

 

2.基本配置
1.静态文件目录配置(客户端用于访问后台服务的静态文件资源,如boot、jQuery、CSS文件等)
(1) 找到以项目名称命名的文件夹
(2) 打开settings.py文件
(3) 静态在文件的末尾U在url='/Static/'下添加以下代码

STATICFILES_DIRS = [
    os.path.join(BASE_DIR,'static')
]

2.数据库连接配置(默认数据库为SQLite,下面以MySQL为例进行配置)
(1) 安装pymysql模块(Django默认使用MySQL DB模块操作数据库,不支持Python 3)
单击文件-->设置打开以下对话框

单击“+”将弹出以下对话框

只需按照步骤操作即可
(2) 设置默认数据库连接模块
在现场开始。将以下代码添加到PY文件中

import pymysql
pymysql.install_as_MySQLdb()

(3) 修改默认数据库连接配置
配置默认数据库连接

改为如下所示代码

复制代码
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'test', #数据库名称(需要在mysql数据库中先创建好)
        'USER':'root',#数据库用户名
        'PASSWORD':'123456',#数据库密码
        'HOST':'127.0.0.1', #主机地址
        'PORT':3306 #端口号
    }
}
复制代码

 

提示:Pycharm激活码,我们把下面的激活码复制下来,打开软件Pycharm,依次选择:help - register - Activate Pycharm - Activation code ,粘贴进去即可;如果下面的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