Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am looking into learning Python for web development.

Assuming I already have some basic web development experience with Java (JSP/Servlets), I'm already familiar with web design (HTML, CSS, JS), basic programming concepts and that I am completely new to Python, how do I go about learning Python in a structured manner that will eventually lead me to web development with Python and Django?

I'm not in a hurry to make web applications in Python so I really want to learn it thoroughly so as not to leave any gaps in my knowledge of the technologies involving web development in Python. Are there any books, resource or techniques to help me in my endeavor? In what order should I do/read them?

UPDATE:

When I say learning in a structured manner, I mean starting out from the basics then learning the advanced stuff without leaving some of the important details/features that Python has to offer. I want to know how to apply the things that I already know in programming to Python.

share|improve this question

closed as not constructive by gnat, Glenn Nelson, Walter, GlenH7, Ryathal Dec 18 '12 at 15:44

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

6  
+1 for not in a hurry. This is the best way to learn a language, try things out but do not dive into a production project to learn a language. –  Chris Oct 19 '10 at 15:12

7 Answers 7

up vote 40 down vote accepted

First learn Python well

Here are some online resources for learning Python

  1. The Python Tutorial
  2. Wiki-Book
  3. Byte of Python
  4. Building Skills in Python Version 2.5
  5. Python Free Online Ebooks
  6. Python Bibliotheca
  7. Think Python
  8. Data Structures and Algorithms in Python
  9. How to Think Like a Computer Scientist: Learning with Python
  10. Python for Fun
  11. Invent Your Own Computer Games With Python
  12. Learn Python The Hard Way
  13. Thinking in Python
  14. Snake Wrangling For Kids

For Django you can refer

What I suggest is

  1. The Python Tutorial
  2. Wiki-Book
  3. The Django Book

Also check out this video

share|improve this answer
6  
Great list! I've heard Dive Into Python is great for experienced programmers to start out on Python. –  Terence Ponce Oct 15 '10 at 12:27
    
Working through Dive into Python currently, it's fast paced and a fantastic resource for existing programmers who want to learn the language! I suggest working chp 2 & 3 to see how it goes, that will orient you very well with the syntax and data types :) –  invert Oct 15 '10 at 14:16
    
@Terence: I can agree considering this is exactly what I just did. Came from a CSE undergrad using java, c, php (at work) and various other languages, this book brought me right up to speed. –  Chris Dec 3 '10 at 18:57
    
+1) for TheDjangoBook and the video. Python Web Programming could also be a good choice. –  ravz Mar 27 '13 at 8:25

If Web development in python is what you are looking for, then after a thorough understanding of python , I suggest that you have a look at Flask. Django and other full stack frameworks would definitely make your life much much easier but overall would leave you with an incomplete feeling as if you have not learnt much. Flask IMHO , is the most awesome framework in python as of now, but yes that is just my opinion.

share|improve this answer

Don't take this too seriously, but ...

  • create file name app.py with the following content:

    from flask import Flask
    app = Flask(__name__)
    
    @app.route("/")
    def hello():
        return "Hello World!"
    
    if __name__ == "__main__":
        app.run()
    
  • assuming you have pip (python package installer) installed do the following:

    $ pip install Flask
    $ python app.py
    * Running on http://localhost:5000/
    
  • Now you can visit your first web app under localhost, port 5000.

That would be your first python web application. Everything after that is "refinement" in application structure, functionality and appearance.

share|improve this answer

I also would like to recommend the Python Koans for learning: http://github.com/gregmalcolm/python_koans

They are pretty similar to the Ruby Koans (a lot of it was directly ported) and are pretty cool.

share|improve this answer
1  
would you mind explaining more on what it does and why do you recommend it as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Sep 16 '13 at 9:04

http://learnpythonthehardway.org

Is a free online book that contains a series of 52 lessons in python.

By starting on lesson 1 and working through to lesson 52 you should learn enough to consider yourself a competent programmer in the python language.

Each lesson has code examples that you should take the time to type in and RUN then ALTER to see how that changes the results.

It is that process by which most people that I know generally learn programming.

share|improve this answer
1  
would you mind explaining about this in more detail - how and why does it answer the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Apr 1 '13 at 13:54
1  
hopefully the above meets your needs. thanks for the feedback. –  Alex C Apr 2 '13 at 13:41
    
You should definitely not copy-paste the exercices because it will not help you learn at all. From the first chapter of the book : You must type each of these exercises in, manually. If you copy and paste, you might as well just not even do them. The point of these exercises is to train your hands, your brain, and your mind in how to read, write, and see code. If you copy-paste, you are cheating yourself out of the effectiveness of the lessons. –  marco-fiset Apr 2 '13 at 14:13
1  
Thanks Marco. I have also adjusted the answer to reflect that point. –  Alex C Apr 2 '13 at 14:21

You first learn python programming language. Then when you feel comfortable with it, learn libraries like Django. Setting up an using an application at Google App Engine would further help in development.

share|improve this answer

Web development always comes back to one thing: and that is the browser. Learn HTML, CSS and JavaScript very well, and it will serve you though any language change.

Www.w3schools.com is a great place to learn these things, but when it comes to CSS, its often very useful to just sit down and play with it. Find a cool web design and implement it in HTML by hand. This is a very, very neccecary skill if any of your server side code results in HTML.

Next, I like your logical approach, but it might not be the best way to go about it. A more rewarding approach may be to establish a goal that you want to accomplish, and learn on the way.

Starting with django may not be the best idea, however. Many of the decisions that they made when designing the framework would only make sense if you'd experienced the problems that they solve first hand. My first web language was php, and the most effective way I understood best practices was to write crappy, brittle code, realizing that there was a problem, and resarching solutions. If I was to research a solution before I understood the problem, I wasn't able to apply it effectivly.

If you're willing to take your time on this, perhaps starting with a less abstract technology set such as php may be a great learning experience.

share|improve this answer
2  
I think you missed what I said about me already having experience in web development and being familiar with the basic programming concepts. I already knew HTML, CSS and Javascript before moving on to JSP/Servlets. About the approach (that I wanted) to learning Python, I just want to know how to apply what I already know in programming without missing out on some of the details/features that Python has to offer. –  Terence Ponce Oct 15 '10 at 9:15
    
Perhaps you should clarify your post, as you say that you have basic web development experience.... CSS, HTML and JavaScript can be very complex and powerful. I was simply trying to put an emphasis on how important they are to invest in for any web development. –  nlaq Oct 15 '10 at 9:20
    
Okay. Sorry about that. I'll update my question now. –  Terence Ponce Oct 15 '10 at 9:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.