Forums

Error running WSGI application

Hi I get the the following error when I go to my site with naked domain. I mean mysite.com Error running WSGI application ImportError: No module named django.core.wsgi

Again when I got to my site with www.mysite.com, I get this the coming soon page. Please what am I not getting right here.

Thanks

From a strictly technical perspective, www.mysite.com and mysite.com are completely different websites -- they could be running on different servers, and contain different content.

So right now, you only have mysite.com set up on PythonAnywhere -- which is why, when you visit www.mysite.com, you get a "Coming soon" page -- there's no web app set up on the web tab to handle requests for that domain.

Now, of course, the normal setup that most web apps have these days -- despite the technical details above -- is that if someone goes to mysite.com, they get the page from www.mysite.com. The way we recommend you set that up is that you have www.mysite.com as the host that you specify on the "Web" tab, and then you use what's called a "domain redirect" to make sure that if someone just types mysite.com into their browser, a site is configured for that "naked" domain to tell the browser to simply redirect to www.mysite.com.

Domain redirects are something that you can normally set up with your DNS provider; they sometimes call it something different, but if you tell us which DNS provider/registrar you're using, we can probably point you at the appropriate help page on their site. (Some registrars and DNS providers simply don't do domain redirects, but there are also free services that will do it for you, like wwwizer.)

Now, on to the ImportError that you're getting for your site. I see that you're using virtualenvs for all of your sites (which is a good thing!). An ImportError for Django modules like django.core.wsgi is normally a sign that you haven't installed Django into the virtualenv associated with the web app. Could you check that you have? If you're sure you have, can I take a look at your files? We can see them from our admin interface, but we always ask for permission first.

Thanks for your response. I have resolved the import error. On the domain, I will follow the instructions you outlined above. Thanks

@Techmessiah How did you solve the import error?

We have a help page to help you debug import errors: http://help.pythonanywhere.com/pages/DebuggingImportError/

Yes, I saw that page, thank you. In my case I realized my virtual environment had failed to install all dependencies because of disk quota. The staff's suggestion to reinstall the virtual environment helped. Thanks