So I've deployed django on vps with apache and mod wsgi. Everything seems to work fine except for one thing. Whenever I try to submit any of my forms, I get 500 server error. No errors show up in apache's errors log which is really weird.
Also before this on form submission I was getting errors that mod wsgi is running one version of python and other is being ran mod wsgi. I fixed this by ./configure'ing mod wsgi.
please let me know if you need anything else.
Here's my apache conf :
<VirtualHost *:80>
ServerAdmin marijus.merkevicius@gmail.com
ServerName 5.199.166.109
WSGIDaemonProcess ts threads=25
WSGIProcessGroup ts
Alias /static /home/tshirtnation/staticfiles
WSGIScriptAlias / /home/tshirtnation/index.wsgi
</VirtualHost>
mod wsgi:
import os import sys import site
# Add the app's directory to the PYTHONPATH
sys.path.append('/home/tshirtnation')
sys.path.append('/home/tshirtnation/tshirtnation')
os.environ['DJANGO_SETTINGS_MODULE'] = 'tshirtnation.settings'
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Okay, so I figured out that it's because of the database because I am using different db in development and it works fine.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'tshirtnation',
'USER': 'root',
'PASSWORD': 'xxx',
'HOST': '5.199.166.109', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
here are my settings. am I doing something wrong ?
Edit:
tried on development with production database and everything worked :/ I absoutely have no idea where this error is coming from..