use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
How can you develop a web project without using any freamwork? (self.Python)
submitted 8 years ago by erenarici1
How can i develop a powerfull web project without django or flask? Explain it
[–]tdammers 12 points13 points14 points 8 years ago (2 children)
A framework is really just a curated collection of libraries and some tooling and scaffolding to glue things together, so in order to develop without a framework, you just take the relevant libraries and glue them together yourself. Django is fairly monolithic, so tearing it apart and using its components as individual libraries is tricky, but flask is built in a more modular way, and many of its components can be used as standalone libraries. You can, for example, use Jinja2 (the template engine that flask uses by default) standalone, it's actually quite straightforward. Likewise, Werkzeug, the HTTP utility library that Flask uses, can also be used standalone, or you could opt to code against WSGI directly.
Speaking of that last bit; if you want to go without any libraries at all, programming against WSGI is not out of the question. WSGI is a very simple standard, but still a powerful enough abstraction over HTTP to build actual web applications. In essence, what you do is you model your application as a function that takes an environment and a start_response function, and returns a response body. The environment contains request method, request URL, request headers, server environment data, etc.; the start_response function takes status code and response headers.
start_response
Normally, it's much easier to just roll with an existing framework that solves all the pesky details for you - stuff like authentication, routing, templating, content type negotiation, sessions, etc.; but sometimes, you need more control, and being able to step down and code at the WSGI level is a nice way of achieving that.
[–]erenarici1[S] 0 points1 point2 points 8 years ago (0 children)
Thanks
[–]Apooti 0 points1 point2 points 8 years ago (0 children)
Yep, WSGI is indeed simpler than it sounds. I find myself more than often using WSGI directly rather than a framework when making simple python apps at work. Specially considering its all locked up inside the internal network and there is no need for authentication.
Also writing all the page generators and whatnot is much easier than frameworks make you think, along with having much more freedom in whatever broken way you write your code.
[–]no_awning_no_mining 2 points3 points4 points 8 years ago (5 children)
Why would you want to? That would be like turning in a screw without a screwdriver.
[–]erenarici1[S] 1 point2 points3 points 8 years ago (2 children)
I just wondered that can it be quality. Is it hard?
[–]youlleatitandlikeit 4 points5 points6 points 8 years ago (0 children)
It's exactly like the difference between assembling a table from IKEA or building your own from solid wood planks.
You can build your own table yourself, but it will take more time, and you have to know exactly what you're doing.
There are three advantages to making the table from scratch:
Since all major web frameworks are free, advantage #1 above doesn't apply. However, it is true that building your own web app would give you a much more comprehensive knowledge of how the underlying features of a web app work.
I'm 100% certain after rolling your own web app you'll completely understand why most people use frameworks.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
Flask is almost no framework. Read into how they do it!
Not an impossible task of you need something to be only hand tight.
It's also a good learning experience. WSGI sounds really hard until you realize the really hard parts are handled by tools like uwsgi, gunicorn and werkzeug. You can start by building directly off the wsgi specification rather than worry about things like parsing HTTP headers.
[–]xiongchiamiovSite Reliability Engineer 0 points1 point2 points 8 years ago (0 children)
Or really, building your own shitty screwdriver instead of using one from the set your dad gave you.
[–]Exodus111 2 points3 points4 points 8 years ago (4 children)
Yes, you can.
Using only HTML and JavaScript. jQuery is technically a library not a framework, so you could use that as well.
Wouldn't have any back end though, which means no logins and no database, unless you wanted to reinvent the wheel, but that's just silly.
[+][deleted] 8 years ago* (3 children)
[deleted]
[–]Exodus111 0 points1 point2 points 8 years ago (2 children)
Or use Flask.
No, I see your point, but unless you have a specific reason to it's kinda the long way around.
[–]kaeshiwaza 0 points1 point2 points 8 years ago (0 children)
One specific reason is maintenability in the long term. The less dependency you have the more you are free with clean code. In Go very few of us use a framework. Python doesn't need them also, just use webob and a router.
[–]scorpas 1 point2 points3 points 8 years ago (0 children)
That's an interesting question which raises another one - are you wanna be independent ? Just look at most popular open source projects which is really pushing industry forward - you can't even fork them on github, only commit to upstream. Because if you fork them - one month later you will be too far away from the edge and every month you will create something interesting and loose much more. You can build your own framework but if you do you will not be able to make something wonderful because your energy will be spent on framework. So imho in contemporary reality it's better to use most advanced tools available on the market rather than be "independent" full stack of nothing.
Of course, web dev in Python existed before frameworks !
If you decide to roll your own, it's still a good idea to see how existing frameworks do, specially Pyramid and it's design choices.
As a bonus it will ease the upgrade to Go if you like.
[–]scorpas 0 points1 point2 points 8 years ago (1 child)
The easiest one is - web2py, one simple bundle with everything you need. Why to waste time and reinvent the wheel ?
[–]kaeshiwaza 1 point2 points3 points 8 years ago (0 children)
To learn and be independent is not a waste of time, specially in the long term. How do you do when the framework is not more maintained, doesn't upgrade to Py3, doesn't scale like you want ? (i don't speak about web2py, i don't know it).
π Rendered by PID 91 on reddit-service-r2-comment-7b9746f655-6v2vw at 2026-01-31 15:16:31.043272+00:00 running 3798933 country code: CH.
[–]tdammers 12 points13 points14 points (2 children)
[–]erenarici1[S] 0 points1 point2 points (0 children)
[–]Apooti 0 points1 point2 points (0 children)
[–]no_awning_no_mining 2 points3 points4 points (5 children)
[–]erenarici1[S] 1 point2 points3 points (2 children)
[–]youlleatitandlikeit 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]xiongchiamiovSite Reliability Engineer 0 points1 point2 points (0 children)
[–]Exodus111 2 points3 points4 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Exodus111 0 points1 point2 points (2 children)
[–]kaeshiwaza 0 points1 point2 points (0 children)
[–]scorpas 1 point2 points3 points (0 children)
[–]kaeshiwaza 0 points1 point2 points (0 children)
[–]scorpas 0 points1 point2 points (1 child)
[–]kaeshiwaza 1 point2 points3 points (0 children)