Browse Source

update

master
Jakub Škrabánek 3 years ago
parent
commit
523025517f
  1. 1
      firstapp/static/firstapp/h1.css
  2. 17
      firstapp/templates/a_base.html
  3. 6
      firstapp/templates/a_home.html
  4. 14
      firstapp/templates/a_index.html
  5. 1
      firstapp/urls.py
  6. 3
      firstapp/views.py
  7. 6
      poznamky.md
  8. 1
      print.py
  9. 3
      reproject/settings.py
  10. 1
      static/h1.css

1
firstapp/static/firstapp/h1.css

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

17
firstapp/templates/a_base.html

@ -0,0 +1,17 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %} {% endblock %}</title>
<link rel="stylesheet" href="{% static 'firstapp/h1.css' %}">
</head>
<body>
<h1>First APP preview</h1>
{% block content%}
{% endblock %}
</body>
</html>

6
firstapp/templates/a_home.html

@ -0,0 +1,6 @@
{% extends "a_base.html" %}
{% block content %}
<h1>First Home</h1>
<a href="/a"><h2>Index</h2></a>
{% endblock %}

14
firstapp/templates/a_index.html

@ -1,10 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index A</title>
</head>
<body>
{% extends "a_base.html" %}
{% block content %}
<h1>Index A</h1>
</body>
</html>
<a href="/a/home"><h2>A_Home</h2></a>
{% endblock %}

1
firstapp/urls.py

@ -4,4 +4,5 @@ from . import views
urlpatterns = [
path("",views.a_index, name='a_index'),
path("home/",views.a_home, name="a_home")
]

3
firstapp/views.py

@ -3,3 +3,6 @@ from django.shortcuts import render
# Create your views here.
def a_index(request):
return render(request,"a_index.html")
def a_home(request):
return render(request,"a_home.html")

6
poznamky.md

@ -0,0 +1,6 @@
python manage.py runserver
python manage.py migrate
.venv\Scripts\activate.bat
pip list
pip install django

1
print.py

@ -1 +1,2 @@
print("Hello World!")

3
reproject/settings.py

@ -120,6 +120,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static"
]
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

1
static/h1.css

@ -0,0 +1 @@
h1 {color: green;}
Loading…
Cancel
Save