Hi Everyone,
I've been working on learning Django the past few months and have been following the django tutorials here:
I've followed the tutorial on my local machine in addition to on my A Small Orange account.
A Small Orange has this tutorial:
which has gotten me to reach the default django "Congrats" webpage. This pages appears on both my local machines django setup and the ASO website. The next step is to run the startapp function within the mysite folder.
My folder structure is as follows on the ASO server
home/"username"/
website/
mysite/
polls/ (after I run the startapp command)
(all the startapp default files)
mysite/
(all the startproject default files)
public_html/
dispatch.fcgi
.htaccess
My issue is that when I run "python27 manage.py startapp polls" from within the website/mysite folder my server immediately goes to a 500 internal server error page online while this function causes no issues on my local computer.
The only lead I have on the problem currently is that when I run my dispatch.fcgi file via "python27 dispatch.fcgi" from within the public_html directory I get the HTML output that should be up on my website. The output is shown within my SSH. This makes me think the error has something to do with the communication between the .htaccess file and the dispatch file.
-dispatch.fcgi
from traceback import formate_exc
try:
#!/home#/theopeni/.env/env/bin/python
import sys
import os
sys.path.insert(0, "/home/(myusername)/.env/env/lib/python2.7/site-packages")
sys.path.append("/home/(my username)/website/mysite/mysite")
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
except Exception:
open("/home/(my username)/website/error.txt", "w").write(format_exc())
raise
-.htaccess
AddHandler fcgi-script .fcgi
RewriteEngine On
RewriteCon %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]
I've talked to the ASO customer support and I worked with a technical support person for about a week to solve it and they were able to get an app started without error but then told me that this was beyond the scope of their customer support. I then tried adding my own app with the python27 manage.py startapp command and it broke the website again.
Has anyone else encountered this problem?
Thank you!
Michael