Skip to main content

A reusable Django app that generates static pages using Django test client

Project description

A reusable Django app that generates static pages using Django test client.

https://travis-ci.org/atugushev/django-static-pages.svg?branch=master https://coveralls.io/repos/atugushev/django-static-pages/badge.svg?branch=master&service=github

Installation

  1. Install a package:

    $ pip install django-static-pages
    
  2. Add “static_pages” to your INSTALLED_APPS setting:

    INSTALLED_APPS = (
        ...
        'static_pages',
    )
    

Configuration

Specify which files should be generated as static files:

STATIC_PAGES_LIST = (
    ('/', 'index.html'),
    ('/about/', 'about.html'),
    ('news:list', 'news/index.html'),
)

Set path for an output directory of the static files:

STATIC_PAGES_DIR = '/srv/example.com/html/'

This kwargs will be passed to the Django test client arguments. It may be usefull if you want to control WSGI environments of the RequestFactory of the the client:

STATIC_PAGES_CLIENT_KWARGS = {
    'SERVER_NAME': 'example.com',
}

Usage

Just execute the following command:

$ python manage.py generate_static_pages

Requirements

  • Python 2.7+ or 3+
  • Django>=1.5

Project details


Release history Release notifications

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-static-pages-0.1.2.tar.gz (4.9 kB) Copy SHA256 hash SHA256 Source None Dec 12, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page