I've been trying absolutely everything to get this to work without any progress. Any help would be greatly appreciated.
I currently have a website running on Godaddy with the "Economy Linux Hosting with cPanel" plan and I want to use Django on the website. I followed the instructions given in this tutorial and also this one but when I try to test it by going to the "[website].com/admin" page, I get a 500 Internal Server Error. When I look at the Error page on cPanel, I see this error every time I try to access that page.
NOTE: Omitted cPanel username and database info.
/home/[cPanel username]/public_html/test/.htaccess: Invalid command 'PassengerAppRoot', perhaps misspelled or defined by a module not included in the server configuration
This is what my .htaccess looks like (it's auto-created when I perform the "Setup Python App" process in cPanel).
# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION BEGIN PassengerAppRoot "/home/[cPanel Username]/myapp" PassengerBaseURI "/." PassengerPython "/home/[cPanel Username]/virtualenv/myapp/3.6/bin/python3.6" # DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION END
"/home/[cPanel Username]/myapp" is the Django project root folder with manage.py and also passenger_wsgi.py, as seen here.
Here's how I setup Django in the "Setup Python App" page in cPanel.
This is the passenger_wsgi.py it created:
import imp
import os
import sys sys.path.insert(0, os.path.dirname(__file__))
wsgi = imp.load_source('wsgi', 'myapp/wsgi.py')
application = wsgi.application
And also the changes I made to settings.py:
DEBUG = False
ALLOWED_HOSTS = ['*']
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME' : '[name]', 'USER' : '[user]', 'PASSWORD' : '[password]', 'HOST' : '127.0.0.1', 'PORT' : '3306', } }
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATICFILES_DIRS = [ BASE_DIR + "/assets", ]
STATIC_ROOT = '/home/[cPanel username]/public_html/static'
MEDIA_ROOT = '/home/[cPanel username]/public_html/media'
I've been trying absolutely everything to get this to work without any progress. Any help would be greatly appreciated.
Copyright © 1999 - 2021 GoDaddy Operating Company, LLC. All Rights Reserved.
Use of this Site is subject to express terms of use. By using this site, you signify that you agree to be bound by these Universal Terms of Service.