Skip to main content

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

https://badge.fury.io/py/django-static-pages.svg 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

Download files

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

Source Distribution

django-static-pages-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file django-static-pages-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-static-pages-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3b2a9372f372924ff4fb1f7cfb84466f0961aa734537417c143f6c42276492dd
MD5 9243c504a5daaedab5dfb3c01a3b3c4b
BLAKE2b-256 209b5edfcaa8a93672fce1cbe9402afbc6c73e243fd9c375a736ca97365dc124

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 file

0.1.1

1 file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page