Skip to content

Instantly share code, notes, and snippets.

@selenamarie
Last active August 29, 2015 14:09
Show Gist options
  • Save selenamarie/ad413cc50c453e2a5925 to your computer and use it in GitHub Desktop.
Save selenamarie/ad413cc50c453e2a5925 to your computer and use it in GitHub Desktop.
infecting django with configman notes
* how would you write a pure restful service in django from scratch?
https://gist.github.com/peterbe/4337d96d0afd53505cbb
from django import http
def meaningoflife(request):
return http.HttpResponse(json.dump({'number': 42}}, mimetype="application/json")
* where in config/setup do you put this information
conjecture: add it to crashstats/settings/local.py
* stuff of interest in api/views.py:
https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/api/views.py#L187
https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/api/views.py#L228
https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/api/views.py#L240
* how do you envision using the classes in crashstats/models.py?
options:
* explicitly declare each in this file
* use configman to implement each
https://github.com/mozilla/socorro/blob/master/webapp-django/crashstats/crashstats/views.py#L260-L267
** ensure we have class attributes for the definition of the types of parameters
https://github.com/mozilla/socorro/blob/master/socorro/external/postgresql/gccrashes.py#L23-L30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment