python之路 搭建django框架

2021-07-04 16:26:33 字數 3633 閱讀 2766

1、在yaolansvr 192.168.0.3上安裝python-3.4.3.tar.xz

使用xmanager5的xftp5將檔案上傳到ftp目錄

2、安裝原始碼的python

注意:(1)ignoring ensurepip failure: pip 6.0.8 requires ssl/tls

解決:需要安裝yum -y install openssl-devel.x86_64

# yum list all|grep glibc

glibc.x86_64                              2.12-1.149.el6                   @base

glibc-common.x86_64                       2.12-1.149.el6                   @base

glibc-devel.x86_64                        2.12-1.149.el6                   @base

glibc-headers.x86_64                      2.12-1.149.el6                   @base

compat-glibc.x86_64                       1:2.5-46.2                       base 

compat-glibc-headers.x86_64               1:2.5-46.2                       base 

glibc.i686                                2.12-1.47.el6                    base 

glibc-devel.i686                          2.12-1.47.el6                    base 

glibc-static.i686                         2.12-1.47.el6                    base 

glibc-static.x86_64                       2.12-1.47.el6                    base 

glibc-utils.x86_64                        2.12-1.47.el6                    base 

# rpm -qa|grep glibc

glibc-common-2.12-1.149.el6.x86_64

glibc-2.12-1.149.el6.x86_64

glibc-headers-2.12-1.149.el6.x86_64

glibc-devel-2.12-1.149.el6.x86_64

# yum list all|grep openssl

openssl.x86_64                            1.0.1e-30.el6                    @base

krb5-pkinit-openssl.x86_64                1.9-22.el6                       base 

openssl.i686                              1.0.0-20.el6                     base 

openssl-devel.i686                        1.0.0-20.el6                     base 

openssl-devel.x86_64                      1.0.0-20.el6                     base 

openssl-perl.x86_64                       1.0.0-20.el6                     base 

openssl-static.x86_64                     1.0.0-20.el6                     base 

openssl098e.i686                          0.9.8e-17.el6.centos             base 

openssl098e.x86_64                        0.9.8e-17.el6.centos             base 

# rpm -qa|grep openssl

openssl-1.0.1e-30.el6.x86_64

(2)make install錯誤

make可以,而make install不行,是因為make一般指進行原始碼的編譯和鏈結,生成可執行檔案,make install是將編譯好的程式複製到實現部署的目錄結構中;

解決:如果安裝的時候指定了prefix,直接刪除就好。如果沒有,並且源**沒有提供make uninstall/distclean/veryclean的功能,一般這樣做:找乙個臨時目錄重新安裝一遍。

比如./configure --prefix=/tmp/to_remove && make install然後遍歷/tmp/to_remove裡的檔案,把你原來安裝位置的檔案都刪除。

mount /dev/cdrom /mnt

yum makecache --disablerepo=epel ##最好修改.repo檔案關閉

yum install readline-devel -y

yum -y install xz.x86_64 

cd /yangsq/ftp/

xz -d python-3.4.3.tar.xz

tar xvf python-3.4.3.tar

yum -y install openssl-devel.x86_64 ##pip必須需要這個依賴包,2.x不需要

./configure --prefix=/usr/local/python3.4.3  ##makefile在這個步驟建立

make&&make install

successfully installed pip-6.0.8 setuptools-12.0.5

ln -sv /usr/local/python3.4.3/bin/python3.4 /usr/bin/python3.4

3、使用pip安裝django(installing an official release with pip)

/usr/local/python3.4.3/bin/pip3.4 install django

successfully installed django-1.8.3

4、驗證是否成功安裝django

pwd/usr/local/python3.4.3/bin

ll *django*

-rwxr-xr-x. 1 root root 286 8月  18 17:11 django-admin

-rwxr-xr-x. 1 root root 145 8月  18 17:11 django-admin.py

python3.4

>>> import django

>>> django.version

(1, 8, 3, 'final', 0)

python的django介紹 Django 簡介

django 簡介 自強學堂的django教程將節省你大量的時間,並且使你的web開發充滿樂趣。通過django,你可以建立乙個高效能的web應用而只花費最少的時間和精力。django 中提供了開發 經常用到的模組,常見的 都為你寫好了,通過減少重複的 django 使你能夠專注於 web 應用上有...

python考勤系統 使用Djang的考勤系統

型號attendance choices absent absent present present class head of department models.model first name models.charfield max length 200 last name models.c...

Python 之路(2 環境搭建

一 關於python版本 python版本的選擇,不做贅述,網上資料眾多,自行選擇。二 安裝python 本博選擇的是python3.7.0,之後的 也基於此版本。三 關於ide 工欲善其事必先利其器,python之路必從python ide開始。有很多的python ide工具可以用,但是要從中選...