Initial commit of friendly_cat Django app

Base files generated using:

```sh
django-admin startapp friendly_cat
```
This commit is contained in:
coox 2020-05-11 21:44:20 +02:00
parent da6b46073d
commit 50139cea19
7 changed files with 55 additions and 1 deletions

0
friendly_cat/__init__.py Normal file
View file

10
friendly_cat/apps.py Normal file
View 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"

View 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
View 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
View 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")

View file

@ -48,6 +48,7 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"friendly_cat",
]
MIDDLEWARE = [

View file

@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path
urlpatterns = [
path("", include("friendly_cat.urls")),
path("admin/", admin.site.urls),
]