Django JQuery Mobile Setup
This document describes how to create a new Django project for use with the django-jqm quick-start templates. If you have an existing Django project, the steps can be simplified to:
- install django-jqm (and optionally django-html5 if you want to use HTML5 native widgets)
- add “jqm” to your installed applications
- add the standard auth, static and request template context handlers
You can then continue to Basic View (with Login/Logout).
Host Setup
Project setup (for an Ubuntu Server or Debian Host), obviously you’ll need to be root to do this:
VirtualEnv Setup
Set up a virtualenv with django-html5, django-jqm, and, of course, django:
Django Project Configuration¶
At this point you should have a virtualenv with Django installed, so let’s create a very basic project:
We’ll now edit the auto-started project’s settings.py to:
- add jqm to the installed apps set (so that its templates will be available)
- provide a basic database configuration
- enable common context processors for templates
- provide a default “on login” landing page (for now, ‘/’)
Basic database configuration:
A directory for our project-level templates:
Common context processors (note, only auth, static and request are actually required by django-jqm):
Add the following to INSTALLED_APPS:
Finally, provide a default landing-page URL for post-login views:
You should now be able to continue to Basic View (with Login/Logout).
No comments:
Post a Comment