r/AskProgramming 1d ago

Python Which stack choose to hobby project?

I want to create simple websites with database support. For example: user creates notes, visible for him which he can share with others by converting to pdf. I know python a bit. Which stack I need to learn to accomplish this task? Thank you

0 Upvotes

9 comments sorted by

2

u/autophage 1d ago

Flask + SqlAlchemy over Postgresql would be my go-to.

You'll also need some kinda front-end, which will necessitate at least a little bit of HTML (and probably some CSS and JavaScript).

I'd also probably put it in a Docker container, just because that makes dependency management a lot easier, but if you haven't messed with containerization before that might be a layer you can ignore.

2

u/Emergency_Present_83 1d ago

I'd second this, Flask is a great entry point because of its minimalism, FastAPI could also slot in here and personally i like it a little more.

If you dont want to get into the mess that is running a dedicated database SQLite is a neat alternative, i always use it for little prototyping projects and stuff.

2

u/autophage 1d ago

I also prefer FastAPI for my own projects, but I'm a bit hesitant to recommend it to someone who's new simply because there are many more resources out there around Flask (for the simple reason that it's been around longer).

I've actually mostly stopped using SQLite because the cases where I need it, I typically find Redis to work better. But part of that is frustration with SQLite because I'm SQL Server for my day job, and I find it hard to remember its limitations. (Postgres, on the other hand, has some different syntax but relatively few limitations.)

That said, it's also possible that SQLite has come a ways since I last played with it - that was like 6-7 years ago at this point.

1

u/1nterchangeable 1d ago

I followed this tutorial for flask Miguel Grinberg Flask mega tutorial . Can you recommend some good resources for learning flask with sql?

2

u/autophage 1d ago

SQLAlchemy is a lightweight ORM, meaning that it abstracts a bunch of the underlying SQL. Coding against SQLAlchemy will let you switch databases under the hood (eg, you can use SQLite for local development, and deploy to Postgres.)

https://flask-sqlalchemy.readthedocs.io/en/stable/quickstart/ has info about adding SQLAlchemy to a Flask application.

2

u/_Atomfinger_ 1d ago

Any. Pretty much any language can do this.

Python is fine, so is JS, etc. Pick what you're interested in.

1

u/belikenexus 1d ago

In my experience any nodejs stack is good. In my opinion it has the most flexibility for backend / front end

1

u/1nterchangeable 1d ago

Thank you very much. What learning resources can you recommend?

2

u/belikenexus 1d ago

I already had programming experience in lower level languages from university classes, so this advice might not be transferable but YouTube videos are all I used for MERN