We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Pin dependencies in package.json to get auto-updates from Greenkeeper
## Bug Report

**Expected behavior/code**
Greenkeeper should update every possible version for every dependency

**Actual Behavior**
It only updates major versions (semver)

**Steps to Reproduce**
N/A (see Greenkeeper bot Pull Requests)

**Environment**
N/A

**Possible Solution**
https://greenkeeper.io/faq.html#pinning-versions
Pinning the versions (removing ^ will cause greenkeeper to upgrade all dependencies)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `apps/core/helpers.py`
Content:
```
1 """
2 Helpers that can be useful throughout the whole project
3 """
4 from django.utils.text import slugify
5 
6 from cms.api import add_plugin, create_page, create_title
7 
8 
9 def create_i18n_page(content, is_homepage=False, **kwargs):
10     """
11     Creating a multilingual page is not straightforward so we thought we should have a helper
12 
13     This content argument should be a dictionary with the title of the page in each language:
14 
15         {
16             'en': 'About',
17             'fr': 'A propos',
18             'de': 'Impressum',
19         }
20 
21     """
22     # Create the page with a first language from what is given to us
23     languages = list(content.keys())  # convert `dict_keys` to list so it can be poped
24     first_language = languages.pop(0)
25     slug = slugify(content[first_language])
26     page = create_page(
27         language=first_language,
28         menu_title=content[first_language],
29         title=content[first_language],
30         slug=slug,
31         **kwargs
32     )
33 
34     if is_homepage is True:
35         page.set_as_homepage()
36 
37     # Add a title for each additional language
38     for language in languages:
39         create_title(
40             language=language,
41             menu_title=content[language],
42             title=content[language],
43             slug=slugify(content[language]),
44             page=page,
45         )
46         # Publish page in each additional language
47         if kwargs.get("published") is True:
48             page.publish(language)
49 
50     # Add a plugin for each language (including the first language this time...)
51     placeholder = page.placeholders.get(slot="maincontent")
52     for language in content.keys():
53         add_plugin(
54             body="[{:s}] Lorem ipsum...".format(language),
55             language=language,
56             placeholder=placeholder,
57             plugin_type="TextPlugin",
58         )
59 
60     return page
61
```

