.........

作者: 落魄de少爷 | 来源:发表于2017-07-21 10:51 被阅读0次

    Djiango:
    -python版本3.4
    -使用virtualenv实现多个互不干扰的开发环境
    一:安装python3.4环境
    [root@localhost ~]# cd /usr/src/
    [root@localhost src]# wget --no-check-certificate https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
    [root@localhost src]# tar zxvf Python-3.4.1.tgz
    [root@localhost src]# cd Python-3.4.1
    [root@localhost Python-3.4.1]# ./configure --prefix=/usr/local --with-zlib --enable-shared
    [root@localhost Python-3.4.1]# make ***
    [root@localhost Python-3.4.1]# make install
    [root@localhost Python-3.4.1]# echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
    [root@localhost Python-3.4.1]# ldconfig
    [root@localhost Python-3.4.1]# python3****Python 3.4.1 (default, Feb 16 2017, 14:56:29)[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>*
    二:
    [root@localhost ~]# useradd ylh
    [root@localhost ~]# su - ylh****virtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/premkprojectvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/postmkprojectvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/initializevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/premkvirtualenvvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/postmkvirtualenvvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/prermvirtualenvvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/postrmvirtualenvvirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/predeactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/postdeactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/preactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/postactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/get_env_details
    [ylh@localhost ~]$ vim ~/.bashrc

    •   增加:   *
      
    •         export WORKON_HOME=~/.virtualenvs**             source /usr/bin/virtualenvwrapper.sh**             export SERVER_PROJECT_NAME=ylhserver**             export SERVER_ENV=prod*
      

    [ylh@localhost ~]$ source ~/.bashrc
    [ylh@localhost ~]$ mkvirtualenv ylhserver ###rmvirtualenv ylhserver### ###deactivate###New python executable in /home/ylh/.virtualenvs/ylhserver/bin/pythonInstalling setuptools, pip, wheel...done.virtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/ylhserver/bin/predeactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/ylhserver/bin/postdeactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/ylhserver/bin/preactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/ylhserver/bin/postactivatevirtualenvwrapper.user_scripts creating /home/ylh/.virtualenvs/ylhserver/bin/get_env_details
    (ylhserver) [ylh@localhost ~]$ workon ylhserver
    (ylhserver) [ylh@localhost ~]$ mkvirtualenv -p /usr/local/bin/python3 ylhserver****Running virtualenv with interpreter /usr/local/bin/python3Using base prefix '/usr/local'New python executable in /home/ylh/.virtualenvs/ylhserver/bin/python3Not overwriting existing python script /home/ylh/.virtualenvs/ylhserver/bin/python (you must use /home/ylh/.virtualenvs/ylhserver/bin/python3)Installing setuptools, pip, wheel...done.
    (ylhserver) [ylh@localhost ~]$ python****Python 3.4.1 (default, Feb 16 2017, 14:56:29)[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
    NGINX
    参考server配置文件:
    ##########################################################################################
    server {listen 80;server_name newvip.gold-finance.com.cn;location / {root /data/dist/dist;index index.html index.htm;try_files $uri $uri/ /index.html;}location /api {include uwsgi_params;uwsgi_pass 127.0.0.1:7777;# proxy_pass http://vipapi.gold-finance.com.cn/;# rewrite ^(.)$ http://vipapi.gold-finance.com.cn permanent;}location /jcwechat {include uwsgi_params;uwsgi_pass 127.0.0.1:7777;# proxy_pass http://wxjccf.gold-finance.com.cn;}}
    server {
    listen 80;server_name filevip.gold-finance.com.cn;location / {root /data/download;index index.html index.htm;}error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}*
    ##########################################################################################

    相关文章

      网友评论

          本文标题:.........

          本文链接:https://www.haomeiwen.com/subject/exgskxtx.html