Improvements
- Titles on pages - Time display is no longer awful - Add favicon and apple-touch-icon - Remove default django installed apps - Make sure static directory is version controlled
This commit is contained in:
parent
940fb88def
commit
775e9ce72f
|
@ -1,7 +1,7 @@
|
|||
venv
|
||||
.idea
|
||||
db.sqlite3
|
||||
/venv
|
||||
/.idea
|
||||
/db.sqlite3
|
||||
/static
|
||||
/log
|
||||
stale_outputs_checked
|
||||
__pycache__
|
||||
static
|
||||
log
|
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 340 B |
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 542 B |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -3,10 +3,13 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Title</title>
|
||||
<title>Thoughts</title>
|
||||
|
||||
{% load static %}
|
||||
<link href="{% static "main/main.css" %}" rel="stylesheet">
|
||||
<link href="{% static 'main/main.css' %}" rel="stylesheet">
|
||||
|
||||
<link rel="icon" sizes="192x192" href="{% static 'images/favicon-192x192.png'%}">
|
||||
<link rel="apple-touch-icon" href="{% static 'images/apple-touch-icon.png'%}"/>
|
||||
</head>
|
||||
<body>
|
||||
<header><span class="text">Thoughts</span>{% if authenticated %}
|
||||
|
@ -50,8 +53,18 @@
|
|||
const timestampEl = el.querySelector(".timestamp");
|
||||
const time = new Date(timestampEl.textContent);
|
||||
const ampm = time.getHours() > 12 ? "pm" : "am";
|
||||
timestampEl.textContent = `${time.getFullYear()}-${time.getMonth()}-${time.getDate()}, ${Math.abs(time.getHours() - 12)}:${time.getMinutes()}${ampm}`
|
||||
let hours = time.getHours(); // 0-23
|
||||
if (hours === 0) {
|
||||
hours = 12;
|
||||
}else {
|
||||
hours %= 12;
|
||||
}
|
||||
let minutes = time.getMinutes().toString();
|
||||
if (minutes.length < 2) {
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
timestampEl.textContent = `${time.getFullYear()}-${time.getMonth()}-${time.getDate()}, ${hours}:${minutes}${ampm}`
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Title</title>
|
||||
<title>Post</title>
|
||||
|
||||
{% load static %}
|
||||
<link href="{% static "main/main.css" %}" rel="stylesheet">
|
||||
<link href="{% static "main/post.css" %}" rel="stylesheet">
|
||||
<link href="{% static 'main/main.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'main/post.css' %}" rel="stylesheet">
|
||||
|
||||
<link rel="icon" sizes="192x192" href="{% static 'images/favicon-192x192.png'%}">
|
||||
<link rel="apple-touch-icon" href="{% static 'images/apple-touch-icon.png'%}"/>
|
||||
</head>
|
||||
<body>
|
||||
<header><a href="/" class="text" style="border: none">Thoughts</a> <span class="text">Post</span></header>
|
||||
|
@ -43,4 +45,4 @@
|
|||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -23,30 +23,23 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||
SECRET_KEY = 'qdm4_0b)3^)k$6r($!o^a7&0l#^6)@g2wr!x0r40ii@9otfnwo'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = False
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ["192.168.1.124", "thoughts.learnerpages.com"]
|
||||
ALLOWED_HOSTS = ["192.168.1.124", "thoughts.learnerpages.com", "localhost"]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'main',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
|
@ -61,8 +54,6 @@ TEMPLATES = [
|
|||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -82,25 +73,6 @@ DATABASES = {
|
|||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/3.1/topics/i18n/
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ Including another URLconf
|
|||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
from main import views
|
||||
|
|
Loading…
Reference in New Issue