I'm a IT Dumb Head
I'm a IT Dumb Head

Reputation: 117

Could not spawn process for application deploying Django on Cpanel

I'm never done development in a career as a software programmer I'm given this domain name on NameCheap with the server disk. Now I design Django app and trying to deploy on the server but I had problems (stated below)

[ E 2019-03-19 06:23:19.7356 598863/T2n age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /home/username/IOT: The application process exited prematurely.
App 644163 output:   File "/home/username/IOT/passenger_wsgi.py", line 1, in <module>
App 644163 output:   File "/home/username/virtualenv/IOT/3.7/lib64/python3.7/imp.py", line 171, in load_source

edited: Read more about the software supporting the WSGI is using Phusion Passenger, you could read more here; www.phusionpassenger.com

this is my passenger_wsgi.py:

from myproject.wsgi import application

I had tried several tutorials:

  1. https://www.youtube.com/watch?v=ffqMZ5IcmSY&ab_channel=iFastNetLtd.InternetServices

  2. https://smartlazycoding.com/django-tutorial/deploy-a-django-website-to-a2-hosting

  3. https://hostpresto.com/community/tutorials/how-to-setup-a-python-django-website-on-hostpresto/

  4. https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html

  5. https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html

  6. how to install django on cpanel

Very much applicate if you could help

Upvotes: 2

Views: 6369

Answers (2)

Umer
Umer

Reputation: 580

When you setup a python app in cpanel, you specify the folder where you have setup the app. That will be the folder that will contain your passenger_wsgi.py file. You have to upload your django project to that same folder. To make sure they you have uploaded to the right directory, just have this simple check_ your manage.py and passenger_wsgi.py should be in the same folder. Now edit your passenger_wsgi.py and replace everything with the following code:

from myapp.wsgi import application

After this, do not forget to restart the python app. I have written a step by step guide for deploying django app on shared hosting using cpanel. Check it here.

Upvotes: 4

I&#39;m a IT Dumb Head
I&#39;m a IT Dumb Head

Reputation: 117

The answer very simple, my server is using a programme name passenger, the official website for more information: https://www.phusionpassenger.com/

Now error very simply; passenger can't find my application, All I did was move my project and app folder on the same layer passenger_wsgi.py and it works like charm.

Upvotes: 1

Related Questions