V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pythonee
V2EX  ›  Python

django 怎么用 manage.py host 一个 angularJS 的 app

  •  
  •   pythonee · 2015-05-01 19:24:40 +08:00 · 2174 次点击
    这是一个创建于 3334 天前的主题,其中的信息可能已经有所发展或是发生改变。
    开发环境,想直接撸一个angularJS的app,这些静态的东西,怎么由manage.py来host呢,直接配置static file?
    6 条回复    2015-05-01 20:36:43 +08:00
    twor2
        1
    twor2  
       2015-05-01 19:31:06 +08:00
    django 不是要和 nginx 之类的web 服务器 搭配使用吗?用 nginx 来驱动静态页面

    如果是开发环境,就直接在django project 里面 start一个 app,直接写一个静态页面,配置下 url 即可
    twor2
        2
    twor2  
       2015-05-01 19:32:59 +08:00
    还要添加一个 view
    twor2
        3
    twor2  
       2015-05-01 19:34:52 +08:00
    pythonee
        4
    pythonee  
    OP
       2015-05-01 19:46:09 +08:00
    @twor2 现在想其实可以通过SimpleHTTPServer来host这个webapp,但是呢,然后将angularJS的所有请求发到django上,可是全局怎么配这个ip:port前缀呢,给angularJS
    virusdefender
        5
    virusdefender  
       2015-05-01 19:59:39 +08:00 via Android
    用nginx. location / 是静态文件 location /api 反向代理
    pythonee
        6
    pythonee  
    OP
       2015-05-01 20:36:43 +08:00
    @virusdefender 恩,我试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3349 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:54 · PVG 18:54 · LAX 03:54 · JFK 06:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.