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

django 接口开发优劣势

  •  
  •   caixuanxu · 2018-01-19 22:04:46 +08:00 · 4706 次点击
    这是一个创建于 2259 天前的主题,其中的信息可能已经有所发展或是发生改变。

    公司做的是前后端分离 两个不同的项目 前端调用后端的接口。刚学了 django 就想问问 django 实现 api 的方式

    7 条回复    2018-01-22 17:59:12 +08:00
    tinypig
        1
    tinypig  
       2018-01-19 22:18:26 +08:00   ❤️ 3
    poorguy
        2
    poorguy  
       2018-01-19 22:45:28 +08:00   ❤️ 3
    graphql 也不错。http://graphene-python.org/ 前后端都有 sdk,对接妥妥的
    caixuanxu
        3
    caixuanxu  
    OP
       2018-01-19 23:17:17 +08:00
    有没有关于这方面项目实战的视频教程
    neoblackcap
        4
    neoblackcap  
       2018-01-20 03:40:46 +08:00   ❤️ 1
    坑少就用 django-rest-framework,写 restful API。至于 graphql 啊,我看是坑特别大。看了 graphene 的源码,一个字段查一遍数据库,这是要搞死人。
    graphql 我看要做好啊,那大概是要把一个 graphql 的解析层做到业务层,要不然没法搞。缓存都没法搞
    janxin
        5
    janxin  
       2018-01-20 07:32:55 +08:00 via iPhone
    你要是内部没什么人用,可以用 graphql,否则你数据库一定很快挂
    franky_xhl
        6
    franky_xhl  
       2018-01-20 14:10:59 +08:00
    投 django-rest-framework 一票,成熟稳定。

    graphql 有可能是未来的方向,目前还比较新,出了问题要自己解决。
    twotiger
        7
    twotiger  
       2018-01-22 17:59:12 +08:00
    django-rest-framework
    没用过,感觉适合简单的数据进出,批量做大量的接口比较方便

    我用自带的 View, 参考 http://python.usyiyi.cn/translate/django_182/topics/class-based-views/intro.html
    你自己权衡吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4322 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:12 · PVG 18:12 · LAX 03:12 · JFK 06:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.