推荐学习书目
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 · May 1, 2015 · 2678 views
    This topic created in 4059 days ago, the information mentioned may be changed or developed.
    开发环境,想直接撸一个angularJS的app,这些静态的东西,怎么由manage.py来host呢,直接配置static file?
    6 replies    2015-05-01 20:36:43 +08:00
    twor2
        1
    twor2  
       May 1, 2015
    django 不是要和 nginx 之类的web 服务器 搭配使用吗?用 nginx 来驱动静态页面

    如果是开发环境,就直接在django project 里面 start一个 app,直接写一个静态页面,配置下 url 即可
    twor2
        2
    twor2  
       May 1, 2015
    还要添加一个 view
    twor2
        3
    twor2  
       May 1, 2015
    pythonee
        4
    pythonee  
    OP
       May 1, 2015
    @twor2 现在想其实可以通过SimpleHTTPServer来host这个webapp,但是呢,然后将angularJS的所有请求发到django上,可是全局怎么配这个ip:port前缀呢,给angularJS
    virusdefender
        5
    virusdefender  
       May 1, 2015 via Android
    用nginx. location / 是静态文件 location /api 反向代理
    pythonee
        6
    pythonee  
    OP
       May 1, 2015
    @virusdefender 恩,我试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5322 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 01:32 · PVG 09:32 · LAX 18:32 · JFK 21:32
    ♥ Do have faith in what you're doing.