Bitnami Django Stack 500内部服务器错误

时间:2017-02-19 03:05:14

标签: django postgresql apache2

我试图用PostgreSQL安装Bitnami Django Stack,但是在尝试Demo页面时我遇到了一个问题。我一直在尝试修复它并阅读文档,但似乎文档已过时。当我打开Demo页面时,它显示以下错误:

enter image description here

以下是日志中发现的错误:

[Sun Feb 19 11:00:21.679338 2017] [ssl:warn] [pid 2172] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:21.711930 2017] [ssl:warn] [pid 2173] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:21.725126 2017] [mpm_prefork:notice] [pid 2173] AH00163: Apache/2.4.23 (Unix) mod_wsgi/3.5 Python/2.7.12 OpenSSL/1.0.2j configured -- resuming normal operations
[Sun Feb 19 11:00:21.725224 2017] [core:notice] [pid 2173] AH00094: Command line: '/Applications/djangostack-1.10.5-0/apache2/bin/httpd.bin -f /Applications/djangostack-1.10.5-0/apache2/conf/httpd.conf'
[Sun Feb 19 11:00:24.877912 2017] [mpm_prefork:notice] [pid 2173] AH00169: caught SIGTERM, shutting down
[Sun Feb 19 11:00:27.484248 2017] [ssl:warn] [pid 2208] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:27.509850 2017] [ssl:warn] [pid 2209] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:27.519223 2017] [mpm_prefork:notice] [pid 2209] AH00163: Apache/2.4.23 (Unix) mod_wsgi/3.5 Python/2.7.12 OpenSSL/1.0.2j configured -- resuming normal operations
[Sun Feb 19 11:00:27.519303 2017] [core:notice] [pid 2209] AH00094: Command line: '/Applications/djangostack-1.10.5-0/apache2/bin/httpd.bin -f /Applications/djangostack-1.10.5-0/apache2/conf/httpd.conf'
[Sun Feb 19 11:00:29.872885 2017] [mpm_prefork:notice] [pid 2209] AH00169: caught SIGTERM, shutting down
[Sun Feb 19 11:00:48.061052 2017] [ssl:warn] [pid 2267] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:48.085438 2017] [ssl:warn] [pid 2268] AH01909: localhost:8443:0 server certificate does NOT include an ID which matches the server name
[Sun Feb 19 11:00:48.093839 2017] [mpm_prefork:notice] [pid 2268] AH00163: Apache/2.4.23 (Unix) mod_wsgi/3.5 Python/2.7.12 OpenSSL/1.0.2j configured -- resuming normal operations
[Sun Feb 19 11:00:48.093925 2017] [core:notice] [pid 2268] AH00094: Command line: '/Applications/djangostack-1.10.5-0/apache2/bin/httpd.bin -f /Applications/djangostack-1.10.5-0/apache2/conf/httpd.conf'
[Sun Feb 19 03:01:55.806807 2017] [:error] [pid 2270] [remote 127.0.0.1:0] mod_wsgi (pid=2270): Target WSGI script '/Applications/djangostack-1.10.5-0/apps/django/django_projects/Demo/Demo/wsgi.py' cannot be loaded as Python module.
[Sun Feb 19 03:01:55.806894 2017] [:error] [pid 2270] [remote 127.0.0.1:0] mod_wsgi (pid=2270): Exception occurred processing WSGI script '/Applications/djangostack-1.10.5-0/apps/django/django_projects/Demo/Demo/wsgi.py'.
[Sun Feb 19 03:01:55.806928 2017] [:error] [pid 2270] [remote 127.0.0.1:0] Traceback (most recent call last):
[Sun Feb 19 03:01:55.806944 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/django_projects/Demo/Demo/wsgi.py", line 19, in <module>
[Sun Feb 19 03:01:55.807000 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     application = get_wsgi_application()
[Sun Feb 19 03:01:55.807012 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/core/wsgi.py", line 13, in get_wsgi_application
[Sun Feb 19 03:01:55.807051 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     django.setup(set_prefix=False)
[Sun Feb 19 03:01:55.807062 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/__init__.py", line 27, in setup
[Sun Feb 19 03:01:55.807097 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     apps.populate(settings.INSTALLED_APPS)
[Sun Feb 19 03:01:55.807107 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/apps/registry.py", line 108, in populate
[Sun Feb 19 03:01:55.807196 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     app_config.import_models(all_models)
[Sun Feb 19 03:01:55.807216 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/apps/config.py", line 199, in import_models
[Sun Feb 19 03:01:55.807277 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     self.models_module = import_module(models_module_name)
[Sun Feb 19 03:01:55.807287 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Feb 19 03:01:55.807324 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     __import__(name)
[Sun Feb 19 03:01:55.807333 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/contrib/auth/models.py", line 4, in <module>
[Sun Feb 19 03:01:55.807428 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
[Sun Feb 19 03:01:55.807439 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/contrib/auth/base_user.py", line 52, in <module>
[Sun Feb 19 03:01:55.807488 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     class AbstractBaseUser(models.Model):
[Sun Feb 19 03:01:55.807498 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/models/base.py", line 119, in __new__
[Sun Feb 19 03:01:55.807750 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     new_class.add_to_class('_meta', Options(meta, app_label))
[Sun Feb 19 03:01:55.807761 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/models/base.py", line 316, in add_to_class
[Sun Feb 19 03:01:55.807778 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     value.contribute_to_class(cls, name)
[Sun Feb 19 03:01:55.807786 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/models/options.py", line 214, in contribute_to_class
[Sun Feb 19 03:01:55.807922 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Sun Feb 19 03:01:55.807932 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/__init__.py", line 33, in __getattr__
[Sun Feb 19 03:01:55.807971 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     return getattr(connections[DEFAULT_DB_ALIAS], item)
[Sun Feb 19 03:01:55.807980 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/utils.py", line 211, in __getitem__
[Sun Feb 19 03:01:55.808046 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     backend = load_backend(db['ENGINE'])
[Sun Feb 19 03:01:55.808056 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/utils.py", line 115, in load_backend
[Sun Feb 19 03:01:55.808071 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     return import_module('%s.base' % backend_name)
[Sun Feb 19 03:01:55.808078 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Feb 19 03:01:55.808091 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     __import__(name)
[Sun Feb 19 03:01:55.808098 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   File "/Applications/djangostack-1.10.5-0/apps/django/lib/python2.7/site-packages/Django-1.10.5-py2.7.egg/django/db/backends/postgresql/base.py", line 24, in <module>
[Sun Feb 19 03:01:55.808171 2017] [:error] [pid 2270] [remote 127.0.0.1:0]     raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
[Sun Feb 19 03:01:55.808189 2017] [:error] [pid 2270] [remote 127.0.0.1:0] ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Applications/djangostack-1.10.5-0/python/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /bitnami/djangostack-osx-x64/output/postgresql/lib/libpq.5.dylib
[Sun Feb 19 03:01:55.808194 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   Referenced from: /Applications/djangostack-1.10.5-0/python/lib/python2.7/site-packages/psycopg2/_psycopg.so
[Sun Feb 19 03:01:55.808198 2017] [:error] [pid 2270] [remote 127.0.0.1:0]   Reason: image not found

1 个答案:

答案 0 :(得分:1)

安装后需要运行python manage.py runserver。您还需要做一些其他安装后的事情。您可以从第3步开始。https://docs.bitnami.com/installer/infrastructure/django/