djangosnippets.org: Latest snippets tagged with 'server'https://djangosnippets.org/tags/server/2011-03-02T18:25:55.175123-06:00Server Side Cursors for Django's psycopg2 Backend
2011-03-02T18:25:55.175123-06:00ryanbutterfieldhttps://djangosnippets.org/snippets/2375/<p>Based on discussion on <a href="http://thebuild.com/blog/2010/12/14/using-server-side-postgresql-cursors-in-django/">http://thebuild.com/blog/2010/12/14/using-server-side-postgresql-cursors-in-django/</a> and <a href="http://thebuild.com/blog/2010/12/13/very-large-result-sets-in-django-using-postgresql/">http://thebuild.com/blog/2010/12/13/very-large-result-sets-in-django-using-postgresql/</a> but instead implements them via extending the psycopg2 backend which allows you to use all of django's machinery without having to resort to using raw cursors.</p>
<p>Usage:</p>
<pre><code>qs = Model.objects.all()
with server_side_cursors(qs, itersize=100):
for item in qs.iterator():
item.value
if random_reason_to_break:
break
</code></pre>
<p>Setup:</p>
<p>In …</p>
Freely redistributableIn-memory XML-RPC server based on URL
2010-06-23T16:21:09.825137-05:00divermanhttps://djangosnippets.org/snippets/2078/<p>This is a XML-RPC server, that uses arguments in URLs and every dispatcher instance is prepared in memory during webserver run. It's good, for example, for securing XML-RPC server with hashed strings and there are a lot of similar use cases.</p>
<p>Usage:</p>
<pre><code>from xmlrpclib import ServerProxy
server = ServerProxy('http://example.com/xmlr-rpc/%s/' % …</code></pre>
Freely redistributableDjango with Fast CGI (Server Conf)
2010-05-06T06:57:32.836879-05:00jackoderhttps://djangosnippets.org/snippets/2011/<p>I've taken it from hostgator help page.</p>
<p>I hope it will be useful for you.</p>
Freely redistributableSMTP sink server: prettier output
2010-05-05T19:41:48.868223-05:00huwshimihttps://djangosnippets.org/snippets/2010/<p>A modified version of the original SMTP sink server:
<a href="http://www.djangosnippets.org/snippets/96/">http://www.djangosnippets.org/snippets/96/</a>. I've added some nicer, more verbose terminal messages. </p>
Freely redistributableSMTP sink server
2007-03-09T18:19:32.871329-06:00twinsanthttps://djangosnippets.org/snippets/96/<p>In development, we need a SMTP Server to see the results of send mail via SMTP protocol in Python application. Instead of configure a mail daemon, we could use this little script to receive the SMTP request, and save each session into an EML file. *.eml could be viewed with …</p>
Freely redistributable