With this tutorial I will attempt to show you how a game server for a turn-based game of tic-tac-toe can be set up through a python web framework - Web2py and we'll also use cross-domain ajax calls.
You can check out the game on http://zerostatesociety.com
a domain I'm playing with on a shared host.
Open up 2 tabs and have a dual with yourself.
The game was exported as a HTML5 game in C2 and all the files and folder were just uploaded to the httpdocs directory in the shared host.
The AJAX requests travel to http://anavrin.pythonanywhere.com
That's where all the logic is handled and the database is kept.
However, no hosting service is necessary to run my example. You'll be able to do it all on your own PC, even without internet.
SO, LETS BEGIN
What you'll need
Download the web framework, which can be found on http://www.web2py.com
The game was made with a personal license Construct 2, so I'm not sure if a free version will have all the functionality.
The assets used are also from the personal license bundle, so Scirra defined rights apply to their usage.
A PC with Windows.