{"action":"opened","issue":{"url":"https://api.github.com/repos/viniciuschiele/flask-apscheduler/issues/29","repository_url":"https://api.github.com/repos/viniciuschiele/flask-apscheduler","labels_url":"https://api.github.com/repos/viniciuschiele/flask-apscheduler/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/viniciuschiele/flask-apscheduler/issues/29/comments","events_url":"https://api.github.com/repos/viniciuschiele/flask-apscheduler/issues/29/events","html_url":"https://github.com/viniciuschiele/flask-apscheduler/issues/29","id":189491105,"number":29,"title":"How do I deploy flask-apscheduler with mod_wsgi?","user":{"login":"eayin2","id":7290696,"avatar_url":"https://avatars.githubusercontent.com/u/7290696?v=3","gravatar_id":"","url":"https://api.github.com/users/eayin2","html_url":"https://github.com/eayin2","followers_url":"https://api.github.com/users/eayin2/followers","following_url":"https://api.github.com/users/eayin2/following{/other_user}","gists_url":"https://api.github.com/users/eayin2/gists{/gist_id}","starred_url":"https://api.github.com/users/eayin2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eayin2/subscriptions","organizations_url":"https://api.github.com/users/eayin2/orgs","repos_url":"https://api.github.com/users/eayin2/repos","events_url":"https://api.github.com/users/eayin2/events{/privacy}","received_events_url":"https://api.github.com/users/eayin2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-15T20:00:06Z","updated_at":"2016-11-15T20:00:06Z","closed_at":null,"body":"I tried to return the app variable to my wsgi file. See my attempt:\r\n\r\n# mymodule.scheduler.py (misses some lines so it's easier to read)\r\n```\r\nimport os\r\nimport sys\r\nimport time\r\nfrom importlib import import_module\r\n\r\nfrom apscheduler.events import EVENT_JOB_EXECUTED, EVENT_JOB_ERROR\r\nfrom apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor\r\nfrom apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore\r\nfrom apscheduler.schedulers.background import BackgroundScheduler\r\nfrom apscheduler.triggers.interval import IntervalTrigger\r\nfrom flask import Flask\r\nfrom flask_apscheduler import APScheduler\r\nfrom helputils.core import log\r\n\r\n\r\nclass Config(object):\r\n    \"\"\"Configurations for flask-apscheduler\"\"\"\r\n    JOBS = jobs\r\n    JOBLOG_PATH = schedulerlog\r\n    SCHEDULER_JOBSTORES = jobstores\r\n    SCHEDULER_EXECUTORS = executors\r\n    SCHEDULER_JOB_DEFAULTS = job_defaults\r\n    SCHEDULER_VIEWS_ENABLED = True\r\n    SCHEDULER_TIMEZONE = berlin_timezone\r\n\r\nclass Scheduler():\r\n\r\n    def run(self):\r\n        log.info(\"Started scheduler.py\")                                                                                                                                                                                                                                                                   \r\n        self.sched = APScheduler()\r\n        app = Flask(__name__)\r\n        app.config.from_object(Config())\r\n        app.debug = True\r\n        self.sched.init_app(app)                                                                                                                                                                                                                                                                                         \r\n        self.sched.start()                                                                                                                                                                                                                                                                                               \r\n        return app\r\n\r\n# Textual reference                                                                                                                                                                                                                                                                                                                             \r\nrun = Scheduler().run\r\n```\r\n# my vhost file\r\n```\r\n        <VirtualHost *:8610>\r\n    ServerName flask_apscheduler\r\n\r\n    WSGIDaemonProcess flask_apscheduler user=http group=http threads=5 python-path=/srv/http/flask_apscheduler\r\n    WSGIScriptAlias / /srv/http/flask_apscheduler/flask_apscheduler.wsgi\r\n\r\n    <Directory /srv/http/flask_apscheduler>\r\n        WSGIProcessGroup flask_apscheduler\r\n        WSGIApplicationGroup %{GLOBAL}\r\n        Require all granted\r\n    </Directory>\r\n</VirtualHost>\r\n```\r\n\r\n# flask_apscheduler.wsgi\r\n```\r\nimport os\r\nimport sys\r\nsys.path.insert(0, '/srv/http/flask_apscheduler')\r\nos.chdir(\"/srv/http/flask_apscheduler\")\r\nfrom mymodule.scheduler import run as application\r\n\r\n```"}}
{"actor":{"display_login":"eayin2"}}