Initial commit of friendly_cat Django app
Base files generated using: ```sh django-admin startapp friendly_cat ```
This commit is contained in:
parent
da6b46073d
commit
50139cea19
7 changed files with 55 additions and 1 deletions
0
friendly_cat/__init__.py
Normal file
0
friendly_cat/__init__.py
Normal file
10
friendly_cat/apps.py
Normal file
10
friendly_cat/apps.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
"""
|
||||||
|
Configuration of the friendly_cat Django app
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class FriendlyCatConfig(AppConfig):
|
||||||
|
name = "friendly_cat"
|
||||||
|
verbose_name = "Friendly Cat"
|
23
friendly_cat/templates/friendly_cat/index.html
Normal file
23
friendly_cat/templates/friendly_cat/index.html
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<title>ungleich_screening_task</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
{% with default_pic_width=400 default_pic_height=400 %}
|
||||||
|
<figure>
|
||||||
|
<img
|
||||||
|
width="{{ pic_width|default:default_pic_width }}"
|
||||||
|
height="{{ pic_height|default:default_pic_height }}"
|
||||||
|
src="https://placekitten.com/{{ pic_width|default:default_pic_width }}/{{ pic_height|default:default_pic_height }}" alt="A friendly cat picture"
|
||||||
|
/>
|
||||||
|
<figcaption>A friendly cat picture</figcaption>
|
||||||
|
</figure>
|
||||||
|
{% endwith %}
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
10
friendly_cat/urls.py
Normal file
10
friendly_cat/urls.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
"""
|
||||||
|
URLs for the friendly_cat Django app
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.urls import path
|
||||||
|
from friendly_cat import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("", views.index, name="index"),
|
||||||
|
]
|
9
friendly_cat/views.py
Normal file
9
friendly_cat/views.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
"""
|
||||||
|
Views for the friendly_cat Django app
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
return render(request, "friendly_cat/index.html")
|
|
@ -48,6 +48,7 @@ INSTALLED_APPS = [
|
||||||
"django.contrib.sessions",
|
"django.contrib.sessions",
|
||||||
"django.contrib.messages",
|
"django.contrib.messages",
|
||||||
"django.contrib.staticfiles",
|
"django.contrib.staticfiles",
|
||||||
|
"friendly_cat",
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|
|
@ -14,8 +14,9 @@ Including another URLconf
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import include, path
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path("", include("friendly_cat.urls")),
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue