程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python Django web page project migration

編輯:Python

The whole process is roughly divided into three steps :mysql Installation and configuration ,python Environment configuration and django transfer

Environmental Science :window10,mysql8.0,python3.8

One ,MySQL Installation and configuration

Tried several installation methods , The rookie tutorial is better , For details, please refer to MySQL Novice tutorial

1,window10 System

See website https://www.runoob.com/mysql/mysql-install.html

(1)MySQL download

Windows Installation on MySQL It will be relatively simple , The latest version can be found in  MySQL download   Download and view

Click on  Download  Button to go to the download page , Click  No thanks, just start my download.  You can download it immediately :

 

After downloading , We will zip Extract the package to the corresponding directory , Here I put the unzipped folder in  C:\program\mysql Next .

(2)MySQL install

Open the folder you just unzipped C:\program\mysql , Create... Under this folder  my.ini  The configuration file , edit  my.ini  Configure the following basic information ( Be careful : You need to change the code basedir= Installation directory after ):

[client]
# Set up mysql Client default character set
default-character-set=utf8
[mysqld]
# Set up 3306 port
port = 3306
# Set up mysql Installation directory
basedir=C:\\program\\mysql
# Maximum connections allowed
max_connections=20
# The character set used by the server defaults to 8 Bit coded latin1 Character set
character-set-server=utf8
# The default storage engine that will be used when creating a new table
default-storage-engine=INNODB

At the command prompt CMD in cd Into the C:\program\mysql\bin

Initialize database :

mysqld --initialize --console

After execution , Will be output root User's initial default password , Such as :

...
2018-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: APWCY5ws&hjQ
...

APWCY5ws&hjQ  It's the initial password , Just remember . Subsequent login needs to use , You can change your password after logging in .

Enter the following installation commands :

mysqld install

Start and input the following command :

net start mysql

Sign in MySQL root user :

mysql -u root -p

stay enter passwor: Then enter the initial password just generated

(3)MySQL To configure

The previous step has entered mysql Command line .

You can choose to modify root User password is root, stay mysql> Post input :

set password for [email protected] = password('root'); 

 2,Ubuntu

https://www.cnblogs.com/opsprobe/p/9126864.html

https://blog.csdn.net/weixx3/article/details/80782479

Two ,python Package and environment configuration

Enter into the relevant python Environmental Science , direct pip Just install the required package .

My virtual environment , stay pycharm Directly prompt to create virtual environment and install related packages

3、 ... and ,django transfer

stay CMD in cd Enter the project directory , This directory has a manage.py file , Execute... In the directory

python manage.py migrate

If the relevant package is missing , Will report a mistake .pip Install well

A database error will also be reported , This is because it was built before mysql There is no our database

stay CMD Input in :mysql -u root -p And the root Password entry mysql establish

create database db_eye character set utf8

When everything is configured , Again django Enter again in the directory

python manage.py migrate

If successful, the following interface will be displayed , It means success

notes :django The project will have administrative users and passwords , Again django Execute under directory :

python manage.py createsuperuser

Set login user and password


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved