Forums

Problem migrating my app

Hi! i'm doing a django proyect for college and i want to have it up. I prove my app on django own server with my project(python manage.py runserver). I have it in a repository. So i clone it into my space and perfect. Follow the tutorial steps. change path from the empty app to my proyect path. And the tutorial said that with that it will work but nothing unhandle exception...

I try a lots of thinks, move the project to another folder with diferent structure (like a default app django with the wizzard) and nothing too.

Some idea? thank you!

Have you taken a look at the error log? There's a link on the "Web" tab and there will probably be some hints about what the problem is there.

Yes i looked the log and said error to the path of setting but i did what supose to do for fix it and the same error. I proved with virtual env too and nothing either. i give up already 2 days 0 results xDD

Would you mind if I took a look at your files?

Go ahead. it's all yours. For sure i made a stupid mistake but i can found it.

OK, so here's the problem. From your error logs:

2014-04-11 09:25:05,285 :ImportError: Could not import settings 'RecomenBarWeb.settings' (Is it on sys.path?): No module named RecomenBarWeb.settings

Now, if we look at the WSGI file, you have this:

path = '/home/Tzomas/RecomemBar/RecomenBarWeb/'
if path not in sys.path:
    sys.path.append(path)

os.chdir(path)

# TELL DJANGO WHERE YOUR SETTINGS MODULE IS LOCATED
os.environ['DJANGO_SETTINGS_MODULE'] = 'RecomenBarWeb.settings'

This means that Python will look for the Django settings module in /home/Tzomas/RecomemBar/RecomenBarWeb/RecomenBarWeb/settings.py -- note that the RecomenBarWeb is doubled. But your settings file is in /home/Tzomas/RecomemBar/RecomenBarWeb/settings.py, with just one RecomenBarWeb.

So you can fix it by removing the extra RecomenBarWeb from the path you define in your WSGI file.

Just to reassure you -- it's not a stupid mistake at all! You're the second person I've helped with exactly this problem today. It's one of the weird things about Django, and I think we (PythonAnywhere) need to work out some kind of way to help people around it. It's hard to see exactly what we can do, though. Perhaps the "Unhandled Exception" error page should mention it -- though that would be really confusing for people who aren't using Django at all...

TY!! i think i tried both but just one with virtual env xDD ty so so much!!

Excellent! So it's all working OK now?

Perfect!

Awesome :-)