Source

django-socketio-on-dotcloud / README.rst

Django on DotCloud

This code shows how to run a very simple Django application on DotCloud. It is fully functional, in the sense that you don't have any hand-editing to do to deploy it: it automatically deploys a PostgreSQL database, includes it in settings.py, creates a superuser for you, and uses Django 1.3 collectstatic. Batteries Included!

To run this code on DotCloud, you need a DotCloud account (free tier available). Then clone this repository, and push it to DotCloud:

$ git clone git://github.com/dotcloud/django-on-dotcloud.git
$ cd django
$ dotcloud push hellodjango

Happy hacking! Remember: each time you modify something, you need to git add + git commit your changes before doing dotcloud push.

This repository is also a step-by-step tutorial: each commit corresponds to one step, with the commit message providing explanations.

You can view the whole tutorial, and the modified files at each step, with at least three different methods:

  • by using GitHub's awesome compare view: you will see the list of commits involved in the tutorial, and by clicking on each individual commit, you will see the file modifications for this step;
  • by running git log --patch --reverse begin..end in your local repository, for a text-mode equivalent (with the added benefit of being available offline!);
  • by browsing a more traditional version on DotCloud's documentation website.

You can also learn more by diving into DotCloud documentations, especially the one for the Python service which is used by this app.

Notes:

python manage.py runserver_socketio --settings=settings.local http://localhost:9000/chat

gunicorn wsgi:application -c gunicorn.config --settings=/Users/jcosta/projects/django-on-dotcloud/hellodjango/settings/local.py

gunicorn wsgi_ws:application --settings=/Users/jcosta/projects/django-on-dotcloud/hellodjango/settingsocal.py --error-log='/tmp/gunicorn.log' --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker --bind="127.0.0.1:5000" gunicorn wsgi:application --settings=/Users/jcosta/projects/django-on-dotcloud/hellodjango/settings/local.py --error-log='/tmp/gunicorn.log' --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker --bind='127.0.0.1:8000'

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.