Changeset - bf77625bf674
[Not reviewed]
0 1 3
Branko Majic (branko) - 10 years ago 2015-09-11 02:29:42
branko@majic.rs
MDT-2: Implemented initial urls, views, and base/index templates for app_bootstrap.
4 files changed with 40 insertions and 2 deletions:
0 comments (0 inline, 0 general)
app_bootstrap/templates/app_name/base.html
Show inline comments
 
new file 100644
 
{% templatetag openblock %} load static from staticfiles {% templatetag closeblock %}
 

	
 
<!DOCTYPE html>
 
<html lang="en">
 
  <head>
 
    <meta charset="utf-8">
 
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
 
    <meta name="viewport" content="width=device-width, initial-scale=1">
 
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
 
    <title>{% templatetag openblock %} block title {% templatetag closeblock %}{{ app_name }}{% templatetag openblock %} endblock {% templatetag closeblock %}</title>
 

	
 
    <!-- Bootstrap -->
 
    <link href="{% templatetag openblock %} static '{{ app_name }}/bootstrap/css/bootstrap.min.css' {% templatetag closeblock %}" rel="stylesheet">
 

	
 
  </head>
 
  <body>
 
    <div class="container">
 
      {% templatetag openblock %} block content {% templatetag closeblock %}
 
      <h1>I'm a base template content! Override me!</h1>
 
      {% templatetag openblock %} endblock {% templatetag closeblock %}
 
    </div>
 

	
 
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
 
    <script src="{% templatetag openblock %} static '{{ app_name }}/jquery.min.js' {% templatetag closeblock %}"></script>
 
    <!-- Include all compiled plugins (below), or include individual files as needed -->
 
    <script src="{% templatetag openblock %} static '{{ app_name }}/bootstrap/js/bootstrap.min.js' {% templatetag closeblock %}"></script>
 
  </body>
 
</html>
 
\ No newline at end of file
app_bootstrap/templates/app_name/index.html
Show inline comments
 
new file 100644
 
{% templatetag openblock %} extends '{{ app_name }}/base.html' {% templatetag closeblock %}
app_bootstrap/urls.py
Show inline comments
 
new file 100644
 
from django.conf.urls import url
 

	
 
from . import views
 

	
 
urlpatterns = [
 
    url(r'^$', views.IndexView.as_view(), name='index'),
 
]
app_bootstrap/views.py
Show inline comments
 
from django.shortcuts import render
 
from django.views import generic
 

	
 
# Create your views here.
 

	
 
class IndexView(generic.TemplateView):
 
    template_name = "{{ app_name }}/index.html"
0 comments (0 inline, 0 general)