
Responder: A familiar HTTP Service Framework - rayraegah
http://python-responder.org
======
setr
Maybe I’ll accept non-monospace fonts for code. You get the right ligatures,
decent kerning, the softer touch of sans-serif... it has some possibility

But psuedo-cursive strings? This font that looks like a retro emulator using a
vectorizing filter?

This is too much. I’m not happy about this development at all.

~~~
reassembled
I believe the font is called Operator Mono and seems to have become
popularized by the React scene. I was using it for a while and actually kind
of like it but lately I've been experimenting with Fira Code, which also has
ligature support.

~~~
meowface
I've tried Fira Code but the ligatures and the overall look and feel of the
font somehow feel too "loud" to me.

Now that I'm looking at Operator Mono, I think I'll actually give that a try.

------
amirathi
What I really need is a python web framework that has first class support for
serving SPA applications (VueJS, React etc).

I spent quite a bit of time setting up my Django app to serve VueJS (replacing
the built-in Jinja templates). Once ready, it became a powerful application
with ORM, middleware and all other Django goodies coupled with modern JS
framework on the frontend.

I hear Rails 6 is going to support modern web frameworks and using npm
libraries, so something like that for Python/Django world.

~~~
giancarlostoro
Sounds like you're confusing the purpose of the web framework. Don't try to
force front-end specifics into a primarily back-end focused web server. Just
because you create web templates for the back-end to RENDER does not mean you
need to force it to push out VueJS. In theory VueJS should be able to run
behind Apache stand-alone and make requests to your Python API which could be
an entirely different codebase. No ambiguity if you did it this way instead,
and some web frameworks let you serve up static files / HTML. If your JS
front-end app is mostly static, you can just serve it up, and serve up basic
HTML from the controller.

~~~
amirathi
I understand the benefits of keeping front-end separate from back-end.

\- Separate teams working on front-end and back-end independently

\- Front end bundle can be served fast and cheap via CDN (only the naive serve
static files with gunicorn/uwsgi right?)

\- and much more

Knowing all that, I chose to mix up VueJS with Django solely to optimise for
speed in a single person company. Thanks to this setup,

\- Authentication is handled via Django sessions (didn't have to spend time on
JWT tokens)

\- I don't need to setup deployment pipeline, monitoring, testing for 2
applications.

\- Keep working on a single codebase and quickly iterate (slightly debatable,
but still).

While the setup is not ideal for everyone, it certainly has advantages that I
value at my current stage. If you're curious this is the application:
[https://reviewnb.com](https://reviewnb.com)

~~~
giancarlostoro
> Authentication is handled via Django sessions (didn't have to spend time on
> JWT tokens)

That's intriguing, wondered how that'd work out with a SPA. I'm not big on
SPA's currently they only make sense for certain type of websites to me, don't
mind them if they're done correctly though. But hey if what you've done works
for you that's good to me, until I have to touch that code :) Hopefully it's
not too awful, it just sounds a little bit out of the norm, but I'd lie if I
said I've never done out of the norm solutions...

> Front end bundle can be served fast and cheap via CDN (only the naive serve
> static files with gunicorn/uwsgi right?)

Not just a CDN, for internal apps I seve all static files through Apache or
nginx. I rather let a normal web server do it's job. I trust a C backend to
serve static files more efficiently than some web framework, but that's just
my personal view.

~~~
kdmytro
Using Django sessions in an SPA is actually very easy. It just works, the
browser handles the cookies for you. The only thing that developers has to do
is to remember to include CSRF header with unsafe requests (such as PUT or
POST), this is usually done by adding some kind of a pre-send hook in your
request library of choice. There is a section in Django docs that explains how
to do just this.

------
monkmartinez
Pretty cool, but I can't shake the feeling that the first example looks an
awful lot like javascript...

Perhaps... Maybe ... its because I have been "cheating" on Python with JS. I
mean, it is a pain in the booty to code up a web app in python without JS. Try
to code a mobile app with Python and Kivy... not all that fun (not practical).
In less than a week with React, I have done both. So... why not just skip
Python all together? I have been asking myself that question.

Bottom line: The authors of this "service framework" states the Python world
doesn't need another web framework, I agree.

It needs some serious love in GUI land.

~~~
basil-rash
I've started to wonder what the place of Python is at all. Machine Learning
has become deeply coupled with Python, so you have that side of things, but
that's not my personal area of interest.

People say that it's good for "short scripts", but whenever I decide to write
something in Python instead of TS, I'm instantly met with so many runtime type
errors that I wonder how people can honestly believe lack of static typing
increases productivity in these "short scripts". For instance, the second I
decide to refactor, I know that even once I think I've cleaned everything up,
the next few minutes will be spent running the code a few times to flush out
all the type errors.

Python is not my primary language, so that could play a part in the issues I
have, but if I am allowed to lose humility for a second or two: even though I
primarily use TS, my Python is still, in my opinion, stronger than many of my
(college student) peers. I hate to imagine all the issues a novice would face.

To be fair, I haven't used mypy in a while. I remember that being decent, but
nowhere near the level of TS, in terms of both the power of the type system
and the editor support.

~~~
paultopia
I wonder if you have a different definition of "short scripts" than many
others. It seems to me that a genuinely short script wouldn't require big
refactors, or types---that would be overkill for a short script.

Personally, I use Python as a Bash replacement a lot, that's what I think of
when I hear "short scripts." Sort of what people used to use Perl for. Pushing
strings around, complicated repetitive filesystem manipulations. (And data
sciencey stuff of course.)

~~~
ryl00
> Sort of what people used to use Perl for.

Used to? People still do this (I should know; I'm one of them).

~~~
paultopia
Heh, fair enough! I think I still have an open-ended bet with a friend about
using Perl 6 for something...

------
daenz
>The Python world certainly doesn't need more web frameworks. But, it does
need more creativity.

Then why create a "new python HTTP service framework"? The Flask and Falcon
communities are very welcoming to creativity.

This project strikes me as a fun side project that doesn't have serious legs
or ambitions, which, don't get me wrong, is totally encouraged and fine!
However, when it's being touted as a new framework for people _to use_ ,
complete with its own logo and testimonials(???), it really presents itself as
yet another soon-to-be unsupported and unmaintained/discarded project. We have
to judge it based on how its presented, and in my humble opinion, it's being
presented as The Hot New Shit, when it's maybe 300 original lines on top of
massive existing frameworks.

~~~
roboyoshi
> This project strikes me as a fun side project that doesn't have serious legs
> or ambitions

And it totally is! "The primary goal here is to learn, not to get adoption"
[1]. Kenneth Reitz is just another developer who created a public repo with
some docs, a logo and the clear indication that it is just for fun. I don't
see why everyone is so on the fence with this.

[1] [https://github.com/kennethreitz/responder#the-
goal](https://github.com/kennethreitz/responder#the-goal)

~~~
guitarbill
Maybe it's a bit disingenuous to claim that's your primary goal when you've
gone to the trouble of designing a logo and adding "testimonials" to your
README.

And Kenneth Reitz isn't "just another developer". He's well known, and isn't
shy to mention his `requests` library ("uses the actual Requests you know and
love").

Cynically, you might say the "just for learning" phrase is a great way of
avoiding comparisons to existing frameworks initially. The thing is, it could
compare favorably. For one thing, Flask and Falcon support/have to support (?)
old Python versions - Falcon even says they support Python 2.6, which is
ridiculous (EDIT: doesn't seem to be true from the tox file, but the website
still claims it does). All that compatibility stuff provides zero value for
new projects.

Background tasks are a great idea. Being a bit opinionated isn't necessarily a
bad thing either; Flask would benefit hugely if they recommend people use app
factories and blueprints from day 1. It adds almost no overhead, but makes
building the application out much, much easier in the future.

------
mychael
Call me old fashioned, but I like functions that return something. Hard pass.

~~~
darpa_escapee
Part of me agrees with you, the other part of me wants to point out that this
can be solved trivially with a decorator.

------
cantcopy
The amount of negative feedback this post is getting is excessive.

~~~
epberry
Agreed. There's a lot to like here.

~~~
biggio
Liking is subjective. It is code written around Flask. Do you really need
that?

~~~
diminoten
Yeah, I think we do.

------
korijn
Are benchmarks available? And "nginx not needed"? Is uvicorn really that
great?

------
theptip
> Background tasks, spawned off in a ThreadPoolExecutor.

This could be very nice; something that I've often found clunky when building
a prototype is the amount of infrastructure required to get a more full-
featured task queue up and running (say Celery or RQ). You can always just run
an event loop, but then you have to reinvent a lot of the nice
delay/scheduling machinery.

------
andrewstuart
async & fstrings - seems Kenneth is on board with Python 3 then.

One of his other really great applications is "das inbox"
[https://github.com/kennethreitz/inbox.py](https://github.com/kennethreitz/inbox.py)
\- it's brevity is inspiring - actually Responder seems very similar to das
inbox.

~~~
giancarlostoro
It's not very encouraging to see that one as archived by the developer. I'd
hope this new web framework he made doesn't end up the same way. I wouldn't
mind experimenting with it.

------
reilly3000
As a very regular Requests user I'm pretty excited about Responder. There are
times when I just want to stand up a 'glue' API, and this looks extremely
convenient for that purpose. I've wasted too many hours futzing with
flask+WSGI+nginx+ubuntu to want to stand up something with it on a whim.

~~~
reilly3000
I was able to follow a whim and use responder for a simple task where I just
need to provide a single endpoint with one parameter that returns a JSON
object with data from a SQL query. After about 2 hours (mostly spent trying to
get a dependency issue ironed out) and 13 lines of code I have everything I
need. I'm a happy customer so far.

------
0hn0
What about the performance of python-responder?

------
biggio
I used to hire people who have created their own frameworks like this one and
our codebase were so bloated. At one point I had to let people go and spend
the next year removing tens of thousands of lines of useless nonsense. Since
that lesson, I look at candidates Github and if I see a custom built
framework, I pass, regardless of how good they performed.

~~~
basil-rash
You can do that if you want... but it seems a bit extreme to rule out a
candidate based on one project that could be really quite well designed and
useful for whatever community it aims to benefit.

~~~
servercobra
Especially considering there's a big difference between what people work on
for fun/publish to Github and what they'd consider using in a workplace
environment.

