Installation


Install needed libraries

Before using mamo you'll need to install some dependencies:
http://sourceforge.net/projects/marimorepy/

Install mobiledjango

Installing mamo is simple; It utilizes python's setup.py script, a standard way to distribute python packages. Installation procedures are the same as for marimorepy

$ tar zxf mobiledjango-x.x.x.tar.gz
$ cd mobiledjango
$ sudo python setup.py install

Setup django

Next, you need to tell django to use mogo. There are 2 parts to this:
  1. Add the required middleware
  2. Insert the required settings variables in settings.py

Setting up middleware

The middleware in your settings.py should look something like this, in this order:

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'mamopublic.mogo.jp.d.mware.mobile.MobileIdentify',
    'mamopublic.mogo.jp.d.mware.mobile.MobilePreSession',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'mamopublic.mogo.jp.d.mware.mobile.MobileSession',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

The mamopublic.mogo.jp.d.mware packages are mogo's packages that handles jp mobiles. If we have packages for mobiles in a different locale, it'll be something like mamopublic.mogo.au.d.mware.

Make sure MobileIdentify, MobilePreSession, SessionMiddleware and MobileSession are in the order above

Insert required variables

These are the variables you need to define in your settings.py file

  
 MOGO_JP_MOBILE_VERIFY_OPTS ( "IP", "UA", ) Mobile verification schemes. IP means verify by IP while UA by User-Agent. Specifying IP and UA equals to 'AND' and not 'OR'
 DEFAULT_CHARSET shift_jis The default charset for output to the client. shift_jis is supported by a majority of jp mobile, but utf-8 is starting to become more popular.
 MOGO_JP_DOCOMO_NULLGW_VAR uid The variable name that you want to use for NULLGWDOCOMO if your site is considered as a 公式サイト

settings.SESSION_COOKIE_NAME is optional, if you want to customize how the session cookies are called. By default, it's set to sessionid. Since you need to set this name in the URL for each HTTP call to emulate sessions, I suggest you set it to a shorter name, i.e sid

  Sign in   Recent Site Activity   Terms   Report Abuse   Print page  |  Powered by Google Sites