user1629766
user1629766

Reputation: 157

Python Web Programming - Not Using Django

I want to learn Python for Web Programming. As of now I work on PHP and want to try Python and its object oriented features. I have basic knowledge of python and its syntax and data strucures.

I want to start with making basic web pages - forms, file upload and then move on to more dynamic websites using MYSQl.

As of now I do not want to try Django or for that matter any other frameworks. Is python with cgi and MySQLdb modules a good start?

Thanks

Upvotes: 0

Views: 360

Answers (6)

Brandon Poole
Brandon Poole

Reputation: 372

I recommend Pyramid Framework!

Upvotes: 2

reptilicus
reptilicus

Reputation: 10397

Having used both Flask and Django for a bit now, I must say that I much prefer Flask for most things. I would recommend giving it a try. Flask-Uploads and WTForms are two nice extensions for the Flask framework that make it easy to do the things you mentioned. Lots of other extensions available.

If you go on to work with dynamic site attached to a database, Flask + SQL Alchemy make a very powerful combination. I much prefer the SQLAlchemy ORM to the django model ORM.

Upvotes: 1

zenpoy
zenpoy

Reputation: 20126

I would really recommend that you try Flask. It doesn't require much overhead such as Pyramids and Django, and it will give you the opportunity to play (not that it's a toy).

from their docs: install Flask:

>> pip install Flask

then run a simple web-app :)

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Upvotes: 0

John Wang
John Wang

Reputation: 4692

Depend on the level of your understanding on web programming, and for learning purpose, you can start from very basic such as the module SimpleHTTPServer, or a bit more practically, a micro framework such as Paste, or Bottle. Then you head for a full-stack framework like Django.

Upvotes: 0

kristaps
kristaps

Reputation: 1723

If nothing else it will show you why you want to use a framework, should be a really valuable learning experience. I say go for it.

Upvotes: 0

Samy Arous
Samy Arous

Reputation: 6814

I would recommend using some WSGI (WebServer Gateway interface) lightweight frameworks. WSGI is the commonly recognized web interface on python and will let you manage basic HTTP request (GET, POST, HEAD ...), Django is also WSGI based.

http://wsgi.readthedocs.org/en/latest/frameworks.html

You can also write a basic WSGI app if you don't want to use any framework. It's very easy and you can easily test it / deploy it using Paste Deploy or Apache + mod_wsgi.

http://pythonpaste.org/deploy/

Upvotes: 1

Related Questions