Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'parameters': 0.04; 'anyway.': 0.05; 'insert': 0.05; 'modify': 0.07; 'rest,': 0.07; 'think,': 0.07; 'tries': 0.07; '22,': 0.09; 'bits': 0.09; 'buttons': 0.09; 'covered.': 0.09; 'django,': 0.09; 'executable': 0.09; 'falls': 0.09; 'framework.': 0.09; 'frameworks,': 0.09; 'http': 0.09; 'mvc': 0.09; 'part,': 0.09; 'postgresql,': 0.09; 'protocols,': 0.09; 'rewrite': 0.09; 'scripting': 0.09; 'thats': 0.09; 'url:github': 0.09; 'used.': 0.09; 'works.': 0.09; 'worse': 0.09; 'wrong,': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'django': 0.11; 'itself.': 0.14; 'changes': 0.15; 'windows': 0.15; '"web': 0.16; '(and,': 0.16; '(either': 0.16; 'already,': 0.16; 'beautifully': 0.16; 'block.': 0.16; 'did.': 0.16; 'dig': 0.16; 'does,': 0.16; 'fiddle': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'goes?': 0.16; 'ideal.': 0.16; 'ignoring': 0.16; 'interactive,': 0.16; 'it;': 0.16; 'itself,': 0.16; 'json,': 0.16; 'python-based': 0.16; 'responses.': 0.16; 'retry': 0.16; 'scripting.': 0.16; 'stuff,': 0.16; 'subject:program': 0.16; 'subject:user': 0.16; 'worst': 0.16; 'all.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'bit': 0.19; 'finished': 0.19; 'pieces': 0.19; 'replacing': 0.19; 'server,': 0.19; 'examples': 0.20; 'later': 0.20; 'meant': 0.20; 'fit': 0.20; 'written': 0.21; '(in': 0.22; 'coding': 0.22; 'saying': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'adds': 0.24; 'features,': 0.24; 'frameworks': 0.24; 'sends': 0.24; 'simpler': 0.24; 'text,': 0.24; 'fairly': 0.24; 'server.': 0.24; '(or': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'first,': 0.26; 'long,': 0.26; 'possibly': 0.26; 'second': 0.26; 'least': 0.26; 'subject:/': 0.26; 'primary': 0.26; 'supported': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'testing': 0.29; '(this': 0.29; 'ideal': 0.29; 'respective': 0.29; "doesn't": 0.30; '(like': 0.30; 'bigger': 0.30; 'database,': 0.30; 'especially': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'work.': 0.31; 'code': 0.31; '500': 0.70; 'jul': 0.74; 'unusual': 0.74; 'day': 0.76; 'power': 0.76; 'lack': 0.78; 'all;': 0.84; 'basics.': 0.84; 'browsers,': 0.84; 'client-side': 0.84; 'complex,': 0.84; 'complexity': 0.84; 'etc,': 0.84; 'exercise.': 0.84; 'fortunately,': 0.84; 'hardly': 0.84; 'lifting': 0.84; 'lightweight': 0.84; 'messed': 0.84; 'monte': 0.84; 'much,': 0.84; 'musical': 0.84; 'protocol,': 0.84; 'strings)': 0.84; 'subject:Network': 0.84; 'virus: References: <87a982wtoq.fsf@nautilus.nautilus> <871ttewmyc.fsf@nautilus.nautilus> <87ppgx29aj.fsf@nautilus.nautilus> Date: Tue, 22 Jul 2014 19:18:42 +1000 Subject: Re: Network/multi-user program From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 142 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406020731 news.xs4all.nl 2937 [2001:888:2000:d::a6]:60334 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74988 On Tue, Jul 22, 2014 at 5:54 PM, Monte Milanuk wrote: > Well... thats part of where my lack of experience with js or complex > projects using anything other than just python is going to show: > initially I thought javascript was just for buttons/effects in the > client browser as thats all the trivial examples I looked at years ago > did. The bits n pieces I'm seeing of these 'modern' javascript MVC > frameworks like sencha, angular, etc. is making me think that a lot of > the 'work' is moving from the server to the client via the javascript... > which just blurs the heck out of things and confuses me as to what > should be in the browser and what should be on the 'server'? And where > the testing goes? If more of the 'heavy lifting' is being done on the > client, is there a need for a full-service python framework like django > or would something lightweight like flask be more appropriate? Again, I > know almost nothing about pyramid and where it falls into the mix. I > can read the propaganda on their respective web sites, but that is > necessarily skewed. :/ Lots of things getting messed in together here, so I'm going to start right back at some basics. You probably know some of what I'm going to say already, but I'm not sure exactly how much, so I'll just say it anyway. Hopefully this won't be TOO long. :) Communication between the server and the client is over HTTP. (Usually. I'm ignoring SPDY and other protocols, and I'm also ignoring the distinction with HTTPS, which just adds an encryption layer and doesn't affect any of this.) HTTP is a stateless protocol, where the client sends a request to the server and the server sends back a response. Simple, and works really beautifully for the simple case where you just want a page. If you go to http://rosuav.com/hymns/LetHerGo2.png in your browser, it sends a request "GET /hymns/LetHerGo2.png" to my server, and my server responds with "\x89PNG" and about 100KB of PNG-encoded data, which your browser then displays as an image. So far, so good. For something more interactive, though, HTTP isn't really ideal. The server can send back a frames-based page (either with or with