我是亚马逊网络服务的新手,我想知道是否有人在EC2上部署Django应用程序的经验?我现在正在EC2上运行我的应用程序,但如果我必须为多个实例部署所有内容,则需要一些时间 - 我可能不会继续增长.
我的问题是,人们通常做什么来自动部署django应用程序?我们可以配置(最好是免费的)工具吗?
我一直在努力让电子邮件在 Django 中工作以进行日志记录以及 500 和 404 错误,但我一生都无法让它工作。我有DEBUG=False和所有其他设置。我的电子邮件设置如下:
EMAIL_HOST = 'host'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_SUBJECT_PREFIX = 'something'
EMAIL_USE_TLS = True
SERVER_EMAIL='blah@blah.com'
Run Code Online (Sandbox Code Playgroud)
我使用 Amazon SES 进行上述设置。我还有以下内容:
SEND_BROKEN_LINK_EMAILS=True
ADMINS = (
('name', 'email'),
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
)
Run Code Online (Sandbox Code Playgroud)
还有什么我想念的吗?任何帮助表示赞赏。
我对AFNetworking有疑问.我在这里阅读文档:
http://afnetworking.github.com/AFNetworking/Classes/AFImageRequestOperation.html
它说:
urlRequest:在执行操作期间异步加载的请求对象.
问题是当我执行下面的请求时,它发生在主线程上.我能够通过检查它是否在主线程中来确认它:
AFImageRequestOperation *operation = [AFImageRequestOperation imageRequestOperationWithRequest:urlrequest success:^(UIImage *image) {
if ([NSThread mainThread]){
NSLog(@"this is the main thread");
}
}];
[operation start];
Run Code Online (Sandbox Code Playgroud)
我做错了什么吗?我是否错误地解释了文档?为什么文档后面不是异步的?
不确定发生了什么,但这一次我能够使用bitbucket从git中拉,推,克隆等.但在我在线更改密码后,它会要求我输入我的帐户密码,然后说:
fatal: Authentication failed
Run Code Online (Sandbox Code Playgroud)
这有什么理由吗?我的密码绝对正确.我甚至无法完全克隆到新文件夹!
顺便说一下,我正在使用git version 1.8.0.我最近升级了它,不确定它是否与它有任何关系.
我正在使用以下项目在我的项目中启用APNS:
https://github.com/stephenmuss/django-ios-notifications
我可以在我的生产应用程序上发送和接收推送通知,但是沙箱apns有一些我无法解决的奇怪问题.它始终没有连接到推送服务.当我手动做_connect()的APNService或者FeedbackService班,我得到以下错误:
File "/Users/MyUser/git/prod/django/ios_notifications/models.py", line 56, in _connect
self.connection.do_handshake()
Error: [('SSL routines', 'SSL3_READ_BYTES', 'sslv3 alert handshake failure')]
Run Code Online (Sandbox Code Playgroud)
我尝试多次重新创建APN证书并不断获得相同的错误.还有什么我想念的吗?
我使用端点gateway.push.apple.com和gateway.sandbox.push.apple.com连接到服务.还有什么我应该考虑的吗?我看过以下内容:
我能够通过以下方式获得Spring安全性:
<http access-denied-page="/start.jsf">
<intercept-url pattern="/start.jsf" filters="none" />
<intercept-url pattern="/web/**" access="ROLE_USER" />
<form-login login-page="/start.jsf" default-target-url="/web/user/homepage.jsf"
authentication-success-handler-ref="successHandler" always-use-default-target="true"
authentication-failure-url="/index.jsf?state=failure"/>
<logout logout-success-url="/index.jsf?state=logout" />
</http>
<beans:bean id="successHandler" class="com.myapp.security.MyAuthenticationSuccessHandler"/>
Run Code Online (Sandbox Code Playgroud)
我的问题是MyAuthenticationSuccessHandler类,在进行身份验证后,它只是一个空白页面.我可以使用context.redirect()重定向到默认主页,但有没有办法让它自动转到默认主页?我甚至将它列在spring xml中.
我可以通过以下方式创建html链接:
<a href="/about">About Us</a>
Run Code Online (Sandbox Code Playgroud)
这将遵循路由/about.但是在接下来的页面上(我知道它是早期版本的Play,但我找不到2.0.1的任何信息):
http://www.playframework.org/documentation/1.1/tags
playframework如何从href中调用带有一个参数的html方法?
该链接从路由文件中获取.我将以上链接的路由定义为:
GET /about controllers.Application.about()
在PlayFramework2中,如何通过传递控制器和函数名称以编程方式获取路由?
现在我有一个启用SSL的网站.SSL处于ELB级别,因此apache http服务器永远不会看到它.我正在努力使Apache能够强制所有请求,https因此没有http请求.我正在阅读关于SO的其他几篇文章,包括:
http://www.acmedata.in/2012/08/31/how-to-host-a-django-app-behind-elb-with-ssl/
我可以为此使用ELB配置吗?或者我是否必须从ELB中删除私钥等,并将其全部放在Web服务器级别?我无法找到有关此问题的任何进一步信息......
我正在测试Amazon Cloudsearch我的Web应用程序,我遇到了一些奇怪的问题.
我有以下域指标:name,email,id.
例如,我有以下数据:John Doe,John @ example.com,1
当我搜索时,jo我什么都没得到.如果我搜索joh我仍然什么都没有,但如果我搜索john然后我得到上面的文件作为命中.当我放置部分字符串时为什么没有得到?我甚至提出了建议器name并启用email了模糊匹配.还有别的东西我不见了吗?我在下面看到了这个:
http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-text.html
http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html
http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-compound-queries.html
我正在使用boto以及AWS页面上的表单进行搜索.
我正在尝试xmlsec在El Capitan 上安装,但我无法这样做.
我正按照此页面上的说明操作:
https://github.com/concordusapps/python-xmlsec
我什么时候pip install xmlsec得到:
Downloading xmlsec-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
no previously-included directories found matching 'doc/.build'
Installed /private/tmp/easy_install-kotwF5/pkgconfig-1.1.0/.eggs/nose-1.3.7-py2.7.egg
zip_safe flag not set; analyzing archive contents...
Installed /private/tmp/pip-build-my91LX/xmlsec/.eggs/pkgconfig-1.1.0-py2.7.egg
Searching for setuptools-cython
Reading https://pypi.python.org/simple/setuptools_cython/
Best match: setuptools-cython 0.2.1
Downloading https://pypi.python.org/packages/source/s/setuptools_cython/setuptools_cython-0.2.1.tar.gz#md5=c29fc5bf2894e69cbd98e3800cef4707
Processing setuptools_cython-0.2.1.tar.gz
Writing /tmp/easy_install-xnAHIU/setuptools_cython-0.2.1/setup.cfg
Running setuptools_cython-0.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xnAHIU/setuptools_cython-0.2.1/egg-dist-tmp-zk1125
zip_safe flag not set; analyzing archive contents...
Copying setuptools_cython-0.2.1-py2.7.egg to /private/tmp/pip-build-my91LX/xmlsec/.eggs
Installed /private/tmp/pip-build-my91LX/xmlsec/.eggs/setuptools_cython-0.2.1-py2.7.egg
Searching for Cython
Reading https://pypi.python.org/simple/Cython/
Traceback (most recent …Run Code Online (Sandbox Code Playgroud)