Repository: learningequality/kolibri

Issue:
`generateuserdata` bails with unicode encoding error
<!--
Instructions:
 * Fill out the sections below, replace …'s with information about your issue
 * Use the 'preview' function above this text box to verify formatting before submitting
-->

### Observed behavior
<!--
Description of the behavior that was observed, including screenshots or other references when applicable
-->

```
C:\Users\meeti>kolibri manage generateuserdata
WARNING:root:No C Extensions available for this platform.

[37mINFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.base[0m
INFO:kolibri.core.apps:Running Kolibri with the following settings: kolibri.deployment.default.settings.base
Generating 2 classroom object(s) for facility: Escuela de Demostración
Generating 20 user object(s) for class: Classroom 1A in facility: Escuela de Demostración
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Canal UNETE
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: CK-12
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Sikana EN
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Osmosis.org
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Open Stax
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Firki
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Blockly Games
Generating 79 user interaction(s) for user: "R Poulsen Otto"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Canal UNETE
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: CK-12
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Sikana EN
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Osmosis.org
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Open Stax
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Firki
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Blockly Games
Generating 77 user interaction(s) for user: "B"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Canal UNETE
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: CK-12
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Sikana EN
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Osmosis.org
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Open Stax
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Firki
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Blockly Games
Generating 49 user interaction(s) for user: "Barela A Lelia"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Canal UNETE
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: CK-12
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Sikana EN
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Osmosis.org
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Open Stax
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Firki
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Blockly Games
Generating 78 user interaction(s) for user: "Chimotofu"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Canal UNETE
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: CK-12
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Sikana EN
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Osmosis.org
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Open Stax
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Firki
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Blockly Games
Generating 73 user interaction(s) for user: "R Kellman Sánta"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Canal UNETE
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: CK-12
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Sikana EN
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Osmosis.org
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Open Stax
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Firki
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Blockly Games
Generating 42 user interaction(s) for user: "Karat D'Reli K"@"Escuela de Demostración" for channel: Khan Academy (en)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Khan Academy (es)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: EngageNY (es)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: PhET Interactive Simulations
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Kolibri Demo 1
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: MIT Blossoms
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Aflatoun Academy (EN)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: TESSA - Teacher Resources
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Touchable Earth (en)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Canal UNETE
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: CK-12
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Sikana EN
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Osmosis.org
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Open Stax
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: PBS Learning Media
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Firki
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Tahrir Academy
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Kakuma - Content UX Master Channel
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Khan Academy (fr)
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Blockly Games
Generating 42 user interaction(s) for user: "Kawahara C"@"Escuela de Demostración" for channel: Khan Academy (en)
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\python27\scripts\kolibri.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\kolibri\utils\cli.py", line 652, in main
    manage(command, args=django_args)
  File "c:\python27\lib\site-packages\kolibri\utils\cli.py", line 435, in manage
    execute_from_command_line(argv=argv)
  File "c:\python27\lib\site-packages\kolibri\dist\django\core\management\__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "c:\python27\lib\site-packages\kolibri\dist\django\core\management\__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\python27\lib\site-packages\kolibri\dist\django\core\management\base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "c:\python27\lib\site-packages\kolibri\dist\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "c:\python27\lib\site-packages\kolibri\logger\management\commands\generateuserdata.py", line 90, in handle
    now=now
  File "c:\python27\lib\site-packages\kolibri\logger\utils\user_data.py", line 103, in add_channel_activity_for_user
    channel=channel.name
  File "c:\python27\lib\encodings\cp437.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u6607' in position 45: character maps to <undefined>
```

### User-facing consequences
<!--
Implications and real-world consequences for learners, coaches, admins, and other users of the application
-->

Second time I've seen this (of 2 times running `generateuserdata`), so I'm guessing it's frequently blocking full runs of the command (at least with a large set of content).

### Steps to reproduce
<!--
Precise steps that someone else can follow in order to see this behavior
-->

In case it's specific to the database in use (e.g. channel titles?), database files have been uploaded to Slack here:
https://learningequality.slack.com/files/U2ZEEE3FF/F9R97AFPT/db.sqlite3
https://learningequality.slack.com/files/U2ZEEE3FF/F9S0PPS0M/db.sqlite3-shm
https://learningequality.slack.com/files/U2ZEEE3FF/F9RSLBP18/db.sqlite3-wal

### Context
<!--
Tell us about your environment, including:
 * Kolibri version
 * Operating system
 * Browser
-->

Kolibri 0.8.0 on Windows 10.



