PressGang WordPress Manager
PressGang is a Django application that makes it easier to manage multiple WordPress installations on a single server. It allows you to install blogs, lock them down, manage users and perform easy rollbacks to previous versions.
PressGang can install any blogs using WordPress 3.0 or greater, and can still perform some basic management tasks on older blogs. For the moment, it is only capable of dealing with blogs installed in subdirectories, and does not support subdomain installations.
git clone git://github.com/cilcoberlin/pressgang.git python pressgang/setup.py install rm -R pressgang
- Create a new Django project.
- Create a directory that is writable by your app to contain blog versions.
- Create a directory that is writable by your app to contain per-blog Apache configuration files.
- Copy the contents of the
media/directory to your site's
Somewhere in your Apache configuration file, add the following line, replacing
CONFIG_DIR with the full path to the directory created in step 2 of the
- Add 'pressgang' to the
INSTALLED_APPSlist in your project's
- Include 'pressgang.urls' in your project's URL configuration.
- Provide values for the settings below.
A string of the absolute path to the directory that you created to hold per-blog Apache configuration files.
A string that should match the value of Apache's DocumentRoot.
A string of the absolute path to the directory that you created to hold the blog backup files.
A string of the password for the admin use for your MySQL installation.
A string of the username of the admin user for your MySQL installation.
An optional list containing strings of the full paths to any custom installer
packages that you have created. Each item in the list must be on your Python path.
The full path to your mysql executable.
The full path to your mysqldump executable.
A string of the network location (i.e., 'subdomain.server.tld') of the server hosting your blogs.
If PressGang is the only application that you are running, you can use the following
values for your
settings.py variables, replacing PRESSGANG with the optional
URL prefix of your PressGang site, if it is not running in the root of your site.
LOGIN_URL = 'PRESSGANG/accounts/login' LOGOUT_URL = 'PRESSGANG/accounts/logout'
To have PressGang handle any 404 or 500 errors, you can set the following values in your main URL configuration.
handler404 = 'pressgang.core.views.handle_404' handler500 = 'pressgang.core.views.handle_500'
Any user that you add to your site must have certain permissions added to their accounts through your project's admin site to be able to use PressGang. The possible permissions, given as how they show up in the list of permissions available to users and groups, are:
pressgang | blog | can install blogs
Allows the user to install blogs
pressgang | blog | can manage blogs
Allows the user to make changes to the blogs.
pressgang | blog | can view blogs
Allows the user to view a list of all installed blogs.
Generally, a user will have all of the above permissions, but it is possible to restrict the permissions if desired.
Custom Blog Installations
PressGang provides a flexible API that allows you to provide custom templates for customizing the installation or upgrading of blogs. These templates take the form of standard Python packages and a few optional folders following a simple file structure that PressGang uses to generate configuration rules for a blog.
To create a new template, make a Python package that appears somewhere in your
PYTHONPATH, making it available for import. In the package's
__init__.py module, create a new class called
Install that is descended from
pressgang.actions.install.InstallAction. This class is the template for the
blog configuration. It accepts a wide range of attributes and methods, and the
possible values and methods for the class can be figured out by consulting the
source code for
pressgang.actions.install.InstallAction and the sample installers
available in the
In addition to the above attributes and methods, the
Install class can also
take options classes in the same manner that a Django model receives
For examples of how to use and set these options, consult the values of the
classes used by the sample installers defined in the
Once you have created a template in Python, you can provide additional PHP files
that should be copied to the blog via the
directories that can exist in your template's package. The contents of each
directory get copied to the
wp-content/mu-plugins/ directory of the blog.
With your installer created, you now need to tell PressGang that it exists. To
do so, simply add the import path to your package to the
list in your project's
settings.py file. It will now appear in the list of
available installation template when you are using PressGang.