Merge pull request #1 from flifloo/flifloo

Base of template and statics
This commit is contained in:
Ethanell 2021-12-02 19:31:38 +01:00 committed by GitHub
commit b20034a79a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,6 @@
from django.db.models import Model, CharField, TextField
class Rescue(Model):
name = CharField(max_length="256")
text = TextField()

View file

View file

@ -9,7 +9,7 @@ https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from os import path
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-85h5=0vw&7e)%9+^n69y!b1ti@7gij_ic3u+66eln838s=!n+l
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["3cab-134-214-214-199.ngrok.io", "localhost"]
# Application definition
@ -120,6 +120,10 @@ USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = ''
STATICFILES_DIRS = (path.join('static'),)
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

View file

@ -16,6 +16,9 @@ Including another URLconf
from django.contrib import admin
from django.urls import path
from nuitdelinfo_2021 import views
urlpatterns = [
path('', views.index, name="index"),
path('admin/', admin.site.urls),
]

View file

@ -0,0 +1 @@
from .index import index

View file

@ -0,0 +1,6 @@
from django.shortcuts import render
def index(request):
context = {}
return render(request, "index.html", context)

3
static/css/style.css Normal file
View file

@ -0,0 +1,3 @@
h1 {
color: red;
}

1
static/js/script.js Normal file
View file

@ -0,0 +1 @@
console.log("Hewo :3");

5
templates/index.html Normal file
View file

@ -0,0 +1,5 @@
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
<script src="{% static 'js/script.js' %}"></script>
<h1>Hewo World :3</h1>