Reputation: 2751
I've followed the steps and everything works fine on a local server but when I try to deploy on PythonAnywhere I keep running into problems. I don't know what I'm doing with the WSGI file so I just copied and pasted a template with some adjustments:
import os
import sys
path = '/home/KTruong88/Kappa_Ranks/Kappa_Ranks/'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'Kappa_Ranks.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application
I try to run the thing, and it gives me in the error logs:
TypeError: get_wsgi_application() takes 0 positional arguments but 2 were given
I don't know how if I configured my wsgi file properly, and I don't know where I can even access the get_wsgi_application() function so I can adjust it, or if I could, what would I adjust it too. How can I fix this?
Upvotes: 1
Views: 354
Reputation: 600049
You did not need to "copy and paste" a WSGI file in the first place; it is included in the project that was created when you did django-admin.py startproject
.
Nevertheless, the problem is that application
should be the object returned from get_wsgi_application
, not the function itself:
application = get_wsgi_application()
Upvotes: 3