Forums

Deploy Django

hello, i have uploaded my files on local and configured the wsgi file, i still see it worked page. Where is my wrong?

activate_this = '/home/scangayberi/.virtualenvs/django17/bin/activate_this.py'

execfile(activate_this, dict(__file__=activate_this))

import os

import sys

path = '/home/scangayberi/sozeka/'

if path not in sys.path:

    sys.path.append(path)

sozeka_path = '/home/scangayberi/sozeka/sozeka'

if sozeka_path not in sys.path:

    sys.path.append(sozeka_path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'sozeka.settings'

os.chdir(path)

from django.core.wsgi import get_wsgi_application

application = get_wsgi_application()

import django

django.setup()

from sozeka import sozekaapp as application

[edit by admin: formatting]

Those last three lines probably shouldn't be there -- where did you get them from?

Whats error do you have (read logs from dashboard/web/logfiles)?

Past my wsgi (found):

activate_this = '/home/username/.virtualenvs/myvirtualenv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import os
import sys

# ADD YOUR PROJECT TO THE PYTHONPATH FOR THE PYTHON INSTANCE
path = '/home/username/appname'
if path not in sys.path:
sys.path.append(path)

# IMPORTANTLY GO TO THE PROJECT DIR
os.chdir(path)

# TELL DJANGO WHERE YOUR SETTINGS MODULE IS LOCATED
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'appname.settings')


# IMPORT THE DJANGO SETUP - NEW TO 1.7
import django
django.setup()

# IMPORT THE DJANGO WSGI HANDLER TO TAKE CARE OF REQUESTS

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()