1

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?

1

1 Answer 1

3

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()
Sign up to request clarification or add additional context in comments.

1 Comment

for info, pythonanywhere requires an additional wsgi file for configuration. copy-pasting is quite a common way to make one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.