add first control app

This commit is contained in:
Laura Klünder 2016-08-17 14:34:43 +02:00
parent 6b373246e8
commit 0f65f63eab
11 changed files with 91 additions and 16 deletions

View file

View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ControlConfig(AppConfig):
name = 'control'

View file

View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

@ -0,0 +1,57 @@
{% load static %}
{% load compress %}
<!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">
<title>Dashboard Template for Bootstrap</title>
{% compress css %}
<link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
{% endcompress %}
</head>
<body>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">c3nav Administration</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Django Admin</a></li>
<li><a href="#">Logout</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-4 col-md-3">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#">AAA</a></li>
<li><a href="#">BBB</a></li>
<li><a href="#">CCC</a></li>
</ul>
</div>
<div class="col-sm-8 col-md-9">
<h2>Dashboard</h2>
</div>
</div>
</div>
{% compress js %}
<script type="text/javascript" src="{% static 'jquery/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
{% endcompress %}
</body>
</html>

View file

@ -0,0 +1,7 @@
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
]

View file

@ -0,0 +1,7 @@
from django.shortcuts import render
def index(request):
return render(request, 'control/base.html')
# Create your views here.

View file

@ -102,6 +102,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'compressor', 'compressor',
'bootstrap3', 'bootstrap3',
'c3nav.control',
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE_CLASSES = [
@ -169,6 +170,10 @@ STATICFILES_FINDERS = (
'compressor.finders.CompressorFinder', 'compressor.finders.CompressorFinder',
) )
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
COMPRESS_ENABLED = COMPRESS_OFFLINE = not debug_fallback COMPRESS_ENABLED = COMPRESS_OFFLINE = not debug_fallback
COMPRESS_CSS_FILTERS = ( COMPRESS_CSS_FILTERS = (

View file

@ -1,21 +1,9 @@
"""c3nav URL Configuration from django.conf.urls import include, url
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin from django.contrib import admin
from .control import urls as control_urls
urlpatterns = [ urlpatterns = [
url(r'^control/', include(control_urls)),
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
] ]