Wtf. I didnt know. Great.
comments
All of the nice Python build tools are getting slopifed. OpenAI just bought Astral (the folks who make uv and ruff).
To be clear, the endpoint I should modify is the api login one?
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.
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.
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.
Why is docs a child of src? Also: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
Solid choice. I like Flask's design. They have good documentation as well. And PieFed (and probably lots of other projects) also rely on flask-login and all these extensions.
Quart looks interesting but I'll probably stick with flask for now. I figured flask-login was probably fine but I wanted confirmation
That's good to know, if other packages use it, it's probably safe
Weil I wasn't sure wether or not it was actually mature enough to not be updated anymore, that's why I asked, but from the other replies, it seems it's safe
Ok, I figured it was probably fine but I wanted confirmation
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.
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.
You may want to look at https://flask-security.readthedocs.io/en/stable/ It's layered on top of flask-login and has had commits in the past week.
reasonable answer
Go mainly. fmt has some functions to do the same sort of formatting but I loved the minimal syntax in Python. JavaScript has a really nice syntax for it as well actually
in what language?
Ah nice one
{:.0f} always works though for floats or ints
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
Luckily, there's now t-strings (e.g. t"{buh}") for that use case (among many others). Here's the PEP: https://peps.python.org/pep-0750/
Most importantly you can't use them with translated strings, so it's not usable for user facing strings unless you don't care. This limits fstring usefulness a lot in the projects I work on.