User:Mjzffr: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Resources: add instructions about logging)
Line 5: Line 5:


== Resources ==
== Resources ==
I'm gradually collect links and wisdom that may be useful to future One and Done contributors. The plan is to eventually move this to a Developer Resources page in the One and Done section of the wiki.
I'm gradually collecting links and wisdom that may be useful to future One and Done contributors. The plan is to eventually move this to a Developer Resources page in the One and Done section of the wiki.


* [https://docs.djangoproject.com/en/dev/howto/initial-data/ Providing initial model data]: good to know if your local project database is empty.
* [https://docs.djangoproject.com/en/dev/howto/initial-data/ Providing initial model data]: good to know if your local project database is empty.

Revision as of 17:44, 18 September 2014

About

Please see my Mozillians profile. My contributions to Mozilla began in March 2014, thanks to the GNOME Outreach Program for Women.

  • Status for Summer 2014: Python/Django development for the One and Done initiative.

Resources

I'm gradually collecting links and wisdom that may be useful to future One and Done contributors. The plan is to eventually move this to a Developer Resources page in the One and Done section of the wiki.

Set up logging

In `oneanddone\settings\local.py` uncomment the assignment to `LOGGING` and add `import logging` above it, like so:

   import logging
   LOGGING = dict(loggers=dict(playdoh={'level': logging.DEBUG}))

This defines a logger called 'playdoh'.

As a result, your own debug messages will be displayed among the other messages shown when `python manage.py runserver` is running. Example:

   # views.py
   import logging
   log = logging.getLogger('playdoh')
   def myview(request):
       # ...
       # print to the console
       log.debug('%s got here' % request.user)