[–] 2 points 5 months ago (1 child)

Unless there’s a detail in here that I’m missing, I think what you want is to have your POST endpoint set the cookie on the flask side via response.set_cookie.

Then you can write a @login_required decorator to add to your login-gated routes that confirms the JWT is valid and unexpired.

  • source
  • [–] 1 point 6 months ago* (last edited 6 months ago)

    Life is too short for ‘sphinx.ext.todo’. It's overrated. Won't have enough hours in the day to hunt within in-code documentation for explanation of things you need to do.

    Your todo list should be in ur CHANGES.rst file. Won't be building the docs just to see todo list.

    Also the moment you have an idea, you immediately write it into CHANGES.rst. Don't wait even one second. Absolutely immediately or as soon as you get home, first thing! Write your idea first, no reading your other ideas. It'll distract you and might cause you to forget.

    Don't even think of making any code changes without writing the idea down first.

  • source
  • [–] 1 point 6 months ago* (last edited 6 months ago)

    i wrote sphinx-external-toc-strict, which is a safer sphinx-external-toc. So i'm competent in Sphinx docs.

    • docs/ folder

    Follow /u/GrumpyBike1020 advise and move the docs/ out of src/ and into the project base folder.

    • venv

    Create two venv .doc/.venv and .venv. Assuming you're using pyenv, create .doc/.python-version and .venv/.python-version and .tox/.python-version. Add these to your .gitignore.

    • requirements management

    Your requirements management is overly simplistic. Do yourself a favor and use wreck to manage multiple venv requirements.

    pyproject.toml configuration

    Copy tox-req.ini into your project base folder.

    • in docs/

    reference docs/conf.py

    add this docs/Makefile modify as needed.

    Here is an example docs/_toc.yml modify for your needs.

    add this rtd config and be aware of the Python version must match Python version in tox.ini. You will forget this, it'll bite you in the ass, then you'll learn this lesson good and hard. Just come to terms that you will make this mistake.

    You are gonna have to get really good at using intersphinx inventories. The docs/Makefile will lessen the learning curve.

    The front page of your site is docs/index.rst, Create folder: docs/code. This is the root folder of your in-code documentation.

    I would like to rename it to “Source Files”

    No you don't. No table of contents in the history of time had a root named, Source files. In the TOC, you'll have a bunch of articles and a code/ folder.

    When you have questions, i'm always paying attention to this community. Just post a question will be sure to see it. Don't forget to provide your projects github repo url. Explain your issue and ask me to fix it. I'll create an GH issue with the proposed change. You have to give me the go ahead before i'll do any coding leading to a PR. I need your assurances that the change meets your approval before starting.

  • source
  • [–] 2 points 6 months ago* (2 children)

    I think Quart is the more modern (async) Flask successor. Or people use FastAPI, ... That's where active development happens. The Flask ecosystem is more stable, mature I guess? There's plenty old plugins without recent updates. But most I had a look at were written in a very clean way, and they're probably perfectly fine. Unless they're niche or you find some discussion about security-related stuff in the bugtracker.

  • source
  • [–] 4 points 6 months ago (1 child)

    Yeah, it’s just mature software.

    There’s not much to depth to flask login; it’s a small convenience layer. You can roll your own user management with werkzeug’s password_hash and cookies if you want.

  • source
  • [–] 3 points 6 months ago* (3 children)

    F-strings and .format() are two features I miss from Python whenever I'm writing stuff in another language. The syntax is just so minimal yet powerful

  • source
  • view more: ‹ prev next ›