Skip to content

Commit

Permalink
Merge branch 'feature/demo' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Jul 25, 2014
2 parents ffe45c2 + 3224121 commit 5364a71
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 1 deletion.
1 change: 1 addition & 0 deletions app_namespace/demo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Demo of the app_namespace app"""
3 changes: 3 additions & 0 deletions app_namespace/demo/application/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
demo.application
"""
33 changes: 33 additions & 0 deletions app_namespace/demo/application/templates/application/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Fantomas42">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Django-app-namespace-template-loader{% endblock title %}</title>
{% block style %}
{% endblock style %}
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12 col-md-offset-0">
<h1>{% block header %}Header{% endblock header %}</h1>
<p>{% block content %}Content{% endblock content %}</p>
<ul>
{% block list %}
<li>
<code>application:application/template.html</code>
</li>
{% endblock%}
</ul>
<footer>
<p class="text-right">
{% block footer %}Footer{% endblock footer %}
</p>
</footer>
</div>
</div>
</div>
</body>
</html>
3 changes: 3 additions & 0 deletions app_namespace/demo/application_extension/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
demo.application_extension
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends ":application/template.html" %}

{% block title %}Django-app-namespace-template-loader{% endblock title %}

{% block header %}Django-app-namespace-loader{% endblock header %}

{% block content %}This page has been generated by a combination of extend and override of these templates:{% endblock content %}

{% block list %}
<li>
<code>application_extension:application/template.html</code>
</li>
{{ block.super }}
{% endblock%}
28 changes: 28 additions & 0 deletions app_namespace/demo/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Settings for the app_namespace demo"""
import os

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

STATIC_URL = '/static/'

SECRET_KEY = 'secret-key'

ROOT_URLCONF = 'app_namespace.demo.urls'

TEMPLATE_LOADERS = (
'app_namespace.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)

TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates')
)

INSTALLED_APPS = (
'app_namespace.demo.application_extension',
'app_namespace.demo.application'
)
22 changes: 22 additions & 0 deletions app_namespace/demo/templates/application/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% extends ":application/template.html" %}

{% block title %}Demo - {{ block.super }}{% endblock title %}

{% block style %}
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body { background-color: #eee; }
.container .row div { background-color: white; }
</style>
{% endblock style %}

{% block list %}
<li>
<code>application/template.html</code>
</li>
{{ block.super }}
{% endblock list %}

{% block footer %}
Demo made by <a href="https://github.com/Fantomas42">Fantomas42</a>.
{% endblock footer %}
11 changes: 11 additions & 0 deletions app_namespace/demo/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Urls for the app_namespace demo"""
from django.conf.urls import url
from django.conf.urls import patterns
from django.views.generic import TemplateView


urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(
template_name='application/template.html')),
)
9 changes: 8 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[buildout]
extends = versions.cfg
parts = test
parts = demo
test
test-and-cover
flake8
coveralls
Expand All @@ -11,6 +12,12 @@ eggs = six
django-app-namespace-template-loader
show-picked-versions = true

[demo]
recipe = djangorecipe
projectegg = app_namespace.demo
settings = settings
eggs = ${buildout:eggs}

[test]
recipe = pbp.recipe.noserunner
eggs = nose
Expand Down
1 change: 1 addition & 0 deletions versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Django = 1.6.5
blessings = 1.5.1
buildout-versions-checker = 1.5.1
djangorecipe = 1.10
flake8 = 2.2.2
futures = 2.1.6
mccabe = 0.2.1
Expand Down

0 comments on commit 5364a71

Please sign in to comment.