django openshift import error -
i'm having problem moving django project openshift. have cloned openshift app. copied django project openshift app in /wsgi/digrin/ django project:digrin django apps: registration, digrin, stocks.
wsgi ├── digrin │ ├── digrin (settings.py here) │ ├── registration │ └── stocks ├── openshift (settings.py here) └── static
when run "rhc tail -a digrin" following error:
==> python/logs/error_log-20130718-000000-est <== [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] self.load_middleware() [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/utils/functional.py", line 184, in inner [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] self._setup() [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 42, in _setup [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] self._wrapped = settings(settings_module) [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 95, in __init__ [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [thu jul 18 16:15:39 2013] [error] [client 127.5.108.1] importerror: not import settings 'digrin.settings' (is on sys.path?): no module named settings ==> python/logs/error_log-20130731-000000-est <== [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] self.load_middleware() [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/utils/functional.py", line 184, in inner [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] self._setup() [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 42, in _setup [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] self._wrapped = settings(settings_module) [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 95, in __init__ [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [wed jul 31 07:21:39 2013] [error] [client 127.5.108.1] importerror: not import settings 'digrin.settings' (is on sys.path?): no module named openshiftlibs ==> python/logs/access_log-20130626-000000-est <== 95.102.217.225 - - [26/jun/2013:14:31:00 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:14:31:04 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:14:50:55 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:15:43:53 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:15:49:13 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:15:49:30 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:15:49:38 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:15:56:42 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:16:37:45 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.217.225 - - [26/jun/2013:17:28:05 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:21.0) gecko/20100101 firefox/21.0" ==> python/logs/access_log-20130627-000000-est <== 95.102.203.230 - - [27/jun/2013:05:49:32 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (windows nt 6.1; wow64; rv:21.0) gecko/20100101 firefox/21.0" 95.102.203.230 - - [27/jun/2013:05:49:34 -0400] "get /favicon.ico http/1.1" 500 627 "-" "mozilla/5.0 (windows nt 6.1; wow64; rv:21.0) gecko/20100101 firefox/21.0" ==> python/logs/error_log-20130627-000000-est <== [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] self.load_middleware() [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/utils/functional.py", line 184, in inner [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] self._setup() [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 42, in _setup [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] self._wrapped = settings(settings_module) [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 95, in __init__ [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [thu jun 27 05:49:34 2013] [error] [client 127.5.108.1] importerror: not import settings 'digrin.settings' (is on sys.path?): no module named settings ==> python/logs/access_log-20130719-000000-est <== 95.102.233.230 - - [19/jul/2013:12:55:59 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:20 -0400] "get / http/1.1" 200 62 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:28 -0400] "get /admin http/1.1" 301 - "http://digrin-lucas03.rhcloud.com/" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:28 -0400] "get /admin/ http/1.1" 200 1896 "http://digrin-lucas03.rhcloud.com/" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:30 -0400] "get /static/admin/css/base.css http/1.1" 404 316 "http://digrin-lucas03.rhcloud.com/admin/" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:30 -0400] "get /static/admin/css/login.css http/1.1" 404 317 "http://digrin-lucas03.rhcloud.com/admin/" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:35 -0400] "get / http/1.1" 200 62 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:12:56:52 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [19/jul/2013:13:02:02 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 10.90.135.25 - - [19/jul/2013:18:09:12 -0400] "get / http/1.1" 500 627 "-" "ruby" ==> python/logs/error_log-20130717-000000-est <== [wed jul 17 07:06:17 2013] [notice] selinux policy enabled; httpd running context unconfined_u:system_r:openshift_t:s0:c2,c733 [wed jul 17 07:06:17 2013] [notice] digest: generating secret digest authentication ... [wed jul 17 07:06:17 2013] [notice] digest: done [wed jul 17 07:06:18 2013] [notice] apache/2.2.15 (unix) mod_wsgi/3.2 python/2.6.6 configured -- resuming normal operations ==> python/logs/error_log-20130626-000000-est <== [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] self.load_middleware() [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/utils/functional.py", line 184, in inner [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] self._setup() [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 42, in _setup [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] self._wrapped = settings(settings_module) [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 95, in __init__ [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [wed jun 26 17:28:05 2013] [error] [client 127.5.108.1] importerror: not import settings 'digrin.settings' (is on sys.path?): no module named settings ==> python/logs/access_log-20130731-000000-est <== 188.167.64.82 - - [31/jul/2013:07:03:35 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:05:35 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:05:40 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:05:40 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:05:41 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:05:49 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:06:15 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 188.167.64.82 - - [31/jul/2013:07:06:27 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 127.0.0.1 - - [31/jul/2013:07:20:44 -0400] "head / http/1.1" 500 - "-" "ruby" 188.167.64.82 - - [31/jul/2013:07:21:39 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" ==> python/logs/error_log-20130719-000000-est <== [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] self.load_middleware() [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/core/handlers/base.py", line 39, in load_middleware [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] middleware_path in settings.middleware_classes: [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/utils/functional.py", line 184, in inner [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] self._setup() [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 42, in _setup [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] self._wrapped = settings(settings_module) [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] file "/var/lib/openshift/51cb0e515004460d6f000131/python/virtenv/lib/python2.6/site-packages/django-1.4-py2.6.egg/django/conf/__init__.py", line 95, in __init__ [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [fri jul 19 18:09:15 2013] [error] [client 127.5.108.1] importerror: not import settings 'digrin.settings' (is on sys.path?): no module named openshiftlibs ==> python/logs/access_log-20130718-000000-est <== 95.102.233.230 - - [18/jul/2013:16:14:17 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [18/jul/2013:16:14:18 -0400] "get /favicon.ico http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [18/jul/2013:16:14:20 -0400] "get /favicon.ico http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" 95.102.233.230 - - [18/jul/2013:16:15:39 -0400] "get / http/1.1" 500 627 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:22.0) gecko/20100101 firefox/22.0" ==> postgresql/log/postgresql-sat.log <== ==> postgresql/log/postgresql-fri.log <== log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: disabling statistics collector lack of working socket warning: autovacuum not started because of misconfiguration hint: enable "track_counts" option. log: database system shut down @ 2013-07-19 11:01:07 edt fatal: database system starting log: database system ready accept connections ==> postgresql/log/postgresql-sun.log <== log: received smart shutdown request log: shutting down log: database system shut down ==> postgresql/log/postgresql-thu.log <== log: not bind socket statistics collector: permission denied log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: disabling statistics collector lack of working socket warning: autovacuum not started because of misconfiguration hint: enable "track_counts" option. log: database system shut down @ 2013-07-17 12:06:26 edt log: database system ready accept connections ==> postgresql/log/postgresql-wed.log <== log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: trying address statistics collector log: not bind socket statistics collector: cannot assign requested address log: disabling statistics collector lack of working socket warning: autovacuum not started because of misconfiguration hint: enable "track_counts" option. fatal: database system starting log: database system shut down @ 2013-07-21 18:03:08 edt log: database system ready accept connections
this app wsgi/application
#!/usr/bin/env python import os import sys os.environ['django_settings_module'] = 'digrin.settings' sys.path.append(os.path.join(os.environ['openshift_repo_dir'], 'wsgi', 'digrin')) virtenv = os.environ['appdir'] + '/virtenv/' os.environ['python_egg_cache'] = os.path.join(virtenv, 'lib/python2.6/site-packages') virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except: pass import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler()
i 500 internal server error
read blog post http://appsembler.com/blog/django-deployment-using-openshift/
it has best explanation of bringing django application on openshift
Comments
Post a Comment