~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlwebsite_wsgi.py

  • Committer: franku
  • Author(s): GunChleoc
  • Date: 2016-12-13 18:30:38 UTC
  • mfrom: (438.1.6 pyformat_util)
  • Revision ID: somal@arcor.de-20161213183038-5cgmvfh2fkgmoc1s
adding a script to run pyformat over the code base

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
current_dir = code_directory
9
9
activate_this = None
10
 
while current_dir != "/":
11
 
   current_dir = parent_dir(current_dir)
12
 
   if os.path.exists(os.path.join(current_dir, "bin", "activate_this.py")):
13
 
      activate_this = os.path.join(current_dir, "bin", "activate_this.py")
14
 
      break
 
10
while current_dir != '/':
 
11
    current_dir = parent_dir(current_dir)
 
12
    if os.path.exists(os.path.join(current_dir, 'bin', 'activate_this.py')):
 
13
        activate_this = os.path.join(current_dir, 'bin', 'activate_this.py')
 
14
        break
15
15
 
16
16
if activate_this is None:
17
 
   raise RuntimeException("Could not find virtualenv to start up!")
 
17
    raise RuntimeException('Could not find virtualenv to start up!')
18
18
 
19
19
execfile(activate_this, dict(__file__=activate_this))
20
20
 
21
21
sys.path.append(parent_dir(code_directory))
22
22
sys.path.append(code_directory)
23
 
sys.path.append(os.path.join(code_directory, "widelands"))
 
23
sys.path.append(os.path.join(code_directory, 'widelands'))
24
24
 
25
25
os.environ['DJANGO_SETTINGS_MODULE'] = 'widelands.settings'
26
26
 
29
29
 
30
30
from django.core.wsgi import get_wsgi_application
31
31
application = get_wsgi_application()
32