Skip to main content

Yet Another Static Page Django app.

Project description

https://badge.fury.io/py/django-yasp.png https://travis-ci.org/fgmacedo/django-yasp.png?branch=master

Another static page Django app.

Documentation

The full documentation is at https://django-yasp.readthedocs.org.

Quickstart

Install django-yasp:

pip install -e git://github.com/fgmacedo/django-yasp.git@v0.2.0#egg=django-yasp

Include it on INSTALLED_APPS:

'yasp',

Add to urls:

url(r'^', include('yasp.urls', namespace='yasp')),

Add to middlewares:

MIDDLEWARE_CLASSES = [
    ...
    'yasp.middleware.StaticPageFallbackMiddleware',
]

From now on, each page that you create on Admin will be acce

Then use it in a template.

To load all pages inside a menu:

{% load yasp %}

{% get_pages_from_menu 'about-us' as about_us_pages %}

{% for i in about_us_pages %}
    Title: {{i.title}}
    ...
{% endfor%}

To get a specific page:

{% load yasp %}

{% get_page 'about-us/vision' as vision %}
Title: {{vision.title}}

To get a URL to a specific page:

{% load yasp %}

<a href="{% get_page_url 'about-us/vision' %}">Our vision</a>

Features

  • Build menus from static pages.

  • Get a page from his slug.

  • Redirect to a link.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.py

History

0.1.0 (2016-09-26)

  • First release on PyPI.

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page