Maxxcan 3 years ago
Maybe a dark mode for pjuu? @Joe
  • 5

Replies

  • Joe 3 years ago
    @sigg3 I did see BackgroundTask, but its for after request tasks looking at it, like sending e-mails etc. I will take a deeper look, I just need to dispatch the image resizing in to a seperate executor.

    Websockets are nice, I only have experience of using them in NodeJS though.
    • 1
  • Sigg3 3 years ago
    @Joe: you can either use async/await and more workers (I use the uvicorn server) but there's also a Background Task class.

    I'm playing around with websockets and JavaScript in my latest project, and starlette is very performant.

    Unfortunately my own code not so much:)
    • 1
  • Joe 3 years ago
    Off the back of this, I'm taking a look at tailwind to see if that can help with the re-style and dark mode. The CSS is all over the joint TBH (I'm not a frontend guy). @sigg3 I also took a deeper look at Starlette. It does seem pretty nice, Trying to find if it has a nice way of moving work to a seperate process/thread. Resizing images will block the event loop too long.
    • 1
  • Pazuzu 3 years ago
    Good idea 👍 ..
    • 2
  • Joe 3 years ago
    @sigg3 yea they're all valid points. It's not around the change to Python itself, I still love the language. It's more around the fact that their are too many projects competing to make asyncio frameworks and tools. None of them seem to support all the features we get with Flask out of the box. Asyncio doesn't help with speed of code, just concurrency.
    • 1
  • Sigg3 3 years ago
    @joe I'm not sure what you mean, since I'm entirely new to it and just an amateur coder. However, asyncio doesn't take away the GIL, it just optimizes its usage IMO. For me it comes down to one more method for effective use of resources (e.g. httpx.get that reuses the TCP session in context is incredibly fast when compared to requests.get). It doesn't really change python, just makes parts of it faster at runtime :)
    • 1
  • Joe 3 years ago
    @sigg3 I've looked at Starlette. In my opinion, the async story in Python still doesn't feel there yet. The plans we have to take advantage of it are most likely going to be to rewrite in Go eventually. When I get the time that is.
    • 1
  • Sigg3 3 years ago
    I'm using #starlette in my recent projects. It's like flask just asynchronous.
    • 1
  • Joe 3 years ago
    @maxxcan cool. Flask is just lighter weight than Django, it should be pretty easy for you :)
    • 1
  • Maxxcan 3 years ago
    @Joe I know something about django. I´ll try to install in my server and play with that.
    • 2
  • Joe 3 years ago
    The goal at the moment is to re-write the entire site to clean up a lot of the cruft. But front end is always transferable. If you have any questions feel free to ask :)
    • 1
  • Sigg3 3 years ago
    Cheers, I'll have a look ;)
    • 2
  • Joe 3 years ago
    • 2
  • Joe 3 years ago
    Feel free @sigg3 pull requests are always welcome :)
    • 2
  • Sigg3 3 years ago
    I've recently used jinja2 (last three months) and "know" css from before, perhaps I can help..?
    • 2
  • Joe 3 years ago
    The front end is all CSS and Jinja2 templates, the CSS is a bit of a mess because I didn't really know frontend stuff when I wrote Pjuu. It's not the worse though.
    • 1
  • Sigg3 3 years ago
    @joe is it css? Python?
    • 2
  • Joe 3 years ago
    It's already in the list and has been for a long time unfortunately. I real struggle with time these days
    • 2
  • Sigg3 3 years ago
    Yes. Think about the environment!
    • 3