Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Can you recommend what Python library to use for accessing AMQP (RabbitMQ)? From my research pika seems to be the preferred one.
My own research led me to believe that the right library to use would be Kombu, as this is also what Celery (mentioned by #SteveMc) has transitioned to. I am also using RabbitMQ and have used Kombu with the default amqplib backend successfully.
Kombu also supports other transports behind the same API. Useful if you need to replace AMQP or add something like redis to the mix. Haven't tried that though.
Sidenote: Kombu does currently not support the latest pika release (should you rely on it for some reason). Only 5.2.0 is currently supported, this bit me a while back.
Pika is the RabbitMQ recommended library, and py-ampqlib is also mentioned. Depending on what you're using Rabbit for, you might also want to look at Celery (a client library dedicated to distributed queuing).
Again, depending on usage, you might also want to look at Apache's qpid which is a full AMPQ-based client-server alternative to RabbitMQ. One thing that attracted us to qpid was that it seemed to have better robustness on server crashes (queues are persisted in a distributed fashion).
Having looked at all these libraries, I am now convinced that the right answer is none of them. Instead, build an abstraction layer as a shim over whatever library you choose because you are bound to run into a situation where you have to change libraries.
But do remember, that if you stick to the same version of the AMQP protocol, these libraries do interoperate. Due to different libraries being tested, we had parts of a prototype application running pika, kombu and py-amqplib.
Read this blog about replacing amqplib with pika for a sense of why this is a good idea.
I am currently in the middle of making our Python app use SSL. I did not originally develop this application (nor am I a Python developer), so I don't know much about it, but we seem to use the AMQP Client in Twisted.
QPid also has one. Again, I don't know the quality.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Safaribooksonline.com has a video [1] from Jacob Kaplan-Moss about how to deploy a Django app. This video is from 2010. It refers to a site [2] that has a list of many relevant aspects.
Now the workshop mentions things like virtual machines, vagrant (as deployment environments) or Fabric and other tools for deployment automation.
I was wondering how much has changed since then. I can think of Docker replacing Vagrant. Or Heroku or AWS instead of renting a dedicated physical server for deployment (or virtual machines). Or using Ansible or Chef / Puppet instead of Capistrano or Fabric.
But what else has changed? What is still relevant? What is done differently? What is the state of the art in 2017 for deploying a production ready Django app.
Can anybody point me to good blogs / books / tutorials?
[1] "Django deployment workshop", https://www.safaribooksonline.com/library/view/django-deployment-workshop/9781449396442/
[2] "infrastructure of modern websites", https://randomfoo.net/2009/01/28/infrastructure-for-modern-web-sites
Honestly, the answer to this question will be extremely opinionated and defining best practices in ever-changing devops area can be challenging. Something is a best practice one day, and tomorrow someone makes a blog post about that being god awful and obsolete.
There are numerous ways to do deployment, but it all comes down to what do you need, how much do you want to automate and what level of customization is required.
For instance, at my current place we use CircleCI, Heroku, Sentry and
Rollbar.
One of my previous clients (three months ago) wanted us to use
CodePipeline which includes CodeCommit, CodeBuild, CodeDeploy for
AWS.
Recently I also worked on a project involving Docker and flexible
environment from Google App Engine.
For my personal projects I simply use Fabric and Heroku, but I'd really like to try the new CodeStar or whatever the name is on AWS.
Define what you want, how you want to customize it and simply do it. If something does not work out, just change it. Things are becoming easier to do and replacing one item in your pipeline can occur in matter of minutes and not days/weeks as it did. Nowadays every provider has support for Docker and CI, one way or the other.
YMMV.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I may be too ambitious and what I am trying to accomplish May not even be possible using twisted, but I would like to develop an application using Twisted that does all of the following.
Run an SFTP server
Run an FTPS server
Run an HTTPS server (web UI for transferring files)
All of these protocols will share a single database for user authentication.
I would also like to create a scheduler that can trigger files transfers on some time interval.
This framework seems limitless when reading through the docs on the site, but it's hard for me to dive in and figure out if Twisted is capable of doing all of the above without knowing it inside and out.
I am still going through the examples on their site and it seems like there is a steep learning curve to really grasping how to do these things.
I would appreciate any feedback or pointers on how to accomplish this, if it's possible.
Yes, it absolutely can.
From a Twisted perspective, there is a support for pretty much everything you ask for - SFTP, FTPS, HTTPS and scheduling.
When it comes to database integration, I would use standard Python db libraries. I don't think you need anything special from Twisted for that.
Scheduled tasks could be accomplished through either Python scheduler libraries or using Twisted's reactor framework.
Regarding the SFTP, FTPS and HTTPS:
SFTP server can be implemented using Twisted Conch. Documentation is little bit skimpy, but yes you can do it.
Take a look at this source code and look for the implementation of class SFTPServerForUnixConchUser.
FTPS is, to the best of my knowledge, a matter of using a third party package.
HTTPS is a mainstream.
Here is an officially documented setup.
(I suspect that my answer will become obsolete in a year when all these features get incorporated into a main release.)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'd like to exercise MongoDB in a real world project so I'm wondering what are the Python frameworks that support MongoDB as the main database out of the box (and are well documented)?
If you're talking Web-Frameworks there's Tornado or Mongo-kit in Flask or Flask-PyMongo that have great support for MongoDB, but at the end of the day it's all easily pluggable.
I'm not sure what you mean by "out of the box" but I have successfully used MongoDB with Tornado web server in a number of projects.
You can very easily interface with MongoDB using several libraries. My favorites are:
PyMongo: http://api.mongodb.org/python/2.2/
Mongoengine: http://mongoengine.org/
IMO Mongonegine is an excellent tool for communicating to Mongo through Python and it is relatively well documented. I particularly like the fact that Mongoengine provides concrete examples in the documentation (which is really nice for a beginner).
You can use django-mongokit as excellent framework for your project. It bridges Django to MongoDB with the MongoKit ODM (Object Document Mapper).
As Django is most widely and successfully used in many projects, which has big community support and lots of packages are available that can be easily implement in the project.
We had successfully implemented it in our project which is available at github.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I need to create a simple server/daemon which just waits for commands, (maybe queues them up), and executes other commands based on the received input. Here are more detailed requirements:
Should be in Python since I need to use some other Python code I wrote for it.
Needs to work on at least Linux and Windows (Will be running as an init.d service on Linux and
as a Windows Service on Windows)
Communication medium should be as simple as possible and hopefully commands can be sent to the server from a batch script
Commands come from the same machine. Performance isn't important.
Installation on Windows (including all the libraries needed to send a command to the server from a script) should be simple. If everything can be wrapped into a single .exe all the better.
What's the best stack to use for this? I have only a few vague ideas:
CherryPy (Windows doesn't have cURL though, ugh...)
dbus and windbus (never used these before...)
In my experience (and I've implemented three or four applications similar to what you've described), all things created equal, and I've found it simplest to go with a subclass of SocketServer.TCPServer and implement my own, simple, command system. This gives you full control over the details (need streaming? No problem; need stateful connections? No problem), and isn't all that tricky given some basic knowledge of how sockets work.
On Windows, I understand that py2exe does a good job.
A couple alternatives/tools you might want to consider:
SimpleXMLRPCServer and xmlrpclib — if you can live with the constraints imposed by HTTP + XMLRPC (stateless, streaming is tricky) this will get you up and running in about 5 minutes. Also note that the SimpleXMLRPCServer is single-threaded. It's possible to make it multi-threaded (or multi-process, or whatever), but that will take a little bit of work.
On Linux, python-daemon is a possibility for daemonizing, but I've usually found start-stop-daemon to be simpler (if it's available on your platform)
Is it possible to run a Python script as a service in Windows? If possible, how? should help you running the script as a service.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm working on a web application using isapi_wsgi and django-pyodbc. I'd like to have a way to install all dependencies and push the files out to the webserver. Unfortunately, some of these are easier said than done. In particular, handling dependencies is a pain as some of them won't install correctly even under setuptools (pywin32 is especially difficult).
Most of the tools that I see for automating this kind of stuff (fabric and capistrano) are made for use with unix-y systems. I would like to set up a continuous integration system, but that only solves part of the problem. Is there any way to make life easier for a Pythonista who's forced to use Windows/IIS?
BitNami provides free Windows Django all-in-one installers that include all dependencies to deploy a Django app on Windows. Disclaimer: I am one of the developers of this tool. If you are going for a hosted version, we also have free Windows Amazon Machine Images (look further down in that page) but in that case I would strongly recommend going with a Linux-based AMI.
Have you looked into Paver? It might not be the perfect solution, but maybe better then your current process.
And it has setuptools (and other useful wrappers) built-in.
Nowadays deploying your Django web project on a Windows based server has become less cumbersome. It's still challenging as most guides are geared towards Unix systems, but deploying on a Windows server is not impossible. Microsoft now provides some native support for Django with IIS.
However, you are not limited to IIS. You can use Apache + mod_wsgi. Here is one of my own test projects that you can deploy on Apache my web project.
Guide: Deploy Django with Apache and mod_wsgi on Windows Server 2019