http.StreamingHttpResponse

class StreamingHttpResponse [source] The StreamingHttpResponse class is used to stream a response from Django to the browser. You might want to do this if generating the response takes too long or uses too much memory. For instance, it’s useful for generating large CSV files. Performance considerations Django is designed for short-lived requests. Streaming responses will tie a worker process for the entire duration of the response. This may result in poor performance. Generally speaking, yo

http.StreamingHttpResponse.reason_phrase

StreamingHttpResponse.reason_phrase The HTTP reason phrase for the response. Changed in Django 1.9: reason_phrase no longer defaults to all capital letters. It now uses the HTTP standard’s default reason phrases. Unless explicitly set, reason_phrase is determined by the current value of status_code.

http.StreamingHttpResponse.status_code

StreamingHttpResponse.status_code The HTTP status code for the response. Changed in Django 1.9: Unless reason_phrase is explicitly set, modifying the value of status_code outside the constructor will also modify the value of reason_phrase.

http.StreamingHttpResponse.streaming

StreamingHttpResponse.streaming This is always True.

http.StreamingHttpResponse.streaming_content

StreamingHttpResponse.streaming_content An iterator of strings representing the content.

Installing Geospatial libraries

GeoDjango uses and/or provides interfaces for the following open source geospatial libraries: Program Description Required Supported Versions GEOS Geometry Engine Open Source Yes 3.4, 3.3 PROJ.4 Cartographic Projections library Yes (PostgreSQL and SQLite only) 4.9, 4.8, 4.7, 4.6, 4.5, 4.4 GDAL Geospatial Data Abstraction Library Yes (SQLite only) 2.1, 2.0, 1.11, 1.10, 1.9, 1.8, 1.7 GeoIP IP-based geolocation library No 1.4 PostGIS Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.3, 2.2

Installing PostGIS

PostGIS adds geographic object support to PostgreSQL, turning it into a spatial database. GEOS, PROJ.4 and GDAL should be installed prior to building PostGIS. You might also need additional libraries, see PostGIS requirements. The psycopg2 module is required for use as the database adapter when using GeoDjango with PostGIS. On Debian/Ubuntu, you are advised to install the following packages: postgresql-x.x, postgresql-x.x-postgis, postgresql-server-dev-x.x, python-psycopg2 (x.x matching the Pos

Installing SpatiaLite

SpatiaLite adds spatial support to SQLite, turning it into a full-featured spatial database. First, check if you can install SpatiaLite from system packages or binaries. For example, on Debian-based distributions, try to install the spatialite-bin package. For distributions that package SpatiaLite 4.2+, install libsqlite3-mod-spatialite. For Mac OS X, follow the instructions below. For Windows, you may find binaries on the Gaia-SINS home page. In any case, you should always be able to install f

Integrating Django with a legacy database

While Django is best suited for developing new applications, it’s quite possible to integrate it into legacy databases. Django includes a couple of utilities to automate as much of this process as possible. This document assumes you know the Django basics, as covered in the tutorial. Once you’ve got Django set up, you’ll follow this general process to integrate with an existing database. Give Django your database parameters You’ll need to tell Django what your database connection parameters are

Internationalization and localization

Overview The goal of internationalization and localization is to allow a single Web application to offer its content in languages and formats tailored to the audience. Django has full support for translation of text, formatting of dates, times and numbers, and time zones. Essentially, Django does two things: It allows developers and template authors to specify which parts of their apps should be translated or formatted for local languages and cultures. It uses these hooks to localize Web apps f