V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
aias
V2EX  ›  问与答

nginx 部署 django 碰到的一些问题

  •  
  •   aias · 2015-12-21 11:41:03 +08:00 · 1347 次点击
    这是一个创建于 3062 天前的主题,其中的信息可能已经有所发展或是发生改变。

    按着《 Python Web 开发:测试驱动方法》教程来的,处于第 8 章。
    然而本问题和书里的内容联系不大。

    1 、 django 是跑起来的
    可以访问

    Django version 1.8.5, using settings 'superlists.settings'
    Starting development server at http://127.0.0.1:8000/
    Quit the server with CONTROL-C.
    

    2 、 nginx 配置: site-avaliable 下的 superlists

    server  {
    listen 8001;
    server_name localhost;
    
    location / {
        proxy_pass http://localhost:8000;
    }
    }
    

    并且已做软连接至 site-enabled 下。

    可是访问 127.0.0.1:8001 还是没有,求指导!

    iEverX
        1
    iEverX  
       2015-12-21 13:13:39 +08:00
    可以试试 uwsgi
    这个直接 proxy_pass localhost ,和直接运行 django server 有什么区别吗?
    aias
        3
    aias  
    OP
       2015-12-21 22:38:01 +08:00
    @iEverX 感谢你的回复。教程上是这么写的
    -----
    现在测试一下配置:
    elspeth@server:$ sudo service nginx reload
    elspeth@server:$ ../virtualenv/bin/python3 manage.py runserver
    -----
    并没有提到 uwsgi 。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1085 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 19:23 · PVG 03:23 · LAX 12:23 · JFK 15:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.