Skip to content

Instantly share code, notes, and snippets.

@rafen
Last active August 29, 2015 13:58
Show Gist options
  • Save rafen/10027222 to your computer and use it in GitHub Desktop.
Save rafen/10027222 to your computer and use it in GitHub Desktop.
MMDBClient error debug for register_app
# Settings for local.py
#
# MMDB_API_HOST = 'http://mc.dev.nationalgeographic.com:8000'
#
# Load test database in your db. Use production db for this test if possible
# $ python manage.py loaddata mmdb/apps/users/fixtures/test_user.json
from mmdbcommons.client import MMDBClient, mmdb_client
from mmdbcommons.exceptions import AppAlreadyRegisteredError
# Create the client
client = MMDBClient(api_key='MMDB_DEBUG_KEY', api_user='memcen_debug')
try:
client.register_app(9617855, 'YourShot')
except (AppAlreadyRegisteredError, ):
print 'Ignored!'
@rafen
Copy link
Author

rafen commented Apr 8, 2014

If you need option 1) see the this snippet as an example of how to do it:

https://gist.github.com/rafen/10145434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment