瀏覽代碼

Added fisrt view

Denis Merigoux 11 年之前
父節點
當前提交
aad198f351
共有 4 個文件被更改,包括 100 次插入1 次删除
  1. 4 1
      LAPI/urls.py
  2. 63 0
      census/templates/baseTemplate.html
  3. 29 0
      census/templates/homeTemplate.html
  4. 4 0
      census/views.py

+ 4 - 1
LAPI/urls.py

@@ -1,10 +1,13 @@
1 1
 from django.conf.urls import patterns, include, url
2 2
 from django.contrib import admin
3
+from census.views import home
3 4
 
4
-urlpatterns = patterns('',
5
+urlpatterns = patterns('census.views',
5 6
     # Examples:
6 7
     # url(r'^$', 'LAPI.views.home', name='home'),
7 8
     # url(r'^blog/', include('blog.urls')),
8 9
 
9 10
     url(r'^admin/', include(admin.site.urls)),
11
+    url(r'^home/$', 'home'),
12
+    url(r'^$', 'home'),
10 13
 )

+ 63 - 0
census/templates/baseTemplate.html

@@ -0,0 +1,63 @@
1
+{% load static %}
2
+<!DOCTYPE html>
3
+<html>
4
+<head>
5
+	<meta charset="UTF-8"/>
6
+	<meta name="author" content="Denis Merigoux"/>
7
+	<meta name="keywords" content="LAPI amphis statistiques"/>
8
+	<meta name="description" content="Site web du Laboratoire pour l'Acquisition Périphérique d'Informations"/>
9
+	<!--<link rel="shortcut icon" href="favicon.ico" />-->
10
+	<title>LAPI – {% block title %}{% endblock %}</title>
11
+
12
+	{# Load the tag library #}
13
+	{% load bootstrap3 %}
14
+
15
+	{# Load CSS and JavaScript #}
16
+	{% bootstrap_css %}
17
+	{% bootstrap_javascript %}
18
+
19
+	{# Display django.contrib.messages as Bootstrap alerts #}
20
+	{% bootstrap_messages %}
21
+
22
+	{# Load the StickyFooter add-on #}
23
+	<link href="{% static 'sticky-footer.css' %}" media="all" rel="stylesheet" />
24
+</head> 
25
+<body>
26
+	<nav>
27
+		<nav class="navbar navbar-default">
28
+			<div class="container-fluid">
29
+				<!-- Brand and toggle get grouped for better mobile display -->
30
+				<div class="navbar-header">
31
+					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
32
+						<span class="sr-only">Toggle navigation</span>
33
+						<span class="icon-bar"></span>
34
+						<span class="icon-bar"></span>
35
+						<span class="icon-bar"></span>
36
+					</button>
37
+					<a class="navbar-brand" href="{% url 'census.views.home' %}">LAPI</a>
38
+				</div>
39
+
40
+				<!-- Collect the nav links, forms, and other content for toggling -->
41
+				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
42
+					<ul class="nav navbar-nav">
43
+						{% block nav %}
44
+						<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
45
+						<li><a href="#">Link</a></li>
46
+						{% endblock %}
47
+					</ul>
48
+					<ul class="nav navbar-nav navbar-right">
49
+					</ul>
50
+				</div><!-- /.navbar-collapse -->
51
+			</div><!-- /.container-fluid -->
52
+		</nav>
53
+	</nav>
54
+	<section id="content">
55
+		{% block content %}{% endblock %}
56
+	</section>
57
+	<footer class="footer">
58
+      <div class="container">
59
+        <p class="text-muted" style="float:right">&copy; LAPI – 2015</p>
60
+      </div>
61
+    </footer>
62
+</body>
63
+</html>

+ 29 - 0
census/templates/homeTemplate.html

@@ -0,0 +1,29 @@
1
+{% extends 'baseTemplate.html' %}
2
+{% block title %}Accueil{% endblock %}
3
+{% block nav %}{% endblock %}
4
+{% block content %}
5
+<div class="container-fluid">
6
+	<div class="row">
7
+		<div class="col-md-4">
8
+			<div class="panel panel-primary">
9
+				<div class="panel-heading">
10
+					<h2 class="panel-title">Présentation</h2>
11
+				</div>
12
+				<div class="panel-body">
13
+					Bienvenue sur le site du Laboratoire pour l'Acquisition Périphérique d'Informations !
14
+				</div>
15
+			</div>
16
+		</div>
17
+		<div class="col-md-4">
18
+			<div class="panel panel-default">
19
+				<div class="panel-heading">
20
+					<h2 class="panel-title">Cours</h2>
21
+				</div>
22
+				<div class="panel-body">
23
+					Bienvenue sur le site du Laboratoire pour l'Acquisition Périphérique d'Informations !
24
+				</div>
25
+			</div>
26
+		</div>
27
+	</div>
28
+</div>
29
+{% endblock %}

+ 4 - 0
census/views.py

@@ -1,3 +1,7 @@
1 1
 from django.shortcuts import render
2
+from django.http import Http404
2 3
 
3 4
 # Create your views here.
5
+
6
+def home(request):
7
+	return render(request,'homeTemplate.html')