Skip to main content

Is ASGI django app supported in cpanel?

Comments

11 comments

  • JasmineXU
    At this moment, I have set up somethings (created a python app, copied my project to cpanel), though not sure I have set correctly. I try to test it with production server in port 8000, which is not responding. I tried some commands like netstat, telnet, but I got errors command not found. Any ideas how to solve it? Another question: when I create a python app, it gives passenger_wsgi.py. Am I supposed to do something with it to have asgi app setup?
    0
  • cPanelLauren
    Hi @JasmineXU Could you possibly provide an example app? From what I understand after discussing this internally is that this should work if you initiate it with app.py but we'd like to test it to confirm this. Thanks!
    0
  • JasmineXU
    Hi, My app is using Otree which is based on django. Here are the demo apps in github:
    0
  • cPanelLauren
    Hi @JasmineXU Looking at this, it says it requires Python 3.7 and the version of Python we use is what is distributed by the OS on CentOS 7 this is Python v2.7 so this app wouldn't be compatible
    0
  • JasmineXU
    What if install python 3.7? I tried to install python 3 but it seems I still need to install postgresql-devel as well to compile . I did not find a way install it because I don"t have root access.
    0
  • cPanelLauren
    This isn't something that's supported by cPanel so unfortunately, I can't tell you if this would work.
    0
  • cobyiv
    Hi there-- now that Python 3.7 is supported will ASGI apps work?
    0
  • cPRex Jurassic Moderator
    I spoke with our team that handles that area of development so I'll post a reply as soon as I hear back!
    0
  • cPRex Jurassic Moderator
    I heard back from our developers on this, and while there isn't officially support for PGSI or ASGI applications, we would expect them to work with passenger under the new Python version.
    0
  • cobyiv
    I heard back from our developers on this, and while there isn't officially support for PGSI or ASGI applications, we would expect them to work with passenger under the new Python version.

    Thanks for the response here, so every time I try to start a Python App referencing ASGI from {DJANGO_APP}.asgi import application
    in the passenger_wsgi.py application startup file. I get the following error log: PYTHON APP LOG >> App 2812149 output: /opt/passenger-5.3.7-9.el6.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses >> App 2812149 output: import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno
    I also tried to use this github project:
    0
  • cPRex Jurassic Moderator
    So full disclosure, I'm not a dev and will never claim to be. With that in mind.....I did have one of our devs do a quick test with that app and he had "limited success" as it loaded through passenger but then failed on the code itself, so it sounds like it may not be just you experiencing issues with that specific project.
    0

Please sign in to leave a comment.