diff --git a/litl/migrations/0001_initial.py b/litl/migrations/0001_initial.py new file mode 100644 index 0000000..5982fff --- /dev/null +++ b/litl/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 3.1.4 on 2020-12-19 17:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Slug', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('slug', models.SlugField(help_text='Slug of the new URL. Up to 20 caracters including letters, number, underscores and hyphens.', max_length=20)), + ('destination', models.CharField(help_text='The destination URL, limited to 300 characters.', max_length=300)), + ('uid', models.CharField(max_length=100, null=True)), + ('date', models.DateTimeField(auto_now=True)), + ], + ), + ] diff --git a/litl/migrations/__init__.py b/litl/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/litl/settings.py b/litl/settings.py index 3cdbdc6..9a47c86 100644 --- a/litl/settings.py +++ b/litl/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path +import os from .local_settings import * @@ -31,6 +32,7 @@ ALLOWED_HOSTS = ['litl.auro.re',] INSTALLED_APPS = [ 'litl', + 'bootstrap4', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -54,7 +56,7 @@ ROOT_URLCONF = 'litl.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [os.path.join(BASE_DIR,'templates').replace("\\","/"),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/litl/templates/base.html b/litl/templates/base.html new file mode 100644 index 0000000..77c459e --- /dev/null +++ b/litl/templates/base.html @@ -0,0 +1,26 @@ +{% load bootstrap4 %} + +{% bootstrap_css %} +{% bootstrap_javascript jquery='full' %} + +
+

My First Bootstrap Page

+

Resize this responsive page to see the effect!

+
+ +
+
+
+

Column 1

+

Lorem ipsum dolor..

+
+
+

Column 2

+

Lorem ipsum dolor..

+
+
+

Column 3

+

Lorem ipsum dolor..

+
+
+
diff --git a/litl/urls.py b/litl/urls.py index 28d8c76..f199137 100644 --- a/litl/urls.py +++ b/litl/urls.py @@ -16,6 +16,9 @@ Including another URLconf from django.contrib import admin from django.urls import path +from .views import index + urlpatterns = [ path('admin/', admin.site.urls), + path('', index, name="index"), ] diff --git a/litl/views.py b/litl/views.py new file mode 100644 index 0000000..b4e82fb --- /dev/null +++ b/litl/views.py @@ -0,0 +1,15 @@ +# coding: utf-8 +# Author: Grizzly +# +# Views for litl. + +from django.shortcuts import render + +from .settings import TEMPLATES + +def index(request): + """Display the home page of the site. + TODO: Search and display the urls shortened by the user in the past. + """ + context = {} + return render(request,'base.html',context)