Skip to content

Saleor Core: the high performance, composable, headless commerce API.

add base.html

Marek Brzóskae6857bff5fd9
diff --git a/saleor/settings.py b/saleor/settings.py
index 050352a04b..971b1f3987 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -1,8 +1,13 @@
# Django settings for saleor project.
+import os
+from os.path import join, normpath, dirname
+
DEBUG = True
TEMPLATE_DEBUG = DEBUG
+PROJECT_ROOT = normpath(join(dirname(__file__), '..'))
+
ADMINS = (
# ('Your Name', '[email protected]'),
)
@@ -106,6 +111,7 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
+ os.path.join(PROJECT_ROOT, 'saleor', 'templates'),
)
INSTALLED_APPS = (
diff --git a/saleor/templates/base.html b/saleor/templates/base.html
new file mode 100644
index 0000000000..7670f8c637
--- /dev/null
+++ b/saleor/templates/base.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html>
+<head>
+{% block head %}
+ <title>{% block title %}Sale or...!{% endblock %}</title>
+ {% block meta %}
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="{% block meta_description %}{% endblock %}">
+ <meta name="author" content="Mirumee Software">
+ {% endblock %}
+
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ </style>
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css" rel="stylesheet">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+ <!--[if lt IE 9]>
+ <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+{% endblock %}
+</head>
+
+<body>
+{% block body %}
+
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ Menu
+ </a>
+ <a class="brand" href="#">Saleor</a>
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ <li class="active"><a href="/">Home</a></li>
+ <li><a href="#">About</a></li>
+ <li><a href="#">Contact</a></li>
+ </ul>
+ <p class="navbar-text pull-right">
+ {% if user.is_authenticated %}
+ Logged in as <a href="#" class="navbar-link">{{ user }}</a>
+ {% else %}
+ <a href="#" class="navbar-link">Log in</a>
+ {% endif %}
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container-fluid">
+ <div class="row-fluid">
+ {% block content %}
+ {% endblock %}
+ </div><!--/row-->
+
+ <hr>
+
+ <footer>
+ <p>&copy; Mirumee Labs 2013</p>
+ </footer>
+ </div><!--/.fluid-container-->
+
+
+{% endblock %}
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
+<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
+</body>
+</html>
diff --git a/saleor/urls.py b/saleor/urls.py
index c5235c9112..6b11f6e73a 100644
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -5,8 +5,7 @@ from django.conf.urls import patterns, include, url
# admin.autodiscover()
urlpatterns = patterns('',
- # Examples:
- # url(r'^$', 'saleor.views.home', name='home'),
+ url(r'^$', 'saleor.views.home', name='home'),
# url(r'^saleor/', include('saleor.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
diff --git a/saleor/views.py b/saleor/views.py
new file mode 100644
index 0000000000..788132b98f
--- /dev/null
+++ b/saleor/views.py
@@ -0,0 +1,5 @@
+from django.shortcuts import render
+
+
+def home(request):
+ return render(request, 'base.html')