Repository: translate/pootle

Issue:
Drop run_cherrypy wsgi server?
We have the `run_cherrypy` command, does anybody use that? I'd suggest we drop it but I'd like some input from others.



Discussion:
+1 on dropping it

I'd be in favour of doing so for 2.7 btw.

`pootle start` uses it, providing a default for users wanting to quickly test Pootle after installing it.

No sense using cherrypy over django's builtin server for that tbh.

I have no objections to drop this, however the docs need to be prominent on suggesting to use a real server over the default toy server, and that's not quite the case at the moment.


Resolving patch:
diff --git a/pootle/apps/pootle_app/management/commands/run_cherrypy.py b/pootle/apps/pootle_app/management/commands/run_cherrypy.py
deleted file mode 100644
--- a/pootle/apps/pootle_app/management/commands/run_cherrypy.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) Pootle contributors.
-#
-# This file is a part of the Pootle project. It is distributed under the GPL3
-# or later license. See the LICENSE file for a copy of the license and the
-# AUTHORS file for copyright and authorship information.
-
-import os
-os.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'
-
-from optparse import make_option
-
-from pootle_app.management.commands import BaseRunCommand
-
-
-class Command(BaseRunCommand):
-    help = "Runs Pootle with the CherryPy server."
-
-    option_list = BaseRunCommand.option_list + (
-        make_option(
-            '--threads',
-            action='store',
-            dest='threads',
-            default=5,
-            type=int,
-            help='Number of working threads. Default: %default',
-        ),
-        make_option(
-            '--name',
-            action='store',
-            dest='server_name',
-            default='',
-            help='Name of the worker process.',
-        ),
-        make_option(
-            '--queue',
-            action='store',
-            dest='request_queue_size',
-            default=5,
-            type=int,
-            help='Maximum number of queued connections.',
-        ),
-        make_option(
-            '--ssl_certificate',
-            action='store',
-            dest='ssl_certificate',
-            default='',
-            help="Path to the server's SSL certificate.",
-        ),
-        make_option(
-            '--ssl_private_key',
-            action='store',
-            dest='ssl_private_key',
-            default='',
-            help="Path to the server's SSL private key.",
-        ),
-    )
-
-    def serve_forever(self, *args, **options):
-        # Not using launch_server since we want further control over the
-        # CherryPy WSGI server
-        from translate.misc.wsgiserver import CherryPyWSGIServer as Server
-
-        server = Server(
-            (options['host'], int(options['port'])),
-            self.get_app(),
-            int(options['threads']),
-            options['server_name'],
-            request_queue_size=int(options['request_queue_size'])
-        )
-
-        if options['ssl_certificate'] and options['ssl_private_key']:
-            server.ssl_certificate = options['ssl_certificate']
-            server.ssl_private_key = options['ssl_private_key']
-
-        import logging
-        logging.info("Starting CherryPy server, listening on port %s",
-                     options['port'])
-
-        try:
-            server.start()
-        except KeyboardInterrupt:
-            server.stop()
diff --git a/pootle/apps/pootle_app/management/commands/start.py b/pootle/apps/pootle_app/management/commands/start.py
--- a/pootle/apps/pootle_app/management/commands/start.py
+++ b/pootle/apps/pootle_app/management/commands/start.py
@@ -15,12 +15,12 @@ class Command(BaseCommand):
     args = '<server>'
     help = 'Starts the Pootle server'
 
-    def handle(self, server_name='cherrypy', **options):
+    def handle(self, server_name='django', **options):
         # XXX: Find a cleaner way to handle these and their custom options
         servers = {
-            'cherrypy': 'run_cherrypy',
             'fcgi': 'runfcgi',
             'gunicorn': 'run_gunicorn',
+            'django': 'runserver',
         }
 
         try:
diff --git a/pootle/checks.py b/pootle/checks.py
--- a/pootle/checks.py
+++ b/pootle/checks.py
@@ -33,9 +33,9 @@
 # XXX List of manage.py commands not to run the rqworker check on.
 # Maybe tagging can improve this?
 RQWORKER_WHITELIST = [
-    "start", "initdb", "revision", "sync_stores", "run_cherrypy",
-    "refresh_stats", "update_stores", "calculate_checks", "retry_failed_jobs",
-    "check", "runserver",
+    "start", "initdb", "revision", "sync_stores", "refresh_stats",
+    "update_stores", "calculate_checks", "retry_failed_jobs", "check",
+    "runserver",
 ]
 
 


Test patch: