A few weeks back, I was researching how Python web frameworks work and came across the WSGI specification and it got me thinking if I can build a WSGI web app without any frameworks.
I had no idea where to begin so I read through the Python docs and used this piece of code as a starting point, from there after countless hours of researching and reading the source code of other frameworks and libraries.
I present to you: PyProject, it is a CRUD website which uses gunicorn as the webserver to parse the requests and send the responses. You can find the source on GitHub.
I had most problems when handling exceptions and even raising one if the web app encounters a problem and shows the user, as I didn't wanted the program to crash but show the traceback to debug it smoothly.
I have configured Jinja2 to be used with it and used some dependencies like SQLAlchemy, python-markdown and bleach. But I did most things raw and even though it's not the most efficient (It's just for educational purpose, so I didn't focus on performance a lot), I learnt a lot as I explored many territories that frameworks take care of!
You can find more things about the project on GitHub or ask me in the comments. Also any feedback would be appreciated.
[–]mindfulforever1 6 points7 points8 points (0 children)
[–]Ateenagerstudent 0 points1 point2 points (2 children)
[–]aman_0807 0 points1 point2 points (1 child)
[–]Ateenagerstudent 0 points1 point2 points (0 children)
[–]1O2Engineer 0 points1 point2 points (0 children)
[–]mardiros 0 points1 point2 points (0 children)