Use of web frameworks

What is the current thinking on the use of web frameworks for back-end and front-end parts of a game?

I found this thread (https://pyweek.org/d/4062/) which is from 2011 and people seemed to agree it was OK then but I wanted to check some of the boundaries here and whether the thinking has changed.

My specific questions,

1. Is it still OK to use frameworks for the back-end and to host these yourself so that people do not have to get the back-end working on their machines to test the game. This also might be needed to allow the back-end to be shared (for leaderboards, collaborative games etc). Of course the code should be shared.

2. Is it OK for the front end of the core game to be HTML + JS based? I'm thinking here of a Django based solution. The HTML would be generated by the Django templating system but there would be JS logic in there and JS frameworks (like JQuery, Bootstrap, etc).

Unfortunately I can't compete in the February Pyweek because of other time commitments so this is more for future reference!

Paul

(log in to comment)

Comments

(replying to myself to share my own views!)

It seems that #1 should be OK. It is still all Python generated during the competition and as long as the code is shared, saving people from setting up a big web stack just for testing seems reasonable.

#2 seems more problematic. Although the templating is python-like (at least for Django), a lot of the core logic might end up in Javascript.

Paul
I would be fine with some JavaScript code, say up to 50%. But that's just me.
I'd imagine using one of the following would be more acceptable than writing half of your program in something other than python:
  • pypyjs (pypy ported to JS via emscripten)
  • Brython (a browser-based python implementation)
  • batavia (a python VM that runs python 3.4 bytecode in javascript)
    • I've been considering these for the next pyweek. pypyjs and Brython are more mature, but batavia is maturing fast and has a much smaller overhead. The overhead for downloading pypy.js is several megabytes, Brython is smaller but still 2 MB or so last I checked.
I can't believe I forgot to mention transcrypt. transcrypt is a python3.5 -> Javascript compiler that generates readable javascript code. It's probably the most production-ready option out there for writing browser scripts in python.
Write the game in JavaScript. Then generate at least as much, but preferably way more Python code somehow. (Does not have to work.) Now your game is mostly Python and perfectly legal! Trust me on this :).