ipurnama Posted May 25, 2020 Posted May 25, 2020 (edited) Hi, I'm a newbie. How can I use Python (then Django) from cPanel since I didn't see it on the software section? Do I need to make a request for accessing it so it will be appeared on the cPanel or is there any way to do that? my username: ipurnamaserver: johnny Thanks for your help. Edited May 25, 2020 by ipurnama
Krydos Posted May 25, 2020 Posted May 25, 2020 All accounts have access to python and django by default. You don't have to request access. To do python cgi just put your script in cgi-bin and access it with a browser. To get started with django follow this guide https://wiki.helionet.org/tutorials/django
ipurnama Posted May 26, 2020 Author Posted May 26, 2020 Thank you for your guidance. I followed all the steps to get started with Django from that wiki, but still Django cannot come to my browser. Could you point out my mistake please?
ipurnama Posted May 26, 2020 Author Posted May 26, 2020 Hi Sohamb03, I put my Django installation in home/ipurnama/public_html/mywebsite. Then I browsed it via purnama.heliohost.org and it just show my installation folder. Could you give me a guidance please? I'm a newbie.
Luigi123 Posted May 26, 2020 Posted May 26, 2020 This your link to your python file. http://purnama.heliohost.org/manage.py
Sn1F3rt Posted May 26, 2020 Posted May 26, 2020 No Luigi, this isn't answered nor is that Python file the one I was talking about. That's just one part of Django, I was rather asking about the path to the Django installation. Also, escalating this to Krydos to figure out what's wrong.
Krydos Posted May 27, 2020 Posted May 27, 2020 I'm getting a 404 when I visit http://purnama.heliohost.org/mywebsite/ I took a look at your .htaccess and noticed your path to dispatch.wsgi doesn't exist. It's looking for /home/ipurnama/public_html/mywebsite/mywebsite/dispatch.wsgi which doesn't exist. Try changing the last line to this: RewriteRule ^(.*)$ mywebsite/dispatch.wsgi/$1 [QSA,PT,L]
ipurnama Posted May 27, 2020 Author Posted May 27, 2020 I changed the last line of .htaccess to: RewriteRule ^(.*)$ mywebsite/dispatch.wsgi/$1 [QSA,PT,L] It could be I still miss something, because now I'm getting this error: Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator at webmaster@purnama.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.More information about this error may be available in the server error log.Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Krydos Posted May 27, 2020 Posted May 27, 2020 The 500 error was because of a redirect loop. I undid the changes you made to .htaccess and just moved your files to the subdirectory and now it works. http://purnama.heliohost.org/mywebsite/
ipurnama Posted May 27, 2020 Author Posted May 27, 2020 Yes, It works now. Thank you so much for your help, really appreciate that.
Recommended Posts