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
junnplus
V2EX  ›  Python

flask+react 前后端分离的 web 项目有木有

  •  1
     
  •   junnplus ·
    junnplus · 2015-09-06 09:17:39 +08:00 · 13008 次点击
    这是一个创建于 3165 天前的主题,其中的信息可能已经有所发展或是发生改变。

    rt 。
    不要 todo 之类的项目,最好是线上的。想参考下,谢谢

    22 条回复    2015-09-09 13:07:10 +08:00
    hiwljun
        1
    hiwljun  
       2015-09-06 09:32:38 +08:00
    junnplus
        2
    junnplus  
    OP
       2015-09-06 12:44:08 +08:00
    @hiwljun 谢谢了,搜过了, 233 ,关于提问的艺术我还是知道一些的。
    lidashuang
        3
    lidashuang  
       2015-09-06 13:13:33 +08:00
    项目前端很复杂?
    Shared
        4
    Shared  
       2015-09-06 13:36:13 +08:00
    看 React 的教程就行了, Flask 的作用就是提供 API 给前端
    junnplus
        5
    junnplus  
    OP
       2015-09-06 14:02:34 +08:00
    @Shared 主要借鉴, 233
    junnplus
        6
    junnplus  
    OP
       2015-09-06 14:03:21 +08:00
    @lidashuang 也到不是,就是需要一个完整的参考参考,
    lidashuang
        7
    lidashuang  
       2015-09-06 14:04:12 +08:00
    @junnplus 前端是大坑
    irainy
        8
    irainy  
       2015-09-06 14:19:24 +08:00
    junnplus
        9
    junnplus  
    OP
       2015-09-06 14:34:25 +08:00 via Android
    @lidashuang 主要想学学 restful ,然后配合 react
    lidashuang
        10
    lidashuang  
       2015-09-06 14:36:43 +08:00
    @junnplus restful 昨不看看 Rails
    junnplus
        11
    junnplus  
    OP
       2015-09-06 14:40:14 +08:00 via Android
    @lidashuang 不都一样嘛
    gx
        12
    gx  
       2015-09-06 15:21:36 +08:00
    @junnplus 请移步 flux ; github 里有好几个 demo

    前后端分离无非就是 ajaxcall 的问题。

    please-ajax 、 superagent 这些轻量工具,再用 promise 做 async ;
    swirling
        13
    swirling  
       2015-09-06 16:17:25 +08:00 via iPhone
    😂如果俩都不会的话会很崩的!一个一个玩吧。
    junnplus
        14
    junnplus  
    OP
       2015-09-06 17:25:01 +08:00 via Android
    @swirling flask 会倒是会,主要想学学 restful
    13162951900
        15
    13162951900  
       2015-09-06 19:27:53 +08:00
    额。。 我这边用的 django 做的后端 API

    前台 REACT

    还算顺手
    junnplus
        16
    junnplus  
    OP
       2015-09-06 21:31:05 +08:00
    @13162951900 求项目地址
    dongweiming
        17
    dongweiming  
       2015-09-06 22:36:01 +08:00   ❤️ 1
    @junnplus https://github.com/dongweiming/r 我这个是 flask+mako+ES6+的 一个 https://github.com/qingfeng/p 的 react 版. 你可以看看 - 我这里在模板里面直接加了一些 meta 用来被 react 解析

    但是话说, 你都用 react 了. 使用 api 只能通过 ajax. 这样好么?

    1. 每次先是渲染一个没有内容的页面 然后调用 ajax 从后端获得. 不会初始化的渲染?
    2. react 适合复杂的单页前端场景.
    phx13ye
        18
    phx13ye  
       2015-09-07 11:02:17 +08:00
    弱弱的问下: ajax 你们怎么做页面跳转还有重定向什么的啊
    swirling
        19
    swirling  
       2015-09-07 12:59:05 +08:00 via iPhone
    @junnplus 那其实就没啥必要整合了,直接前后分离啊,和俩仓库差不多。
    junnplus
        20
    junnplus  
    OP
       2015-09-07 18:12:30 +08:00
    @dongweiming thx ,刚接触 react ,我看了一些项目,感觉 react 就是比较适用于单页面场景,而且多页面写起来怪怪的,其实我的目的只是为了参考一些项目学学 restful 和前后端分离的实际应用。
    elvis_w
        21
    elvis_w  
       2015-09-09 11:20:30 +08:00
    junnplus
        22
    junnplus  
    OP
       2015-09-09 13:07:10 +08:00 via Android
    @elvis_w 我就是用 flask-restful ,,,主要想看看具体项目
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4858 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:01 · PVG 12:01 · LAX 21:01 · JFK 00:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.