我正在运行CentOS 5,我正在尝试使用mod_wsgi来使用django应用程序.我正在使用.wsgi设置我在Ubuntu上工作.我也使用python(/opt/python2.6/)的备用安装,因为我的django应用程序需要> 2.5,操作系统使用2.3
这是错误:
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] SystemError: dynamic module not initialized properly
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] mod_wsgi (pid=23630): Target WSGI script '/data/hosting/cubedev/apache/django.wsgi' cannot be loaded as Python module.
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] mod_wsgi (pid=23630): Exception occurred processing WSGI script '/data/hosting/cubedev/apache/django.wsgi'.
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] Traceback (most recent call last):
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] File "/data/hosting/cubedev/apache/django.wsgi", line 8, in …Run Code Online (Sandbox Code Playgroud) 我有一个主 shell 脚本,它为循环的每次迭代调用一个子脚本,如下所示:
#!/bin/bash
while read line
do
if [[ $line != "" ]]
then
./sslv2_check.sh $line
fi
done < https-servers
Run Code Online (Sandbox Code Playgroud)
如果这些调用中的任何一个在这种情况下登陆(请参阅下面的 shell 脚本)
message="FAIL! $1 supports SSLv2 on port $port"
Run Code Online (Sandbox Code Playgroud)
那么主脚本将停止并且不会调用下一批。我如何让它继续?
#!/bin/bash
# Required Argument $1 = hostname
# Optional Argument $1 = port number
if [[ $1 == "" ]]
then
echo Error: I expected a hostname to be passed as an argument but didn\'t find any
exit 1
fi
if [[ $2 == "" ]]
then
port=443 …Run Code Online (Sandbox Code Playgroud) 我有一个requirements.txt如下
boxsdk
boxsdk[jwt]
Run Code Online (Sandbox Code Playgroud)
如果我运行pip install -r requirements.txt,那么只会boxsdk安装,而不是boxsdk[jwt]
# cat requirements.txt
boxsdk
boxsdk[jwt]
# pip -q install -r requirements.txt
# python -c "import boxsdk.auth.jwt_auth"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/boxsdk/auth/jwt_auth.py", line 10, in <module>
from cryptography.hazmat.backends import default_backend
ModuleNotFoundError: No module named 'cryptography'
Run Code Online (Sandbox Code Playgroud)
但是,如果我删除第一行以便仅boxsdk[jwt]在 中列出requirements.txt,它就会正确安装
# cat requirements.txt
boxsdk[jwt]
# pip -q install -r requirements.txt
# python -c "import boxsdk.auth.jwt_auth"
#
Run Code Online (Sandbox Code Playgroud)
完整的 pip 输出可以在这里看到:https …
如果我尝试按如下方式发送电子邮件,则该过程会挂起并且没有任何反应:
>>> from django.core.management import setup_environ
>>> from cube import settings
>>> setup_environ(settings)
'cube'
>>> from django.core.mail import send_mail
>>> send_mail('Subject', 'Message', 'sender@domain.com', ['recepient@domain.com'], fail_silently=False)
Run Code Online (Sandbox Code Playgroud)
但是,telnet到端口25的工作正常
$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet>
Run Code Online (Sandbox Code Playgroud)
这是为了以防万一
$ netstat -a | grep :smtp
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 localhost:smtp localhost:44932 ESTABLISHED
tcp 0 0 localhost:44932 localhost:smtp ESTABLISHED
tcp 0 0 localhost:smtp localhost:60964 ESTABLISHED
tcp 0 0 localhost:60964 localhost:smtp ESTABLISHED …Run Code Online (Sandbox Code Playgroud) python ×3
django ×2
centos5 ×1
mod-wsgi ×1
pip ×1
postfix-mta ×1
scripting ×1
smtp ×1
ubuntu-10.04 ×1