成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

django+centos+cx_Oracle開發(fā)環(huán)境搭建

godlong_X / 2602人閱讀

摘要:設(shè)置固定重啟配置文件使之生效安裝安裝略安裝文件如下然后讓新環(huán)境生效安裝如果默認(rèn)源被墻壁打開文件在其中添加然后重啟網(wǎng)卡使用命令數(shù)據(jù)庫數(shù)據(jù)庫添加以下內(nèi)容到然后讓新環(huán)境

Linux設(shè)置固定IP

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.116
NETMASK=255.255.0.0
GATEWAY=192.168.0.1
ONBOOT=yes
TYPE=Ethernet
重啟配置文件使之生效

/etc/init.d/network restart

pip 安裝

tar -xzvf pip-1.5.4.tar.gz
pip install xxx -i http://pypi.douban.com/simple

django 安裝

Oracle client 安裝

./centos_cx_Oracle.sh 文件如下:

#!/bin/bash

# INSTALL ORACLE INSTANT CLIENT #
#################################

# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there"s a good chance that you don"t have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space

# Install basic dependencies
sudo yum -y install libaio bc flex

echo "Now go get some the following two RPMs ..."
echo "- basic: oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm"
echo "- SDK/devel: oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm"
echo "... from this URL: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html"
echo "WARNING: It"s pretty annoying, they make you sign up for an Oracle account, etc."
echo "I will assume you have put these two files are into ~/Downloads"
echo "Press any key once you"re ready" && read -n 1 -s

sudo rpm -ivh ~/Downloads/oracle-instantclient11.2-basic-*
sudo rpm -ivh ~/Downloads/oracle-instantclient11.2-devel-*
sudo rpm -ivh ~/Downloads/oracle-instantclient11.2-sqlplus-*


# SET ENVIRONMENT VARIABLES #
#############################

# Source for this section: http://cx-oracle.sourceforge.net/BUILD.txt

# (SIDENOTE: I had to alter it by doing some digging around for where the Oracle RPMs really installed to;
# if you ever need to do this, do a command like this:
#     rpm -qlp )

echo "# Convoluted undocumented Oracle bullshit." >> $HOME/.bashrc
echo "export ORACLE_VERSION="11.2"" >> $HOME/.bashrc
echo "export ORACLE_HOME="/usr/lib/oracle/$ORACLE_VERSION/client64/"" >> $HOME/.bashrc
echo "export PATH=$PATH:"$ORACLE_HOME/bin"" >> $HOME/.bashrc
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$ORACLE_HOME/lib"" >> $HOME/.bashrc
. $HOME/.bashrc

# INSTALL cx_Oracle #
#####################

pip install cx_Oracle

然后讓新環(huán)境生效 source ~/.bash_profile

cx_Oracle 安裝

error: command "gcc" failed with exit status 1
yum -y install gcc-* libxml2-devel python-devel mysql-devel

如果centos默認(rèn)源被墻壁

打開文件/etc/resolv.conf在其中添加:
nameserver 8.8.8.8
然后重啟網(wǎng)卡:使用命令: service network restart
/usr/lib/oracle/11.2/client64/network/admin/tnsnames.ora

 
x =  
(DESCRIPTION =   
(ADDRESS_LIST =  
(ADDRESS = (PROTOCOL = TCP)(HOST = 數(shù)據(jù)庫IP)(PORT = 1521))  
)  
(CONNECT_DATA =  
(SID = 數(shù)據(jù)庫)  
)  
)  

添加以下內(nèi)容到 /etc/profile

 
export ORACLE_HOME=/usr/lib/oracle/11.2/client64  
export TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/  admin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib;

然后讓新環(huán)境生效 source /etc/profile

然后再安裝PIL庫

用pil產(chǎn)生驗(yàn)證碼出現(xiàn):ImportError: The _imagingft C module is not installed
這個(gè)是由于PIL沒有編譯freetype導(dǎo)致的

需要先安裝jpeg庫
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
tar -zxvf jpegsrc.v7.tar.gz
cd jpeg-7
CC="gcc -arch x86_64"
./configure --enable-shared --enable-static
make
make install
然后再安裝PIL庫

讓PIL支持freetype的方法
1、安裝freetype開發(fā)庫
yum install freetype-devel

2、下載源代碼
http://effbot.org/downloads/Imaging-1.1.7.tar.gz

3、修改setup.py文件

JPEG_ROOT = libinclude("/usr/local")
FREETYPE_ROOT = "/usr/lib64","/usr/include/freetype2/freetype"

4、查看支持項(xiàng)
python setup.py build_ext -i
--- FREETYPE2 support available 注意這一項(xiàng)

5、編譯安裝
python setup.py install
若上面的設(shè)置都失敗,則只能拿出下面的殺手锏:

sudo apt-get build-dep python-imaging
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
pip install -U PIL

當(dāng)現(xiàn)下面的提示時(shí),則說明安裝成功了:

--------------------------------------------------------------------PIL 1.1.7 SETUP SUMMARY--------------------------------------------------------------------version 1.1.7platform linux2 2.7.3 (default, Apr 10 2012, 22:21:37) [GCC 4.6.3]----------------------------------------------------------------------- TKINTER support available--- JPEG support available--- ZLIB (PNG/ZIP) support available--- FREETYPE2 support available*** LITTLECMS support not available--------------------------------------------------------------------

DjangoCaptcha 安裝

用于驗(yàn)證碼生成

xlwt 安裝

pip install xlwt

unipath 安裝

pip install unipath

ORA-21561: OID generation failed

添加 127.0.0.1 主機(jī)名稱 到 /etc/hosts

關(guān)閉防火墻

iptables -F

django 測試

settings文件修改:

DEBUG = True
INTERNAL_IPS = ("127.0.0.1", "192.168.1.100")
cron服務(wù)
/sbin/service crond start
/sbin/service crond stop
/sbin/service crond restart
/sbin/service crond reload
web服務(wù)器時(shí)間同步

ntpdate time.nist.gov

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/17359.html

相關(guān)文章

  • django+centos+cx_Oracle開發(fā)環(huán)境搭建

    摘要:設(shè)置固定重啟配置文件使之生效安裝安裝略安裝文件如下然后讓新環(huán)境生效安裝如果默認(rèn)源被墻壁打開文件在其中添加然后重啟網(wǎng)卡使用命令數(shù)據(jù)庫數(shù)據(jù)庫添加以下內(nèi)容到然后讓新環(huán)境 Linux設(shè)置固定IP vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.0.116 NE...

    libin19890520 評論0 收藏0

發(fā)表評論

0條評論

最新活動(dòng)
閱讀需要支付1元查看
<