Path: `apps/core/management/commands/create_demo_site.py`
Content:
```
1 """
2 create_demo_site management command
3 """
4 import logging
5 
6 from django.core.management.base import BaseCommand, CommandError
7 from django.conf import settings
8 from django.contrib.sites.models import Site
9 
10 from cms import models as cms_models
11 
12 from apps.courses.models import Course, Organization, Subject
13 from apps.persons.models import Person
14 from apps.courses.factories import OrganizationFactory
15 
16 from ...helpers import create_i18n_page
17 
18 logger = logging.getLogger("richie.commands.core.create_demo_site")
19 
20 NB_ORGANIZATIONS = 8
21 PAGE_INFOS = {
22     "home": {
23         "content": {"en": "Home", "fr": "Accueil"},
24         "kwargs": {"template": "richie/fullwidth.html"},
25     },
26     "news": {
27         "content": {"en": "News", "fr": "Actualités"},
28         "kwargs": {"template": "richie/fullwidth.html"},
29     },
30     "courses": {
31         "content": {"en": "Courses", "fr": "Cours"},
32         "kwargs": {
33             "reverse_id": Course.ROOT_REVERSE_ID,
34             "template": "richie/fullwidth.html",
35         },
36     },
37     "subjects": {
38         "content": {"en": "Subjects", "fr": "Sujets"},
39         "kwargs": {
40             "reverse_id": Subject.ROOT_REVERSE_ID,
41             "template": "richie/fullwidth.html",
42         },
43     },
44     "organizations": {
45         "content": {"en": "Organizations", "fr": "Etablissements"},
46         "kwargs": {
47             "reverse_id": Organization.ROOT_REVERSE_ID,
48             "template": "richie/fullwidth.html",
49         },
50     },
51     "persons": {
52         "content": {"en": "Persons", "fr": "Personnes"},
53         "kwargs": {
54             "reverse_id": Person.ROOT_REVERSE_ID,
55             "template": "richie/fullwidth.html",
56         },
57     },
58     "dashboard": {
59         "content": {"en": "Dashboard", "fr": "Tableau de bord"},
60         "cms": False,
61         "kwargs": {"template": "richie/fullwidth.html"},
62     },
63     "about": {
64         "content": {"en": "About", "fr": "A propos"},
65         "kwargs": {"template": "richie/fullwidth.html"},
66     },
67 }
68 
69 
70 # pylint: disable=no-member
71 #
72 # Looks like pylint is not relevant at guessing object types when cascading
73 # methods over querysets: Instance of 'list' has no 'delete' member (no-member).
74 # We choose to ignore this false positive warning.
75 def clear_cms_data():
76     """Clear all CMS data (CMS models + organizations)"""
77 
78     cms_models.Page.objects.all().delete()
79     cms_models.Title.objects.all().delete()
80     cms_models.CMSPlugin.objects.all().delete()
81     cms_models.Placeholder.objects.all().delete()
82     Course.objects.all().delete()
83     Organization.objects.all().delete()
84     Subject.objects.all().delete()
85 
86 
87 def create_demo_site():
88     """
89     Create a simple site tree structure for developpers to work in realistic environment.
90 
91     We create multilingual pages, add organizations under the related page and add
92     plugins to each page.
93     """
94     site = Site.objects.get(id=1)
95 
96     # Create pages as described in PAGES_INFOS
97     pages_created = {}
98     for name, info in PAGE_INFOS.items():
99         page = create_i18n_page(
100             info["content"],
101             is_homepage=(name == "home"),
102             in_navigation=True,
103             published=True,
104             site=site,
105             **info["kwargs"]
106         )
107 
108         pages_created[name] = page
109 
110     # Create organizations under the `organizations` page
111     for i, _ in enumerate(range(NB_ORGANIZATIONS)):
112         page = create_i18n_page(
113             {
114                 "en": "Organization #{:d}".format(i),
115                 "fr": "Organisation #{:d}".format(i),
116             },
117             parent=pages_created["organizations"],
118             published=True,
119             site=site,
120             template="courses/cms/organization_detail.html",
121         )
122         OrganizationFactory(extended_object=page)
123 
124 
125 class Command(BaseCommand):
126     """Create default pages for FUN frontend"""
127 
128     help = __doc__
129 
130     def add_arguments(self, parser):
131 
132         parser.add_argument(
133             "-f",
134             "--force",
135             action="store_true",
136             default=False,
137             help="Force command execution despite DEBUG is set to False",
138         )
139 
140     def handle(self, *args, **options):
141 
142         if not settings.DEBUG and not options["force"]:
143             raise CommandError(
144                 (
145                     "This command is not meant to be used in production environment "
146                     "except you know what you are doing, if so use --force parameter"
147                 )
148             )
149 
150         clear_cms_data()
151         create_demo_site()
152 
153         logger.info("done")
154
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/apps/core/helpers.py b/apps/core/helpers.py
--- a/apps/core/helpers.py
+++ b/apps/core/helpers.py
@@ -6,7 +6,7 @@
 from cms.api import add_plugin, create_page, create_title
 
 
-def create_i18n_page(content, is_homepage=False, **kwargs):
+def create_i18n_page(content, has_maincontent=True, is_homepage=False, **kwargs):
     """
     Creating a multilingual page is not straightforward so we thought we should have a helper
 
@@ -47,14 +47,17 @@
         if kwargs.get("published") is True:
             page.publish(language)
 
-    # Add a plugin for each language (including the first language this time...)
-    placeholder = page.placeholders.get(slot="maincontent")
-    for language in content.keys():
-        add_plugin(
-            body="[{:s}] Lorem ipsum...".format(language),
-            language=language,
-            placeholder=placeholder,
-            plugin_type="TextPlugin",
-        )
+    # Some pages have specific purpose templates that do not have a user-editable maincontent area
+    # One such page is the "Courses" page which uses the Search template
+    if has_maincontent:
+        # Add a plugin for each language
+        placeholder = page.placeholders.get(slot="maincontent")
+        for language in content.keys():
+            add_plugin(
+                body="[{:s}] Lorem ipsum...".format(language),
+                language=language,
+                placeholder=placeholder,
+                plugin_type="TextPlugin",
+            )
 
     return page
diff --git a/apps/core/management/commands/create_demo_site.py b/apps/core/management/commands/create_demo_site.py
--- a/apps/core/management/commands/create_demo_site.py
+++ b/apps/core/management/commands/create_demo_site.py
@@ -30,8 +30,9 @@
     "courses": {
         "content": {"en": "Courses", "fr": "Cours"},
         "kwargs": {
+            "has_maincontent": False,
             "reverse_id": Course.ROOT_REVERSE_ID,
-            "template": "richie/fullwidth.html",
+            "template": "search/search.html",
         },
     },
     "subjects": {

{"golden_diff": "diff --git a/apps/core/helpers.py b/apps/core/helpers.py\n--- a/apps/core/helpers.py\n+++ b/apps/core/helpers.py\n@@ -6,7 +6,7 @@\n from cms.api import add_plugin, create_page, create_title\n \n \n-def create_i18n_page(content, is_homepage=False, **kwargs):\n+def create_i18n_page(content, has_maincontent=True, is_homepage=False, **kwargs):\n     \"\"\"\n     Creating a multilingual page is not straightforward so we thought we should have a helper\n \n@@ -47,14 +47,17 @@\n         if kwargs.get(\"published\") is True:\n             page.publish(language)\n \n-    # Add a plugin for each language (including the first language this time...)\n-    placeholder = page.placeholders.get(slot=\"maincontent\")\n-    for language in content.keys():\n-        add_plugin(\n-            body=\"[{:s}] Lorem ipsum...\".format(language),\n-            language=language,\n-            placeholder=placeholder,\n-            plugin_type=\"TextPlugin\",\n-        )\n+    # Some pages have specific purpose templates that do not have a user-editable maincontent area\n+    # One such page is the \"Courses\" page which uses the Search template\n+    if has_maincontent:\n+        # Add a plugin for each language\n+        placeholder = page.placeholders.get(slot=\"maincontent\")\n+        for language in content.keys():\n+            add_plugin(\n+                body=\"[{:s}] Lorem ipsum...\".format(language),\n+                language=language,\n+                placeholder=placeholder,\n+                plugin_type=\"TextPlugin\",\n+            )\n \n     return page\ndiff --git a/apps/core/management/commands/create_demo_site.py b/apps/core/management/commands/create_demo_site.py\n--- a/apps/core/management/commands/create_demo_site.py\n+++ b/apps/core/management/commands/create_demo_site.py\n@@ -30,8 +30,9 @@\n     \"courses\": {\n         \"content\": {\"en\": \"Courses\", \"fr\": \"Cours\"},\n         \"kwargs\": {\n+            \"has_maincontent\": False,\n             \"reverse_id\": Course.ROOT_REVERSE_ID,\n-            \"template\": \"richie/fullwidth.html\",\n+            \"template\": \"search/search.html\",\n         },\n     },\n     \"subjects\": {\n", "issue": "Pin dependencies in package.json to get auto-updates from Greenkeeper\n## Bug Report\r\n\r\n**Expected behavior/code**\r\nGreenkeeper should update every possible version for every dependency\r\n\r\n**Actual Behavior**\r\nIt only updates major versions (semver)\r\n\r\n**Steps to Reproduce**\r\nN/A (see Greenkeeper bot Pull Requests)\r\n\r\n**Environment**\r\nN/A\r\n\r\n**Possible Solution**\r\nhttps://greenkeeper.io/faq.html#pinning-versions\r\nPinning the versions (removing ^ will cause greenkeeper to upgrade all dependencies)\r\n\n", "before_files": [{"content": "\"\"\"\nHelpers that can be useful throughout the whole project\n\"\"\"\nfrom django.utils.text import slugify\n\nfrom cms.api import add_plugin, create_page, create_title\n\n\ndef create_i18n_page(content, is_homepage=False, **kwargs):\n    \"\"\"\n    Creating a multilingual page is not straightforward so we thought we should have a helper\n\n    This content argument should be a dictionary with the title of the page in each language:\n\n        {\n            'en': 'About',\n            'fr': 'A propos',\n            'de': 'Impressum',\n        }\n\n    \"\"\"\n    # Create the page with a first language from what is given to us\n    languages = list(content.keys())  # convert `dict_keys` to list so it can be poped\n    first_language = languages.pop(0)\n    slug = slugify(content[first_language])\n    page = create_page(\n        language=first_language,\n        menu_title=content[first_language],\n        title=content[first_language],\n        slug=slug,\n        **kwargs\n    )\n\n    if is_homepage is True:\n        page.set_as_homepage()\n\n    # Add a title for each additional language\n    for language in languages:\n        create_title(\n            language=language,\n            menu_title=content[language],\n            title=content[language],\n            slug=slugify(content[language]),\n            page=page,\n        )\n        # Publish page in each additional language\n        if kwargs.get(\"published\") is True:\n            page.publish(language)\n\n    # Add a plugin for each language (including the first language this time...)\n    placeholder = page.placeholders.get(slot=\"maincontent\")\n    for language in content.keys():\n        add_plugin(\n            body=\"[{:s}] Lorem ipsum...\".format(language),\n            language=language,\n            placeholder=placeholder,\n            plugin_type=\"TextPlugin\",\n        )\n\n    return page\n", "path": "apps/core/helpers.py"}, {"content": "\"\"\"\ncreate_demo_site management command\n\"\"\"\nimport logging\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\n\nfrom cms import models as cms_models\n\nfrom apps.courses.models import Course, Organization, Subject\nfrom apps.persons.models import Person\nfrom apps.courses.factories import OrganizationFactory\n\nfrom ...helpers import create_i18n_page\n\nlogger = logging.getLogger(\"richie.commands.core.create_demo_site\")\n\nNB_ORGANIZATIONS = 8\nPAGE_INFOS = {\n    \"home\": {\n        \"content\": {\"en\": \"Home\", \"fr\": \"Accueil\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"news\": {\n        \"content\": {\"en\": \"News\", \"fr\": \"Actualit\u00e9s\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"courses\": {\n        \"content\": {\"en\": \"Courses\", \"fr\": \"Cours\"},\n        \"kwargs\": {\n            \"reverse_id\": Course.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"subjects\": {\n        \"content\": {\"en\": \"Subjects\", \"fr\": \"Sujets\"},\n        \"kwargs\": {\n            \"reverse_id\": Subject.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"organizations\": {\n        \"content\": {\"en\": \"Organizations\", \"fr\": \"Etablissements\"},\n        \"kwargs\": {\n            \"reverse_id\": Organization.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"persons\": {\n        \"content\": {\"en\": \"Persons\", \"fr\": \"Personnes\"},\n        \"kwargs\": {\n            \"reverse_id\": Person.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"dashboard\": {\n        \"content\": {\"en\": \"Dashboard\", \"fr\": \"Tableau de bord\"},\n        \"cms\": False,\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"about\": {\n        \"content\": {\"en\": \"About\", \"fr\": \"A propos\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n}\n\n\n# pylint: disable=no-member\n#\n# Looks like pylint is not relevant at guessing object types when cascading\n# methods over querysets: Instance of 'list' has no 'delete' member (no-member).\n# We choose to ignore this false positive warning.\ndef clear_cms_data():\n    \"\"\"Clear all CMS data (CMS models + organizations)\"\"\"\n\n    cms_models.Page.objects.all().delete()\n    cms_models.Title.objects.all().delete()\n    cms_models.CMSPlugin.objects.all().delete()\n    cms_models.Placeholder.objects.all().delete()\n    Course.objects.all().delete()\n    Organization.objects.all().delete()\n    Subject.objects.all().delete()\n\n\ndef create_demo_site():\n    \"\"\"\n    Create a simple site tree structure for developpers to work in realistic environment.\n\n    We create multilingual pages, add organizations under the related page and add\n    plugins to each page.\n    \"\"\"\n    site = Site.objects.get(id=1)\n\n    # Create pages as described in PAGES_INFOS\n    pages_created = {}\n    for name, info in PAGE_INFOS.items():\n        page = create_i18n_page(\n            info[\"content\"],\n            is_homepage=(name == \"home\"),\n            in_navigation=True,\n            published=True,\n            site=site,\n            **info[\"kwargs\"]\n        )\n\n        pages_created[name] = page\n\n    # Create organizations under the `organizations` page\n    for i, _ in enumerate(range(NB_ORGANIZATIONS)):\n        page = create_i18n_page(\n            {\n                \"en\": \"Organization #{:d}\".format(i),\n                \"fr\": \"Organisation #{:d}\".format(i),\n            },\n            parent=pages_created[\"organizations\"],\n            published=True,\n            site=site,\n            template=\"courses/cms/organization_detail.html\",\n        )\n        OrganizationFactory(extended_object=page)\n\n\nclass Command(BaseCommand):\n    \"\"\"Create default pages for FUN frontend\"\"\"\n\n    help = __doc__\n\n    def add_arguments(self, parser):\n\n        parser.add_argument(\n            \"-f\",\n            \"--force\",\n            action=\"store_true\",\n            default=False,\n            help=\"Force command execution despite DEBUG is set to False\",\n        )\n\n    def handle(self, *args, **options):\n\n        if not settings.DEBUG and not options[\"force\"]:\n            raise CommandError(\n                (\n                    \"This command is not meant to be used in production environment \"\n                    \"except you know what you are doing, if so use --force parameter\"\n                )\n            )\n\n        clear_cms_data()\n        create_demo_site()\n\n        logger.info(\"done\")\n", "path": "apps/core/management/commands/create_demo_site.py"}], "after_files": [{"content": "\"\"\"\nHelpers that can be useful throughout the whole project\n\"\"\"\nfrom django.utils.text import slugify\n\nfrom cms.api import add_plugin, create_page, create_title\n\n\ndef create_i18n_page(content, has_maincontent=True, is_homepage=False, **kwargs):\n    \"\"\"\n    Creating a multilingual page is not straightforward so we thought we should have a helper\n\n    This content argument should be a dictionary with the title of the page in each language:\n\n        {\n            'en': 'About',\n            'fr': 'A propos',\n            'de': 'Impressum',\n        }\n\n    \"\"\"\n    # Create the page with a first language from what is given to us\n    languages = list(content.keys())  # convert `dict_keys` to list so it can be poped\n    first_language = languages.pop(0)\n    slug = slugify(content[first_language])\n    page = create_page(\n        language=first_language,\n        menu_title=content[first_language],\n        title=content[first_language],\n        slug=slug,\n        **kwargs\n    )\n\n    if is_homepage is True:\n        page.set_as_homepage()\n\n    # Add a title for each additional language\n    for language in languages:\n        create_title(\n            language=language,\n            menu_title=content[language],\n            title=content[language],\n            slug=slugify(content[language]),\n            page=page,\n        )\n        # Publish page in each additional language\n        if kwargs.get(\"published\") is True:\n            page.publish(language)\n\n    # Some pages have specific purpose templates that do not have a user-editable maincontent area\n    # One such page is the \"Courses\" page which uses the Search template\n    if has_maincontent:\n        # Add a plugin for each language\n        placeholder = page.placeholders.get(slot=\"maincontent\")\n        for language in content.keys():\n            add_plugin(\n                body=\"[{:s}] Lorem ipsum...\".format(language),\n                language=language,\n                placeholder=placeholder,\n                plugin_type=\"TextPlugin\",\n            )\n\n    return page\n", "path": "apps/core/helpers.py"}, {"content": "\"\"\"\ncreate_demo_site management command\n\"\"\"\nimport logging\n\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\n\nfrom cms import models as cms_models\n\nfrom apps.courses.models import Course, Organization, Subject\nfrom apps.persons.models import Person\nfrom apps.courses.factories import OrganizationFactory\n\nfrom ...helpers import create_i18n_page\n\nlogger = logging.getLogger(\"richie.commands.core.create_demo_site\")\n\nNB_ORGANIZATIONS = 8\nPAGE_INFOS = {\n    \"home\": {\n        \"content\": {\"en\": \"Home\", \"fr\": \"Accueil\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"news\": {\n        \"content\": {\"en\": \"News\", \"fr\": \"Actualit\u00e9s\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"courses\": {\n        \"content\": {\"en\": \"Courses\", \"fr\": \"Cours\"},\n        \"kwargs\": {\n            \"has_maincontent\": False,\n            \"reverse_id\": Course.ROOT_REVERSE_ID,\n            \"template\": \"search/search.html\",\n        },\n    },\n    \"subjects\": {\n        \"content\": {\"en\": \"Subjects\", \"fr\": \"Sujets\"},\n        \"kwargs\": {\n            \"reverse_id\": Subject.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"organizations\": {\n        \"content\": {\"en\": \"Organizations\", \"fr\": \"Etablissements\"},\n        \"kwargs\": {\n            \"reverse_id\": Organization.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"persons\": {\n        \"content\": {\"en\": \"Persons\", \"fr\": \"Personnes\"},\n        \"kwargs\": {\n            \"reverse_id\": Person.ROOT_REVERSE_ID,\n            \"template\": \"richie/fullwidth.html\",\n        },\n    },\n    \"dashboard\": {\n        \"content\": {\"en\": \"Dashboard\", \"fr\": \"Tableau de bord\"},\n        \"cms\": False,\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n    \"about\": {\n        \"content\": {\"en\": \"About\", \"fr\": \"A propos\"},\n        \"kwargs\": {\"template\": \"richie/fullwidth.html\"},\n    },\n}\n\n\n# pylint: disable=no-member\n#\n# Looks like pylint is not relevant at guessing object types when cascading\n# methods over querysets: Instance of 'list' has no 'delete' member (no-member).\n# We choose to ignore this false positive warning.\ndef clear_cms_data():\n    \"\"\"Clear all CMS data (CMS models + organizations)\"\"\"\n\n    cms_models.Page.objects.all().delete()\n    cms_models.Title.objects.all().delete()\n    cms_models.CMSPlugin.objects.all().delete()\n    cms_models.Placeholder.objects.all().delete()\n    Course.objects.all().delete()\n    Organization.objects.all().delete()\n    Subject.objects.all().delete()\n\n\ndef create_demo_site():\n    \"\"\"\n    Create a simple site tree structure for developpers to work in realistic environment.\n\n    We create multilingual pages, add organizations under the related page and add\n    plugins to each page.\n    \"\"\"\n    site = Site.objects.get(id=1)\n\n    # Create pages as described in PAGES_INFOS\n    pages_created = {}\n    for name, info in PAGE_INFOS.items():\n        page = create_i18n_page(\n            info[\"content\"],\n            is_homepage=(name == \"home\"),\n            in_navigation=True,\n            published=True,\n            site=site,\n            **info[\"kwargs\"]\n        )\n\n        pages_created[name] = page\n\n    # Create organizations under the `organizations` page\n    for i, _ in enumerate(range(NB_ORGANIZATIONS)):\n        page = create_i18n_page(\n            {\n                \"en\": \"Organization #{:d}\".format(i),\n                \"fr\": \"Organisation #{:d}\".format(i),\n            },\n            parent=pages_created[\"organizations\"],\n            published=True,\n            site=site,\n            template=\"courses/cms/organization_detail.html\",\n        )\n        OrganizationFactory(extended_object=page)\n\n\nclass Command(BaseCommand):\n    \"\"\"Create default pages for FUN frontend\"\"\"\n\n    help = __doc__\n\n    def add_arguments(self, parser):\n\n        parser.add_argument(\n            \"-f\",\n            \"--force\",\n            action=\"store_true\",\n            default=False,\n            help=\"Force command execution despite DEBUG is set to False\",\n        )\n\n    def handle(self, *args, **options):\n\n        if not settings.DEBUG and not options[\"force\"]:\n            raise CommandError(\n                (\n                    \"This command is not meant to be used in production environment \"\n                    \"except you know what you are doing, if so use --force parameter\"\n                )\n            )\n\n        clear_cms_data()\n        create_demo_site()\n\n        logger.info(\"done\")\n", "path": "apps/core/management/commands/create_demo_site.py"}]}