Up to tag cloud
Subscribe to an RSS feed for this tag

Entries tagged with prototyping

    1. Suffer Less By Using Django Dev Server as a Proxy

      by Will Larson
      September 30, 2008 django prototyping

      A quick look at how to use Django (and specifically the development server) as a proxy to remove some pain in your life when developing static media changes to an existing site quickly.

      Comment by Will Larson on October 1, 2008 Responding to Will Larson

      To further clarify: you could perform this form of proxying with Nginx or Apache instead of the Django devel server, but using the Django devel server has a number of benefits.

      1. It requires virtually no setup to get started, even across platforms.
      2. The url configurations are something you're already familiar with if you're a Django developer.
      3. It restarts automatically.
      4. Gives you fine tuned control over incoming content, in Python. In the Python function that is proxying you could add or remove GET/POST parameters, rewrite requests to properly use PUT / DELETE, use BeautifulSoup to fix poorly formed HTML or whatever else you can imagine.
      Comment by Will Larson on October 1, 2008 Responding to dbr

      Yep. This is true, but the article discusses using the django dev server as a proxy when doing prototyping work on top of an existing application. For example I am currently in a situation where the primary server has to be compiled (it is not a Django server) by someone else each time changes are made.

      Even adding static media to that server is impossible without recompiling it, and there are licensing issues with me compiling it myself. However, I am building a JavaScript heavy UI on-top of the program, and am simply making api calls to the original server and serving static media myself.

      Or as the first line of the article put it:

      When doing web development, you'll occasionally run into a situation where you are developing a new user interface or otherwise redesigning a website, but either cannot or don't want to tear out the existing pieces you are replacing.

      Comment by dbr on October 1, 2008

      Usually it's the other way around - apache, or lighttpd, or one of the really small web-servers are normally used to serve static content, and act as a proxy to things like the django dev server.. as they are usually faster (less python'y overhead), more reliable/secure (very heavily tested web-servers), and more HTTP-compliant (again, testing)

      Not quite sure you're reasons for using it this way are that valid.. If you proxy the dev server via apache, you get all the same benefits (automatic code reloading), with the above benefits... no?