Repository: DjangoGirls/djangogirls

Issue:
TypeError: render() got an unexpected keyword argument 'renderer'
Sentry Issue: [DJANGO-GIRLS-WEBSITE-J](https://sentry.io/organizations/django-girls/issues/2648446279/?referrer=github_integration)

```
TypeError: render() got an unexpected keyword argument 'renderer'
(41 additional frame(s) were not displayed)
...
  File "django/template/base.py", line 993, in render
    return render_value_in_context(output, context)
  File "django/template/base.py", line 972, in render_value_in_context
    value = str(value)
  File "django/utils/html.py", line 388, in <lambda>
    klass.__str__ = lambda self: mark_safe(klass_str(self))
  File "django/forms/boundfield.py", line 33, in __str__
    return self.as_widget()
  File "django/forms/boundfield.py", line 93, in as_widget
    renderer=self.form.renderer,
```


Discussion:

Resolving patch:
diff --git a/core/admin/forms/event_page_content.py b/core/admin/forms/event_page_content.py
--- a/core/admin/forms/event_page_content.py
+++ b/core/admin/forms/event_page_content.py
@@ -1,40 +1,12 @@
-from codemirror import CodeMirrorTextarea
 from django import forms
-from django.utils.safestring import mark_safe
-
-
-class ResizableCodeMirror(CodeMirrorTextarea):
-
-    def __init__(self, **kwargs):
-        super().__init__(js_var_format='%s_editor', **kwargs)
-
-    @property
-    def media(self):
-        mine = forms.Media(
-            css={'all': ('vendor/jquery-ui/jquery-ui.min.css',)},
-            js=('vendor/jquery-ui/jquery-ui.min.js',))
-        return super().media + mine
-
-    def render(self, name, value, attrs=None):
-        output = super().render(name, value, attrs)
-        return output + mark_safe(
-            '''
-                <script type="text/javascript">
-                $('.CodeMirror').resizable({
-                  resize: function() {
-                    %s_editor.setSize($(this).width(), $(this).height());
-                  }
-                });
-                </script>
-            ''' % name
-        )
+from tinymce.widgets import AdminTinyMCE
 
 
 class EventPageContentForm(forms.ModelForm):
 
     class Meta:
         widgets = {
-            'content': ResizableCodeMirror(mode="xml")
+            'content': AdminTinyMCE()
         }
         fields = (
             'event',
diff --git a/djangogirls/settings.py b/djangogirls/settings.py
--- a/djangogirls/settings.py
+++ b/djangogirls/settings.py
@@ -50,6 +50,7 @@ def gettext(s):
     'captcha',
     'django_countries',
     'gulp_rev',
+    'tinymce',
 
     'core',
     'applications',
@@ -238,9 +239,6 @@ def gettext(s):
 MEETUPS_EMAIL_USER = os.environ.get('MEETUPS_EMAIL_USER')
 MEETUPS_EMAIL_PASSWORD = os.environ.get('MEETUPS_EMAIL_PASSWORD')
 
-CODEMIRROR_PATH = "vendor/codemirror/"
-
-
 GAPPS_ADMIN_SDK_SCOPES = 'https://www.googleapis.com/auth/admin.directory.user'
 GAPPS_PRIVATE_KEY_ID = os.environ.get('GAPPS_PRIVATE_KEY_ID', '')
 GAPPS_PRIVATE_KEY = os.environ.get('GAPPS_PRIVATE_KEY', '')
diff --git a/djangogirls/urls.py b/djangogirls/urls.py
--- a/djangogirls/urls.py
+++ b/djangogirls/urls.py
@@ -43,6 +43,7 @@
         RedirectView.as_view(url='/account/password_reset', permanent=True),
         name='admin_password_reset'
     ),
+    path('tinymce/', include('tinymce.urls')),
 
     # Regular links:
     path('admin/', admin.site.urls),


Test patch: