I would strongly suggest looking into using Celery or some other form
of message queue.
In general you want to decouple the logic of the web app, such as
validating domain names, writing to the database, with operations that
has real-world important side effects. Once you split these, the
system as a whole is much easier to understand for newcomers, much
easier to reason about and above all, actually possible to test.
The operations that has side effects on your other systems is thus a
separate part of your system. That way you can test them in isolation
and you may even run a failed operation several times, without
requiring work from the user. You could also batch the operations if
necessary.
A separation like this requires some a new concept for communication
with the user. This can be as simple as "You just added a new virtual
host. We will send you a confirmation when the host is active."
As a side note, I would strongly recommend writing your operations in
such a way that you may run the same operation more than once and
achieve the same result. Otherwise you will run into nastiness. And if
you want to update a virtual host, just run the "add_virtualhost"
operation again, but this time with updated data.
You could also look into using a configuration management system, like
Chef. You could then have your system create Chef recipes.
Regards
Knut
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
The great benefit about these systems is that you can go from a
freshly installed machine, to a machine with all the necessary
packages, services and configuration all in place, without any manual
work other than starting the configuration management system.
There is a big initial investment to start using these systems, and
everything you do to your machines you need to do through the tool.
For your scale this might not be a good investment.
Another benefit of systems like Chef is that the configurations is
plain text, so you can use your normal development tools, like version
control, peer review, etc. It becomes very easy to reason about the
proposed change, when you have a diff at hand.
Regards
Knut