Forums

django hosting for my existing project

hi i am akhil. i uploaded my project.This project contains multiple apps.so i am not getting which WSGI.py file i have to configure.

Should i configure this file "/var/www/akhil_pythonanywhere_com_wsgi.py" or should i configure this file "/ > home > akhil > SMMs > SMMs > wsgi.py"

Right now, i am getting this error "Unhandled Exception" and i created virtual environment for django 1.5.2

please where i am wrong.how to set path for wsgi.py

The file you need to configure is /var/www/akhil_pythonanywhere_com_wsgi.py -- PythonAnywhere doesn't know anything about the other one.

I took a look at our server logs, and I think the problem you're seeing is because your database settings are wrong. If you go to the "Web" tab and take a look at the error log for your site, you'll see the problem at the end of the file.

Hi Sir i am getting this error "OperationalError at /admin/ (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")"

Please Provide Solution and So tell me how to set path for static and template

So what that's saying is that it's trying to connect to MySQL on the local machine. What you need to do is update your settings.py so that the database settings are the ones from the "Databases" tab. Specifically, you'll need to change the HOST to the value from that tab.

Once you've done that, reload the web app, and it should work.

Thanks for ur time

my database issue is solved,but i am able to see templates and images.

i think it is issue path setting for Template and Static files

Please help me for this

TEMPLATE_DIRS = (r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\theme\templates', r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\SMMs\templates', r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\metrons\templates', r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\django_forms_bootstraps\templates\bootstrap', )

STATIC_URL = '/static/'

Additional locations of static files

STATICFILES_DIRS = (r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\theme\static', r'C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\SMMs\static' # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. )

Those directories are all in Windows format. You'll need to configure them to point to the location where you've stored the files on PythonAnywhere, which uses Unix paths. So, for example, C:\Users\om\Documents\Aptana Studio 3 Workspace\SMMs\theme\static will become something like /home/akhil/SMMs/theme/static

Sorry i am very new to python ,i am asking again where i wanna to put path in '/home/akhil/SMMs/SMMs/theme/static' in setting.py or https://www.pythonanywhere.com/user/akhil/webapps/ you provide "Static files" here i want to put path

or can you check out from ur side, what i did wrong

@akhil - static files are set up on the Web tab. you set up a mapping between the URL you want (eg /static/) and the path to the files in your account (eg /home/my-username/my-project/static_folder/)

i did this. but no change. Can you check out from your site

Yes, it looks like it's working, here is a file from your first static file mapping : http://akhil.pythonanywhere.com/static/admin/css/base.css

It looks like you're adding Django templates as static files though? templates aren't served as static files, they need to be rendered by a view. Maybe take a look at the Django tutorial? It explains things pretty well... https://docs.djangoproject.com/en/1.3/intro/tutorial03/

this is my first app

then start localhost:8000 i get login page but here i am unable to see login page getting test html page

one more think i want to tell you. admin part working fine but i did some changes Users app.it won't reflect in that i think setting.py is not set properly

You can't run the django dev server (localhost:8000) on pythoanywhere. I think the best thing for you to do would be to go through our own tutorial, which is here:

https://www.pythonanywhere.com/wiki/DjangoTutorial

That will take you through the basics of setting up a Django app on PythonAnywhere.

You'll have to delete your existing web app, but don't worry, it won't delete your actual code. When you've finished our tutorial, you'll be able to come back and use "manual configuration" to get back to your project.

Please, I just got an error when deploying my project on your platform..error in wsgi setting

What error?

After I git clone my project from github ,the name of the project on github is different from the name project name... So inside the WSGi file...after have done the configuration and successfully deploy my project..

I wanted to test my project but it's gave an error..complaining that the name of my project module not found.

See this help page about debugging import errors.