jarv / wordconfuse

Django 1.3 / JQuery word quiz app
http://jarv.org
17 stars 4 forks source link

Wordconfusion A tutorial project for DJango 1.3 and JQuery

This is a Django app that can be cloned into a Django 1.3 project.

To start from scratch:

1) Make sure Django 1.3 is installed 2) django-admin.py startproject 3) cd 4) git clone git@github.com:jarv/wordconfuse.git

After you make your local changes to settings.py and urls.py (see below) do the following to launch the local webserver:

$ python manage.py syncdb $ python manage.py collectstatic $ python manage.py runserver

Syncdb will take awhile to run since it is creating a large table with all the words for the game.

For more info see the detailed tutorial @ http://jarv.org

Django Setup notes

Database:

You will need to let Django know about your database,
if you are running a local instance the simplest thing
to do is use sqlite.

Staticfiles:

You will need to let Django know where you want to put
static files.  Make sure STATIC_ROOT and STATIC_URL are
set in settings.py

URLs:

Here is the setup for URL patterns:

from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView

...

urlpatterns += patterns('wordconfuse.views',
    (r'^$', TemplateView.as_view(template_name="index.html")),
    url(r'^get_words$', 'get_words', name='get_words'),
    url(r'^gameover$', 'gameover', name='gameover'),
    url(r'^new_hs$', 'new_hs', name='new_hs'),
    url(r'^hs$', 'hs', name='hs'),
    )
urlpatterns += staticfiles_urlpatterns()