Base of template and statics
This commit is contained in:
parent
8a92ec0451
commit
e3d1a776be
9 changed files with 31 additions and 2 deletions
6
nuitdelinfo_2021/models/Rescue.py
Normal file
6
nuitdelinfo_2021/models/Rescue.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.db.models import Model, CharField, TextField
|
||||
|
||||
|
||||
class Rescue(Model):
|
||||
name = CharField(max_length="256")
|
||||
text = TextField()
|
0
nuitdelinfo_2021/models/__init__.py
Normal file
0
nuitdelinfo_2021/models/__init__.py
Normal 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
|
||||
|
||||
|
|
|
@ -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),
|
||||
]
|
||||
|
|
1
nuitdelinfo_2021/views/__init__.py
Normal file
1
nuitdelinfo_2021/views/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .index import index
|
6
nuitdelinfo_2021/views/index.py
Normal file
6
nuitdelinfo_2021/views/index.py
Normal 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
3
static/css/style.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
h1 {
|
||||
color: red;
|
||||
}
|
1
static/js/script.js
Normal file
1
static/js/script.js
Normal file
|
@ -0,0 +1 @@
|
|||
console.log("Hewo :3");
|
5
templates/index.html
Normal file
5
templates/index.html
Normal 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>
|
Loading…
Reference in a new issue