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:
-
https://www.youtube.com/watch?v=ffqMZ5IcmSY&ab_channel=iFastNetLtd.InternetServices
-
https://smartlazycoding.com/django-tutorial/deploy-a-django-website-to-a2-hosting
-
https://hostpresto.com/community/tutorials/how-to-setup-a-python-django-website-on-hostpresto/
-
https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html
-
https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html
Very much applicate if you could help
2
Answers
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.
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
andpassenger_wsgi.py
should be in the same folder. Now edit yourpassenger_wsgi.py
and replace everything with the following code: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.