"MySQL is the PHP of databases". Strange, I just had this sentence popping in my head yesterday. I'm seriously considering writing a list of its wrong doings. Great article overall.
I only know PHP. How do I write a Web application in Python?
51–60 of 196 posts
Re: I only know PHP. How do I write a Web application in Python?
#52I'd say the necessity of this post is why PHP is as popular as it is. With PHP, there are no package managers I have to install; there is no template language to learn; there is often no version control; there is no "framework"; etc. You just drop in a .php file and, most likely, it will just run. If I need a quick dynamic page on my server, it's much easier to do this in PHP than in Python or Ruby. Until Python or R…
#!/usr/bin/python
print "Content-type: text/plain"
print ""
print "Hello World!"
So 3 lines of "boilerplate", and then you can do anything you want. No extra packages to install or languages to learn. No frameworks necessary.edit: just as an example of minimal hello world in WSGI:
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
yield 'Hello World!'
also doesn't need any extra python packages or frameworks. but configuring web server to handle wsgi is bit more involved than cgi.Re: I only know PHP. How do I write a Web application in Python?
#53Re: I only know PHP. How do I write a Web application in Python?
#54Earlier quoted context omitted.
So, you are telling me that it is a good thing, a normal behavior for a reliable tool to just ignore instructions I send to it and do nothing with it, not even a warning? So when I migrate a database, I have to carefully check each and every instructions (schema and data) and make sure MySQL did not "decide" it was not worth it and just silently threw it by the window? I have hard time to believe you are serious here…
I'm pretty certain when you migrate from a different database you're supposed to check your schema and data anyway, or do you just "decide" it should work without question? I'm not saying this MySQL behavior is acceptable, I'm just saying that you should be aware of the limitations and quirks of the tools you work with.
Re: I only know PHP. How do I write a Web application in Python?
#55I like java for web app development, simply because it has a well-structured api and a massive community of developers who have run in to the majority of the road blocks you will most likely encounter on the way to launching your app.
What frameworks and platforms would you recommend for web development with java? I am writing my senior project at college in java (mainly because of the wide amount of image processing libraries available) and would love to add web capabilities.
Re: I only know PHP. How do I write a Web application in Python?
#56I've just spent 6 months entirely removing session state from an asp.net app and the performance gain is amazing.
Re: I only know PHP. How do I write a Web application in Python?
#57I've seen Flask mentioned here few times. Is Flask better than Bottle?
Re: I only know PHP. How do I write a Web application in Python?
#58I would love to switch to Python from PHP but I can't. The reason is I keep getting told to learn Python 2. Python 3 has been out for ages! Basically I am concerned that I will learn something and create app's which within a year will be out of date. I am confused why Python developers are advocating that newbies learn an old and presumably soon to be legacy version of the language. I remember when this kinda happene…
Re: I only know PHP. How do I write a Web application in Python?
#59I have no idea why web2py gotten such a bad rep. I am a beginning webdeveloper and seriously: web2py is a pleasure to work with. Simple to start, deploy, port and hack. It's backwards compatible and has a template language that really is non existant as so far as its pure python. Compare that to Rails - which is (comparable) hell to set-up and breaks with upgrades etc. If you want python web development to be simple,…
What did he remove?
https://www.quora.com/Is-web2py-a-good-Python-web-framework/...
This isn't the first instance of Django/Flask people not agreeing with web2py design and implementation, and they have been vocal about it a couple of times.
http://www.reddit.com/r/Python/comments/ex54j/seeking_clarif...
Look for comments by mitsuhiko(flask dev) and jacobian(django dev).
Re: I only know PHP. How do I write a Web application in Python?
#60I'd say the necessity of this post is why PHP is as popular as it is. With PHP, there are no package managers I have to install; there is no template language to learn; there is often no version control; there is no "framework"; etc. You just drop in a .php file and, most likely, it will just run. If I need a quick dynamic page on my server, it's much easier to do this in PHP than in Python or Ruby. Until Python or R…
Most of the post _isn't_ strictly necessary. You don't need a database to get your feet wet. You don't need to care about XSS for your first throwaway app (though, arguably, you should). I pimp Mako precisely because there's no separate language to learn: the core syntax is just Python. I tried to describe the _ecosystem_, and I assume any serious PHP application will care about most of the same things. Here's all yo…
Also the argument of python/ruby requiring lots of configuration while php would not is just plain bullshit. Making PHP run with Apache (esp. on a windows machine) without stuff like EasyPHP (and this is where you stop comparing apples to oragnes) is by and large tough on the beginner.