Metadata-Version: 2.0
Name: django-yasp
Version: 0.3.0
Summary: Yet Another Static Page Django app.
Home-page: https://github.com/fgmacedo/django-yasp
Author: Fernando Macedo
Author-email: fgmacedo@gmail.com
License: MIT
Keywords: django-yasp
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5

=============================
django-yasp
=============================

.. image:: https://badge.fury.io/py/django-yasp.png
    :target: https://badge.fury.io/py/django-yasp

.. image:: https://travis-ci.org/fgmacedo/django-yasp.png?branch=master
    :target: https://travis-ci.org/fgmacedo/django-yasp

Another static page Django app.

Documentation
-------------

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

Quickstart
----------

Install django-yasp::

    pip install django-yasp

Include it on INSTALLED_APPS::

    'yasp',

Add to urls:

.. code-block:: python

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

Add to middlewares:

.. code-block:: python

    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:

.. code-block:: django

    {% 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:

.. code-block:: django

    {% load yasp %}

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

To get a URL to a specific page:

.. code-block:: django

    {% 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.