Discussion:
(Given how it ran through successfully for multiple users, and then bailed right when starting a new user, I'm guessing it may be an issue with one of the user's names)
Hrm, what channels do you have installed for this also? (just in case it is a channel specific interaction) 
You can see the list of channels in the traceback. It cycles through each channel several times, though, before crashing, so I don't think it's the channel name after all. There's a name with an accent and a Chinese name in there that could be doing it.
Is this the first time you have run this command on Windows 10? Wondering why we have not seen this before now. 
I think where I last saw something like this was on the other demo laptop, but didn't have time to report it then as I was in final packing mode for the Jukata trip.
This looks like a problem printing to the "lovely" Windows terminal. This has happened a lot before!

Resolving patch:
diff --git a/kolibri/logger/management/commands/generateuserdata.py b/kolibri/logger/management/commands/generateuserdata.py
--- a/kolibri/logger/management/commands/generateuserdata.py
+++ b/kolibri/logger/management/commands/generateuserdata.py
@@ -1,16 +1,24 @@
-from __future__ import absolute_import, print_function, unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
 
 import csv
+import logging
 import os
 import random
 
 from django.core.management.base import BaseCommand
 from django.utils import timezone
-from kolibri.auth.test.helpers import create_superuser, provision_device
+
+from kolibri.auth.test.helpers import create_superuser
+from kolibri.auth.test.helpers import provision_device
 from kolibri.content.models import ChannelMetadata
 from kolibri.logger.utils import user_data as utils
 
 
+logger = logging.getLogger(__name__)
+
+
 class Command(BaseCommand):
     help = 'Creates plausible data for front end testing of the app'
 
@@ -47,12 +55,12 @@ def handle(self, *args, **options):
 
         # Device needs to be provisioned before adding superusers
         if no_onboarding:
-            print('Provisioning device. Onboarding will be skipped after starting server.')
+            logger.info('Provisioning device. Onboarding will be skipped after starting server.')
             provision_device()
 
         for facility in facilities:
             if no_onboarding:
-                print('Creating superuser "superuser" with password "password" at facility {facility}.'.format(facility=facility.name))
+                logger.info('Creating superuser "superuser" with password "password" at facility {facility}.'.format(facility=facility.name))
                 create_superuser(facility=facility)
 
             classrooms = utils.get_or_create_classrooms(
diff --git a/kolibri/logger/utils/user_data.py b/kolibri/logger/utils/user_data.py
--- a/kolibri/logger/utils/user_data.py
+++ b/kolibri/logger/utils/user_data.py
@@ -1,15 +1,29 @@
-from __future__ import absolute_import, print_function, unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
 
 import datetime
+import logging
 import random
 
-from django.db.models import Max, Min, Sum
+from django.db.models import Max
+from django.db.models import Min
+from django.db.models import Sum
 from django.db.models.query import F
+from le_utils.constants import content_kinds
+
 from kolibri.auth.filters import HierarchyRelationsFilter
-from kolibri.auth.models import Classroom, Facility, FacilityUser
+from kolibri.auth.models import Classroom
+from kolibri.auth.models import Facility
+from kolibri.auth.models import FacilityUser
 from kolibri.content.models import ContentNode
-from kolibri.logger.models import AttemptLog, ContentSessionLog, ContentSummaryLog, MasteryLog
-from le_utils.constants import content_kinds
+from kolibri.logger.models import AttemptLog
+from kolibri.logger.models import ContentSessionLog
+from kolibri.logger.models import ContentSummaryLog
+from kolibri.logger.models import MasteryLog
+
+
+logger = logging.getLogger(__name__)
 
 
 def get_or_create_facilities(**options):
@@ -29,7 +43,7 @@ def get_or_create_classrooms(**options):
     n_on_device = Classroom.objects.filter(parent=facility).count()
     n_to_create = n_classes - n_on_device
     if n_to_create > 0:
-        print('Generating {n} classroom object(s) for facility: {name}'.format(
+        logger.info('Generating {n} classroom object(s) for facility: {name}'.format(
             n=n_to_create,
             name=facility.name,
         ))
@@ -60,7 +74,7 @@ def get_or_create_classroom_users(**options):
     # Only generate new users if there are fewer users than requested.
     n_to_create = n_users - n_in_classroom
     if n_to_create > 0:
-        print('Generating {n} user object(s) for class: {classroom} in facility: {facility}'.format(
+        logger.info('Generating {n} user object(s) for class: {classroom} in facility: {facility}'.format(
             n=n_to_create,
             classroom=classroom,
             facility=facility,
@@ -97,7 +111,7 @@ def add_channel_activity_for_user(**options): # noqa: max-complexity=16
     channel_id = channel.id
     default_channel_content = ContentNode.objects.exclude(kind=content_kinds.TOPIC).filter(channel_id=channel_id)
 
-    print('Generating {i} user interaction(s) for user: {user} for channel: {channel}'.format(
+    logger.debug('Generating {i} user interaction(s) for user: {user} for channel: {channel}'.format(
         i=n_content_items,
         user=user,
         channel=channel.name


Test patch: