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

django 日志问题

  •  
  •   shawlib · 2018-12-24 12:45:18 +08:00 · 1889 次点击
    这是一个创建于 1943 天前的主题,其中的信息可能已经有所发展或是发生改变。
    想让 django 输出每次 request POST 过来的 json 数据,LOGGING 应该怎么配置?求大佬解答 0.0
    14 条回复    2018-12-25 12:14:14 +08:00
    Trim21
        1
    Trim21  
       2018-12-24 12:54:26 +08:00 via Android   ❤️ 1
    自己手动加一个中间件
    Vegetable
        2
    Vegetable  
       2018-12-24 13:08:28 +08:00   ❤️ 2
    https://docs.djangoproject.com/en/2.1/topics/http/middleware/

    if request.method=="POST":
    logger.debug(request.body)
    ithou
        3
    ithou  
       2018-12-24 13:10:07 +08:00 via Android
    跑个题。Django 怎么用 Pycharm 打开 db.sqlite3 数据库文件
    Trim21
        4
    Trim21  
       2018-12-24 13:10:57 +08:00 via Android
    @ithou 找一下 有一个 database 的功能,可以用来连接数据库的
    xpresslink
        5
    xpresslink  
       2018-12-24 13:27:27 +08:00
    @ithou Django 怎么用 Pycharm 打开 db.sqlite3 数据库文件

    你这不是跑跑题而是语无论次
    shawlib
        6
    shawlib  
    OP
       2018-12-24 14:10:43 +08:00
    哈哈,感谢感谢
    fei110339
        7
    fei110339  
       2018-12-24 15:56:41 +08:00
    lifeintools
        8
    lifeintools  
       2018-12-24 15:59:30 +08:00
    问个问题。django 需要 join 多张表的查询数据,怎么写比较合适?
    neoblackcap
        9
    neoblackcap  
       2018-12-24 16:00:56 +08:00
    @lifeintools raw sql
    ithou
        10
    ithou  
       2018-12-24 17:51:15 +08:00 via Android
    @xpresslink 写代码写傻了?戾气。麻烦你 Block me. 我重新组织语言:在 PyCharm 里面的 Django Project 里,请问如何才能打开,并浏览 db.sqlite3 数据库文件?
    Phishion
        11
    Phishion  
       2018-12-24 18:03:48 +08:00
    @ithou 帮你找了一个 https://www.jianshu.com/p/32556afe548f 希望能帮到你
    julyclyde
        12
    julyclyde  
       2018-12-25 10:20:07 +08:00
    @ithou 是该 block 你。你为什么来这里跑题啊!
    xpresslink
        13
    xpresslink  
       2018-12-25 11:35:27 +08:00
    @ithou 其实你的问题和 django 根本没有关系好吧,再者你需要把文件和库两个不同概念搞清楚。尽管你努力地重新组织了语言,但还是没有什么轮次。我第一次回复你的那句无论是从你的做法上还是事实上并没有说错,你回复里头一句就说我写代码写傻了?反倒说我戾气。确实要 block 你。
    ithou
        14
    ithou  
       2018-12-25 12:14:14 +08:00 via Android
    @xpresslink 谢谢您!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   870 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:36 · PVG 05:36 · LAX 14:36 · JFK 17:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.