Yet Another Static Page Django app.
Project description
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:
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-yasp-0.3.0.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for django_yasp-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed496e65252c645117bfdb9107bee86067041f062f67492c63be91b6503003f6 |
|
MD5 | a7ba78a5231928ae1e0ae36ba3f871f4 |
|
BLAKE2b-256 | b547e1aafff095287b5a8c505142fde48975ce89be89fa0557514e795b18e130 |