I tried to deplpoy django project to work with apache and mod_wsgi but get this error:
ImportError: DLL load failed: %1 n\x92est pas une application Win32 valide
this is my wsgi.py file
import os, sys
sys.path.append('C:/Users/abda/applica/projet/')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projet.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
this is the code in httpd.conf file
WSGIScriptAlias /t C:/Users/abda/applica/test.py
WSGIScriptAlias / C:/Users/abda/applica/projet/projet/wsgi.py
Alias /media/ C:/Users/abda/applica/projet/www/media/
Alias /static/ C:/Users/abda/applica/projet/www/static/
<Directory /abda/applica/projet/projet>
<Files wsgi.py>
Require all granted
</Files>
</Directory>`
this the log error returned
[Mon May 12 15:00:17.476950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] mod_wsgi (pid=13888): Target WSGI script 'C:/Users/abda/applica/projet/projet/wsgi.py' cannot be loaded as Python module.
[Mon May 12 15:00:17.476950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] mod_wsgi (pid=13888): Exception occurred processing WSGI script 'C:/Users/abda/applica/projet/projet/wsgi.py'.
[Mon May 12 15:00:17.476950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] Traceback (most recent call last):
[Mon May 12 15:00:17.476950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:/Users/abda/applica/projet/projet/wsgi.py", line 11, in <module>
[Mon May 12 15:00:17.477950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from django.core.wsgi import get_wsgi_application
[Mon May 12 15:00:17.477950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\lib\\site-packages\\django\\core\\wsgi.py", line 1, in <module>
[Mon May 12 15:00:17.477950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from django.core.handlers.wsgi import WSGIHandler
[Mon May 12 15:00:17.477950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 9, in <module>
[Mon May 12 15:00:17.478950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from django import http
[Mon May 12 15:00:17.478950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\lib\\site-packages\\django\\http\\__init__.py", line 1, in <module>
[Mon May 12 15:00:17.478950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from django.http.cookie import SimpleCookie, parse_cookie
[Mon May 12 15:00:17.478950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\lib\\site-packages\\django\\http\\cookie.py", line 3, in <module>
[Mon May 12 15:00:17.479950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from django.utils.encoding import force_str
[Mon May 12 15:00:17.479950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\lib\\site-packages\\django\\utils\\encoding.py", line 10, in <module>
[Mon May 12 15:00:17.480950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] from urllib import quote
[Mon May 12 15:00:17.480950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\Lib\\urllib.py", line 26, in <module>
[Mon May 12 15:00:17.481950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] import socket
[Mon May 12 15:00:17.482950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] File "C:\\Python27\\Lib\\socket.py", line 47, in <module>
[Mon May 12 15:00:17.482950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] import _socket
[Mon May 12 15:00:17.482950 2014] [:error] [pid 13888:tid 768] [client 127.0.0.1:60886] ImportError: DLL load failed: %1 n\x92est pas une application Win32 valide.
I use django1.5 and apache2.4
Is your Apache HTTP server compiled for 32 bit or 64 bit processor? It looks like a DLL is looking for a 32-bit version of Windows.
solved
All apache/ wsgi_mod.so and python need to be 64 bit or 32 bit http://modwsgi.readthedocs.org/en/latest/installation-guides/installation-on-windows.html
Can you try using the 32-bit Apache Http Server? XAMPP has one that might make it easier to test.
Related
I'm using Ubuntu 14.04.
I create a django project under /opt/cashpro/python_app/cashsite/trunk/cash
and create a wsgi file cash.wsgi in the same directory
Here is the content of cash.wsgi
import os
import sys
path = '/opt/cashpro/python_app/cashsite/trunk/'
sys.path.insert(0, path)
from cash import settings
import django.core.management
sys.path.insert(1, '/opt/cashpro/python_app/cashsite/trunk/cash/')
django.core.management.setup_environ(settings)
utility = django.core.management.ManagementUtility()
command = utility.fetch_command('runserver')
command.validate()
import django.conf
import django.utils
django.utils.translation.activate(django.conf.settings.LANGUAGE_CODE)
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
and here is what I add to my httpd.conf:
<VirtualHost *:443>
ServerName www.abcd.org
DocumentRoot /var/www/test
SSLEngine on
SSLCipherSuite HIGH:+MEDIUM:!SSLv2:!EXP:!ADH:!aNULL:!eNULL:!NULL
SSLCertificateFile "/opt/certs/www.abcd.org.crt"
SSLCertificateKeyFile "/opt/ssl/www.abcd.key"
SSLCertificateChainFile "/opt/certs/DigiCertCA.crt"
#SSLCertificateChainFile "/opt/ssl/IntermediatesCA3.crt"
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
Alias /media-cash/ /opt/cashpro/cashfiles
<Directory /opt/cashpro/cashfiles>
Options MultiViews
AllowOverride None
Require all granted
</Directory>
WSGIPassAuthorization On
WSGIScriptAlias /site
/opt/cashpro/python_app/cashsite/trunk/cash/cash.wsgi
ErrorLog /var/log/apache2/serror.log
CustomLog /var/log/apache2/saccess.log common
</VirtualHost>
The problem is, when I visit https://www.abcd.org/site, it says
Forbidden
You don't have permission to access / on this server.
Apache Error log
[Thu Jul 20 22:24:56.263573 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] mod_wsgi (pid=4448): Target WSGI script
'/opt/cashpro/python_app/cashsite/trunk/cash/cash.wsgi' cannot be loaded as
Python module., referer: https://www.abcd.org
[Thu Jul 20 22:24:56.263816 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] mod_wsgi (pid=4448): Exception occurred
processing WSGI script
'/opt/cashpro/python_app/cashsite/trunk/cash/cash.wsgi'., referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.263978 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] Traceback (most recent call last):, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264085 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File
"/opt/cashpro/python_app/cashsite/trunk/cash/cash.wsgi", line 11, in
<module>, referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264223 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] command =
utility.fetch_command('runserver'), referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264261 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 261, in fetch_command,
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264325 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] klass = load_command_class(app_name,
subcommand), referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264360 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 69, in
load_command_class, referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264410 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] module =
import_module('%s.management.commands.%s' % (app_name, name)), referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264452 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/utils/importlib.py", line 35, in import_module, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264495 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] __import__(name), referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264524 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/core/management/commands/runserver.py", line 8, in <module>,
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264570 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] from django.core.servers.basehttp import
AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application,
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264599 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/core/servers/basehttp.py", line 26, in <module>, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264637 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] from django.views import static, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264665 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/views/static.py", line 95, in <module>, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264700 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] template_translatable =
ugettext_noop(u"Index of %(directory)s"), referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264727 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/utils/translation/__init__.py", line 75, in gettext_noop,
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264780 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] return _trans.gettext_noop(message),
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264821 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/utils/translation/__init__.py", line 48, in __getattr__,
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.264852 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] if settings.USE_I18N:, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264879 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/utils/functional.py", line 184, in inner, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264912 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] self._setup(), referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264938 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/conf/__init__.py", line 42, in _setup, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.264987 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] self._wrapped = Settings(settings_module),
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.265015 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/local/lib/python2.7/dist-
packages/django/conf/__init__.py", line 135, in __init__, referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.265044 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] logging_config_func(self.LOGGING),
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.265071 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/lib/python2.7/logging/config.py",
line 794, in dictConfig, referer: https://www.abcd.org
[Thu Jul 20 22:24:56.265116 2017] [:error] [pid 4448:tid 140570219427584] [
client xxx.xxx.xxx.xxx:3340] dictConfigClass(config).configure(),
referer: https://www.abcd.org
[Thu Jul 20 22:24:56.265151 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] File "/usr/lib/python2.7/logging/config.py",
line 576, in configure, referer: https://www.abcd.org
[Thu Jul 20 22:24:56.265201 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] '%r: %s' % (name, e)), referer:
https://www.abcd.org
[Thu Jul 20 22:24:56.265284 2017] [:error] [pid 4448:tid 140570219427584]
[client xxx.xxx.xxx.xxx:3340] ValueError: Unable to configure handler
'default': [Errno 13] Permission denied: '/opt/cash_site.log', referer:
https://www.abcd.org
Another python web app host the same server.But getting error
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName www.xyz.com
ServerAlias xyz.com
DocumentRoot /opt/nadasnapp/html
<Directory /opt/nadasnapp/html/>
Require all granted
AllowOverride All
</Directory>
LogLevel warn
##FOR NADA
Alias /media/ /opt/nadasnapp/python_app/NaDaWebPro/media/
<Directory /opt/nadasnapp/python_app/NaDaWebPro/media/>
Require all granted
AllowOverride All
</Directory>
Alias /static/ /opt/nadasnapp/python_app/NaDaWebPro/static_root/
<Directory /opt/nadasnapp/python_app/NaDaWebPro/static_root/>
Require all granted
AllowOverride All
</Directory>
#FOR NADA
WSGIPassAuthorization On
WSGIScriptAlias / /opt/nadasnapp/python_app/NaDaWebPro/nada/wsgi.py
<Directory /opt/nadasnapp/python_app/NaDaWebPro/nada>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
The error is
[Sun Jul 23 04:23:14.151745 2017] [:error] [pid 4594:tid
139820915422976]
[client xxx.xxx.xxx.xxx:2244] mod_wsgi (pid=4594): Exception occurred
processing WSGI script
'/opt/nadasnapp/python_app/NaDaWebPro/nada/wsgi.py'.
[Sun Jul 23 04:23:14.151993 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] Traceback (most recent call last):
[Sun Jul 23 04:23:14.152065 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] File "/usr/local/lib/python2.7/dist-
packages/django/core/handlers/wsgi.py", line 219, in __call__
[Sun Jul 23 04:23:14.152135 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] self.load_middleware()
[Sun Jul 23 04:23:14.152166 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] File "/usr/local/lib/python2.7/dist-
packages/django/core/handlers/base.py", line 39, in load_middleware
[Sun Jul 23 04:23:14.152203 2017] [:error] [pid 4594:tid 1
39820915422976]
[client xxx.xxx.xxx.xxx:2244] for middleware_path in
settings.MIDDLEWARE_CLASSES:
[Sun Jul 23 04:23:14.152234 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] File "/usr/local/lib/python2.7/dist-
packages/django/utils/functional.py", line 184, in inner
[Sun Jul 23 04:23:14.152319 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] self._setup()
[Sun Jul 23 04:23:14.152357 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] File "/usr/local/lib/python2.7/dist-
packages/django/conf/__init__.py", line 42, in _setup
[Sun Jul 23 04:23:14.152402 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] self._wrapped =
Settings(settings_module)
[Sun Jul 23 04:23:14.152445 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] File "/usr/local/lib/python2.7/dist-
packages/django/conf/__init__.py", line 95, in __init__
[Sun Jul 23 04:23:14.152484 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] raise ImportError("Could not import
settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
[Sun Jul 23 04:23:14.152540 2017] [:error] [pid 4594:tid 139820915422976]
[client xxx.xxx.xxx.xxx:2244] ImportError: Could not import settings
'cash.settings' (Is it on sys.path?): No module named cash.settings
The directory you gave as argument to the Directory directive was /opt/cashpro/cashfiles, it should be /opt/cashpro/python_app/cashsite/trunk/cash/. That is, where the WSGI script file is located.
I could really use some help here. I am in the process of setting up a test deployment of wagtail on a CentOS7 box and it seems as though the wsgi daemon is not getting access to the necessary python modules. I have checked permissions on all of the directories in the virtual environment and made sure that the owner was apache as well as the group owner was apache (recursively). SELinux is also in permissive mode while I'm trying to figure this out. It's a fresh install of wagtail, no modifications have been made after running the start command from wagtail.
My virtual host config file is as follows:
<VirtualHost *:80>
ServerName <server.name>
ServerAdmin <server.admin>
Alias /static /var/www/<virtual.env>/<project.name>/static
<Directory /var/www/<virtual.env>/<project.name>/static>
Require all granted
</Directory>
<Directory /var/www/<virtual.env>/<project.name>/wsgi.py>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess <project> python-path=/var/www/<virtual.env>/<project.name>/<project.name>:/var/www/<virtual.env/lib/python3.4/site-packages
WSGIProcessGroup <project>
WSGIScriptAlias / /var/www/<project.env>/<project.name>/<project.name>/wsgi.py
ErrorLog /var/log/httpd/<project.name>_error.log
CustomLog /var/log/httpd/<project.name>_access.log combined
My project_error.log file contains the following:
[Thu May 04 18:50:35.596691 2017] [:error] [pid 13101] [remote 10.30.112.49:52] mod_wsgi (pid=13101): Exception occurred processing WSGI script '/var/www/<project.name>_env/<project.name>/<project.name>/wsgi.py'.
[Thu May 04 18:50:35.596712 2017] [:error] [pid 13101] [remote 10.30.112.49:52] Traceback (most recent call last):
[Thu May 04 18:50:35.596733 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/<project.name>/<project.name>/wsgi.py", line 18, in <module>
[Thu May 04 18:50:35.596785 2017] [:error] [pid 13101] [remote 10.30.112.49:52] application = get_wsgi_application()
[Thu May 04 18:50:35.596797 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu May 04 18:50:35.596836 2017] [:error] [pid 13101] [remote 10.30.112.49:52] django.setup(set_prefix=False)
[Thu May 04 18:50:35.596846 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/django/__init__.py", line 27, in setup
[Thu May 04 18:50:35.596887 2017] [:error] [pid 13101] [remote 10.30.112.49:52] apps.populate(settings.INSTALLED_APPS)
[Thu May 04 18:50:35.596898 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
[Thu May 04 18:50:35.597029 2017] [:error] [pid 13101] [remote 10.30.112.49:52] app_config.import_models(all_models)
[Thu May 04 18:50:35.597039 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/django/apps/config.py", line 199, in import_models
[Thu May 04 18:50:35.597118 2017] [:error] [pid 13101] [remote 10.30.112.49:52] self.models_module = import_module(models_module_name)
[Thu May 04 18:50:35.597131 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Thu May 04 18:50:35.597177 2017] [:error] [pid 13101] [remote 10.30.112.49:52] __import__(name)
[Thu May 04 18:50:35.597187 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/wagtail/wagtailforms/models.py", line 16, in <module>
[Thu May 04 18:50:35.597283 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from wagtail.wagtailadmin.edit_handlers import FieldPanel
[Thu May 04 18:50:35.597292 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 19, in <module>
[Thu May 04 18:50:35.597493 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from wagtail.wagtailadmin import compare, widgets
[Thu May 04 18:50:35.597503 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/wagtail/wagtailadmin/compare.py", line 5, in <module>
[Thu May 04 18:50:35.597660 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from bs4 import BeautifulSoup
[Thu May 04 18:50:35.597673 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/bs4/__init__.py", line 35, in <module>
[Thu May 04 18:50:35.597822 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from .builder import builder_registry, ParserRejectedMarkup
[Thu May 04 18:50:35.597832 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/bs4/builder/__init__.py", line 7, in <module>
[Thu May 04 18:50:35.597933 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from bs4.element import (
[Thu May 04 18:50:35.597943 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/bs4/element.py", line 10, in <module>
[Thu May 04 18:50:35.598337 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from bs4.dammit import EntitySubstitution
[Thu May 04 18:50:35.598347 2017] [:error] [pid 13101] [remote 10.30.112.49:52] File "/var/www/<project.name>_env/lib/python3.4/site-packages/bs4/dammit.py", line 14, in <module>
[Thu May 04 18:50:35.598548 2017] [:error] [pid 13101] [remote 10.30.112.49:52] from html.entities import codepoint2name
[Thu May 04 18:50:35.598565 2017] [:error] [pid 13101] [remote 10.30.112.49:52] ImportError: No module named html.entities
Huge thanks in advance.
Two things I noticed. <Directory /var/www/<virtual.env>/<project.name>/wsgi.py> should point to the directory <Directory /var/www/<virtual.env>/<project.name>/, not the file itself. Also, mod_wsgi needs to be compiled against the same version of Python you developed against, as #gasman mentioned.
If you want to upgrade to Python 3.5 and install mod_wsgi from the IUS repository:
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
sudo yum install python35u python35u-pip python35u-devel python35u-mod_wsgi
Good luck!
I've pushed my Flask app to ElasticBeanstalk but am getting 500 errors on every page and Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module. showing up in /var/log/httpd/error_log.
Here's the full stacktrace in /var/log/httpd/error_log:
[Wed Mar 18 22:02:36.815358 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] mod_wsgi (pid=21701): Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.
[Wed Mar 18 22:02:36.815389 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] mod_wsgi (pid=21701): Exception occurred processing WSGI script '/opt/python/current/app/application.py'.
[Wed Mar 18 22:02:36.815410 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] Traceback (most recent call last):
[Wed Mar 18 22:02:36.815435 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] File "/opt/python/current/app/application.py", line 5, in <module>
[Wed Mar 18 22:02:36.815466 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] from charts import *
[Wed Mar 18 22:02:36.815478 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] File "/opt/python/current/app/charts.py", line 6, in <module>
[Wed Mar 18 22:02:36.815494 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] from scipy.stats import linregress
[Wed Mar 18 22:02:36.815514 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] ImportError: No module named scipy.stats
Here's what the first portion of my application.py looks like:
from flask import Flask, jsonify, request
import os
import logging
from logging import StreamHandler
from charts import *
application = app = Flask(__name__)
I'm assigning my flask app to the application object, which is all the docs say I need to do. Any clue what I'm doing wrong?
Thanks!
I am trying to set up Apache and Django. I have the file django.wsgi at project root with the following content
import os
import sys
# activate virtualenv
activate_this = os.path.expanduser(
"/var/www/continue/env-continue/bin/activate_this.py"
)
execfile(activate_this, dict(__file__=activate_this))
PROJECT_DIR = '/var/www/continue/'
APP_PATH = os.path.join(PROJECT_DIR, 'app',).replace('\\', '/'),
sys.path.append(APP_PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' # also tried 'continue.settings', but same errors appears
# import django.core.handlers.wsgi
# application = django.core.handlers.wsgi.WSGIHandler()
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
But I am getting the following error Target WSGI script '/var/www/continue/django.wsgi' cannot be loaded as Python module in the log file
[Wed Feb 18 14:28:28.273972 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] mod_wsgi (pid=28781): Target WSGI script '/var/www/continue/django.wsgi' cannot be loaded as Python module.
[Wed Feb 18 14:28:28.274014 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] mod_wsgi (pid=28781): Exception occurred processing WSGI script '/var/www/continue/django.wsgi'.
[Wed Feb 18 14:28:28.274038 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] Traceback (most recent call last):
[Wed Feb 18 14:28:28.274060 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/django.wsgi", line 18, in
[Wed Feb 18 14:28:28.274137 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.core.wsgi import get_wsgi_application
[Wed Feb 18 14:28:28.274152 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/core/wsgi.py", line 2, in
[Wed Feb 18 14:28:28.274174 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.core.handlers.wsgi import WSGIHandler
[Wed Feb 18 14:28:28.274186 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 11, in
[Wed Feb 18 14:28:28.274211 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django import http
[Wed Feb 18 14:28:28.274229 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/http/init.py", line 4, in
[Wed Feb 18 14:28:28.274253 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.http.response import (HttpResponse, StreamingHttpResponse,
[Wed Feb 18 14:28:28.274279 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/http/response.py", line 13, in
[Wed Feb 18 14:28:28.274298 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.core.serializers.json import DjangoJSONEncoder
[Wed Feb 18 14:28:28.274310 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/core/serializers/init.py", line 23, in
[Wed Feb 18 14:28:28.274328 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.core.serializers.base import SerializerDoesNotExist
[Wed Feb 18 14:28:28.274340 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/core/serializers/base.py", line 6, in
[Wed Feb 18 14:28:28.274357 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.db import models
[Wed Feb 18 14:28:28.274368 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/db/models/init.py", line 6, in
[Wed Feb 18 14:28:28.274387 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.db.models.query import Q, QuerySet, Prefetch # NOQA
[Wed Feb 18 14:28:28.274404 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/db/models/query.py", line 13, in
[Wed Feb 18 14:28:28.274435 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.db.models.fields import AutoField, Empty
[Wed Feb 18 14:28:28.274454 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/db/models/fields/init.py", line 15, in
[Wed Feb 18 14:28:28.274489 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.db.models.lookups import default_lookups, RegisterLookupMixin
[Wed Feb 18 14:28:28.274505 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/db/models/lookups.py", line 6, in
[Wed Feb 18 14:28:28.274525 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from django.utils import timezone
[Wed Feb 18 14:28:28.274536 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/django/utils/timezone.py", line 13, in
[Wed Feb 18 14:28:28.274554 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] import pytz
[Wed Feb 18 14:28:28.274565 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pytz/init.py", line 29, in
[Wed Feb 18 14:28:28.274583 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] from pkg_resources import resource_stream
[Wed Feb 18 14:28:28.274594 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pkg_resources.py", line 2829, in
[Wed Feb 18 14:28:28.274612 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] working_set = WorkingSet._build_master()
[Wed Feb 18 14:28:28.274622 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pkg_resources.py", line 440, in _build_master
[Wed Feb 18 14:28:28.274639 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] ws = cls()
[Wed Feb 18 14:28:28.274656 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pkg_resources.py", line 433, in init
[Wed Feb 18 14:28:28.274674 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] self.add_entry(entry)
[Wed Feb 18 14:28:28.274685 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pkg_resources.py", line 489, in add_entry
[Wed Feb 18 14:28:28.274701 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] for dist in find_distributions(entry, True):
[Wed Feb 18 14:28:28.274712 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/var/www/continue/env-continue/lib/python2.7/site-packages/pkg_resources.py", line 1817, in find_distributions
[Wed Feb 18 14:28:28.274728 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] importer = get_importer(path_item)
[Wed Feb 18 14:28:28.274739 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] File "/usr/lib/python2.7/pkgutil.py", line 384, in get_importer
[Wed Feb 18 14:28:28.274756 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] importer = path_hook(path_item)
[Wed Feb 18 14:28:28.274775 2015] [:error] [pid 28781:tid 140719897437952] [client 180.76.4.231:59036] TypeError: must be string, not tuple
I wonder what is going wrong?
I'm trying to configure the WSGI in Apache to work with Django but it's not working, when I go to domain.com it gives me an error 500.
But If I start Django using:
python manage.py runserver domain.com:8000
When I go to domain.com:8000 works perfectly so I think It's something about apache and WSGI.
Here you have my WSGI script:
import os
import sys
sys.path.append('/var/www/domain/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'domain.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
My VirtualHost configuration:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName www.domain.com
ServerAdmin info#domain.com
ServerAlias domain.com
DocumentRoot /var/www/domain
WSGIScriptAlias / /var/www/domain/domain.wsgi
#Alias /static/ /var/www/domain/static/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
I'm using Ubuntu 14.04. I tried looking at logs but I have no idea what's wrong.
Logs:
[Thu Sep 25 10:15:09.549670 2014] [:error] [pid 17141] [client 88.12.185.72:65477] mod_wsgi (pid=17141): Exception occurred processing WSGI script '/var/www/domain/domain.wsgi'.
[Thu Sep 25 10:15:09.549722 2014] [:error] [pid 17141] [client 88.12.185.72:65477] Traceback (most recent call last):
[Thu Sep 25 10:15:09.549747 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
[Thu Sep 25 10:15:09.549880 2014] [:error] [pid 17141] [client 88.12.185.72:65477] response = self.get_response(request)
[Thu Sep 25 10:15:09.549899 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 199, in get_response
[Thu Sep 25 10:15:09.550029 2014] [:error] [pid 17141] [client 88.12.185.72:65477] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu Sep 25 10:15:09.550048 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 236, in handle_uncaught_exception
[Thu Sep 25 10:15:09.550075 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return debug.technical_500_response(request, *exc_info)
[Thu Sep 25 10:15:09.550091 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 91, in technical_500_response
[Thu Sep 25 10:15:09.550492 2014] [:error] [pid 17141] [client 88.12.185.72:65477] html = reporter.get_traceback_html()
[Thu Sep 25 10:15:09.550513 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 350, in get_traceback_html
[Thu Sep 25 10:15:09.550539 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return t.render(c)
[Thu Sep 25 10:15:09.550554 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 148, in render
[Thu Sep 25 10:15:09.550984 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return self._render(context)
[Thu Sep 25 10:15:09.551006 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 142, in _render
[Thu Sep 25 10:15:09.551034 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return self.nodelist.render(context)
[Thu Sep 25 10:15:09.551048 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render
[Thu Sep 25 10:15:09.551071 2014] [:error] [pid 17141] [client 88.12.185.72:65477] bit = self.render_node(node, context)
[Thu Sep 25 10:15:09.551084 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 80, in render_node
[Thu Sep 25 10:15:09.551174 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return node.render(context)
[Thu Sep 25 10:15:09.551192 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 90, in render
[Thu Sep 25 10:15:09.551217 2014] [:error] [pid 17141] [client 88.12.185.72:65477] output = self.filter_expression.resolve(context)
[Thu Sep 25 10:15:09.551231 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 624, in resolve
[Thu Sep 25 10:15:09.551268 2014] [:error] [pid 17141] [client 88.12.185.72:65477] new_obj = func(obj, *arg_vals)
[Thu Sep 25 10:15:09.551284 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/template/defaultfilters.py", line 769, in date
[Thu Sep 25 10:15:09.551595 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return format(value, arg)
[Thu Sep 25 10:15:09.551615 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 343, in format
[Thu Sep 25 10:15:09.551759 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return df.format(format_string)
[Thu Sep 25 10:15:09.551778 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 35, in format
[Thu Sep 25 10:15:09.551817 2014] [:error] [pid 17141] [client 88.12.185.72:65477] pieces.append(force_text(getattr(self, piece)()))
[Thu Sep 25 10:15:09.551834 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 268, in r
[Thu Sep 25 10:15:09.551857 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return self.format('D, j M Y H:i:s O')
[Thu Sep 25 10:15:09.551871 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 35, in format
[Thu Sep 25 10:15:09.551892 2014] [:error] [pid 17141] [client 88.12.185.72:65477] pieces.append(force_text(getattr(self, piece)()))
[Thu Sep 25 10:15:09.551907 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", line 85, in force_text
[Thu Sep 25 10:15:09.552021 2014] [:error] [pid 17141] [client 88.12.185.72:65477] s = six.text_type(s)
[Thu Sep 25 10:15:09.552039 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 144, in __text_cast
[Thu Sep 25 10:15:09.552276 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return func(*self.__args, **self.__kw)
[Thu Sep 25 10:15:09.552297 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 83, in ugettext
[Thu Sep 25 10:15:09.552412 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return _trans.ugettext(message)
[Thu Sep 25 10:15:09.552431 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 325, in ugettext
[Thu Sep 25 10:15:09.552686 2014] [:error] [pid 17141] [client 88.12.185.72:65477] return do_translate(message, 'ugettext')
[Thu Sep 25 10:15:09.552706 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 306, in do_translate
[Thu Sep 25 10:15:09.552731 2014] [:error] [pid 17141] [client 88.12.185.72:65477] _default = translation(settings.LANGUAGE_CODE)
[Thu Sep 25 10:15:09.552746 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 209, in translation
[Thu Sep 25 10:15:09.552768 2014] [:error] [pid 17141] [client 88.12.185.72:65477] default_translation = _fetch(settings.LANGUAGE_CODE)
[Thu Sep 25 10:15:09.552782 2014] [:error] [pid 17141] [client 88.12.185.72:65477] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 189, in _fetch
[Thu Sep 25 10:15:09.552804 2014] [:error] [pid 17141] [client 88.12.185.72:65477] "The translation infrastructure cannot be initialized before the "
[Thu Sep 25 10:15:09.552830 2014] [:error] [pid 17141] [client 88.12.185.72:65477] AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
Anyone knows what I'm doing wrong?
Thanks
I discover that the version of Django in my production server is 1.7.0 and in Development server is 1.6.4. After downgrade Django works fine.
sudo pip install django==1.6.4