add stub portal app with 'work in progress' message; configure template system

This commit is contained in:
Jan Koppe 2020-04-26 04:46:44 +02:00
parent 805e2911f8
commit af49f2d749
Signed by: thunfisch
GPG Key ID: BE935B0735A2129B
13 changed files with 66 additions and 2 deletions

0
portal/__init__.py Normal file
View File

3
portal/admin.py Normal file
View File

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

5
portal/apps.py Normal file
View File

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

View File

3
portal/models.py Normal file
View File

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

View File

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block 'body' %}
<main class="container" role="main">
<h1>Portier</h1>
<p class="leader">Nothing to see here yet. We're working on it, though!</p>
<p><a href="https://github.com/chaoswest-tv/portier">See progress on GitHub</a></p>
</main>
{% endblock %}

3
portal/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
portal/urls.py Normal file
View File

@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

7
portal/views.py Normal file
View File

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

View File

@ -36,6 +36,9 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap4',
'fa',
'portal.apps.PortalConfig',
'rtmp.apps.RtmpConfig',
'restream.apps.RestreamConfig',
]
@ -55,7 +58,7 @@ ROOT_URLCONF = 'portier.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [

View File

@ -18,5 +18,6 @@ from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('rtmp/', include('rtmp.urls'))
path('rtmp/', include('rtmp.urls')),
path('', include('portal.urls')),
]

View File

@ -1,4 +1,6 @@
django>=3.0
django-bootstrap4
django-fa
celery>=4.4
gunicorn>=20
psycopg2-binary

22
templates/base.html Normal file
View File

@ -0,0 +1,22 @@
{% load bootstrap4 %}
{% load font_awesome %}
<!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>{% block 'title' %}portier{% endblock %}</title>
{% bootstrap_css %}
{% fa_css %}
{% bootstrap_javascript jquery='full' %}
</head>
<body>
{% bootstrap_messages %}
{% block 'body' %}
{% endblock %}
</body>
</html>