Web Service Updates

The most natural way to transition to Django is to use it as the basis for websites. The appeal of the current PAWeb-based websites is that they allow users to maintain their title data in a single place (their desktop database, under PubAssist and Couplet) and synchronize this data with their website and trading partners directly from that database.




Django is a web framework at its heart. By creating an interoperability between Django and Couplet, we get the full benefits of creating Django-based websites, without losing any of the features that make PAWeb-enabled sites attractive to publishers. Namely:



In order to make a Django-based web service fully interoperable with the existing Couplet and Publishers' Assistant desktop software, it must be able to create and parse the XML format used by the existing PAWeb service. Specifically, it must:

  1. Accept updates to titles, contacts, promotions, and related models. A Django-based web service must be able to parse the XML used to send updates from Couplet. In particular, it must be able to generate Django model relationships based on the hierarchical structure of the Couplet XML (as opposed to the "flat" one-object-one-node format that Django normally uses for serialization). Once the appropriate Django model objects have been created and their relationships have been constructed, the service must save them to the database. The web service should be forgiving: it shouldn't fail if there is a mismatch between the fields defined by the server-side Django models and the fields defined in the XML.

  2. Serialize product orders into an XML format that can be downloaded and imported into PubAssist. The Django-based web service must be able to generate XML representations of orders — regardless of how those orders are recorded on the web server — which the Publishers' Assistant order import routines can handle.

  3. Provide an appropriate security mechanism for these operations. The Django built-in @staff_member_required decorator is probably not sufficient to secure the operations of accepting updates and creating orders, because it redirects to a login page if the user has not already established a session. Implementing a login that can take place over HTTP/S will probably be specific to the web server we use. On the other hand, it may be simple enough to modify the Couplet login procedure to establish a session before posting the data, so that @staff_member_required will be sufficient.


Other Goals

Eventually, it might be nice to extend a Django-based web service to do the things the current service lacks, such as:

  1. the ability to accept and store images as well as textual title data