Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJamshaid Ali
189 PointsCould i build my own webpages and applications with just the basics of python?
Just some information about python
1 Answer
Peter Vann
36,427 PointsThis essentially more of a philosophical question than a coding question. And if I am understanding your question correctly, what you are really asking is can a website be coded in Python without using a framework? And the answer is 'yes', theoretically, using vanilla python, but the real question is whether or not it is a recommended approach.
One comment on Stack Overflow was this (regarding making a webpage in Python without a framework):
The answer is "don't". Using a framework makes your code more
maintainable, scalable, readable, testable, and modular.
And an answer on Quora was:
Yes, quite easily.
You could use a web server like Apache, and use Python for your
CGI scripts, quite an old fashioned way to do it these days,
but it still works fine, quite easy too.
If you don’t want to use a web server, you could write your
own in Python, it’s not as hard as it sounds, open up a socket
on port 80 and start listening… I wouldn’t recommend this though,
if you don’t know what you are doing,
you’re going to have security holes up the wazoo…
I'm led to believe that this is a recommended framework to get started with, though, because (another Stack Overflow quote), "You should try web.py, it provides a bare minimum of features that does not get in your way.":
Also, have you explored Flask or Django?
For more info, just Google "Python website without a framework".
I hope that helps. Happy coding.
Peter Vann
36,427 PointsPeter Vann
36,427 PointsMore info:
https://www.reddit.com/r/learnpython/comments/6j8hvv/python_web_development_from_scratch_without_a/
Django:
https://www.youtube.com/watch?v=Ky59C5geOtg
https://www.youtube.com/watch?v=Wm8Eq0HIISA