Skip to content

Commit 96958a0

Browse files
committed
Tailwind is still blowing...
1 parent 0ca94ce commit 96958a0

File tree

5 files changed

+76
-52
lines changed

5 files changed

+76
-52
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ $ python manage.py migrate
2323
$ python manage.py runserver
2424
```
2525

26+
Tailwind CSS 작업을 위해 다른 창에서 다음을 실행
27+
```
28+
$ python manage.py tailwind start
29+
```
30+
2631
## Django settings
2732
- pythonkr_backend.settings # local sqlite testing
2833
- pythonkr_backend.settings.localtesting # docker compose testing

entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ uv sync
77
cd /app/pythonkr_backend
88
export DJANGO_SETTINGS_MODULE="pythonkr_backend.settings.localtesting"
99
./manage.py migrate --no-input
10+
./manage.py tailwind build
1011
./manage.py collectstatic --clear --noinput
1112
export DJANGO_SUPERUSER_PASSWORD=test
1213
./manage.py createsuperuser --username test --email [email protected] --noinput
1314
gunicorn --workers=2 \
1415
-b :8080 \
1516
--access-logfile - \
1617
--error-logfile - \
17-
pythonkr_backend.wsgi
18+
pythonkr_backend.wsgi

pythonkr_backend/pythonkr/templates/pythonkr/pk_base.html

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,78 @@
11
{% load static %}
2+
{% load tailwind_tags %}
23
{% load wagtailcore_tags %}
34
{% load wagtailimages_tags %}
45
{% wagtail_site as current_site %}
6+
57
<!DOCTYPE html>
6-
<html lang="en">
8+
<html lang="ko">
79
<head>
8-
<meta charset="UTF-8">
9-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
10-
<title>{% block title %}Python Korea{% endblock title %}</title>
11-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css">
12-
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.13.5/cdn.min.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
14-
<style>
15-
html, body {
16-
height: 100%;
17-
margin: 0;
18-
}
19-
body {
20-
padding-top: 40px;
21-
display: flex;
22-
flex-direction: column;
23-
}
24-
main {
25-
flex: 1;
26-
}
27-
footer {
28-
background-color: #f8f9fa;
29-
margin-bottom: 20px;
30-
}
31-
</style>
10+
<meta charset="UTF-8">
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12+
<title>{% block title %}파이썬 한국 사용자 모임{% endblock title %}</title>
13+
{% tailwind_css %}
3214
</head>
33-
<body>
34-
<!-- Navigation -->
35-
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
36-
<div class="container">
37-
<a class="navbar-brand" href="{% pageurl current_site.root_page %}">
38-
<img src="{% static 'pythonkr/pythonkr-badge.png' %}" alt="Python Korea Logo"
39-
height="80"/>
40-
</a>
41-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
42-
<span class="navbar-toggler-icon"></span>
43-
</button>
44-
<div class="collapse navbar-collapse" id="navbarNav">
45-
<ul class="navbar-nav ms-auto">
46-
{% for menu_page in current_site.root_page.get_children.live.in_menu %}
47-
<li class="nav-item"><a class="nav-link" href="{% pageurl menu_page %}">{{menu_page.title}}</a></li>
48-
{% endfor %}
49-
</ul>
50-
</div>
15+
<body class="bg-gray-100">
16+
<nav class="bg-white shadow-md">
17+
<div class="container mx-auto px-4">
18+
<div class="flex justify-between items-center py-4">
19+
<a class="navbar-brand" href="{% pageurl current_site.root_page %}">
20+
<img src="{% static 'pythonkr/pythonkr-badge.png' %}" alt="Python Korea Logo" height="80"/>
21+
</a>
22+
<a href="#" class="text-xl font-bold text-gray-800">Python Korea</a>
23+
<div class="hidden md:flex space-x-4">
24+
{% for menu_page in current_site.root_page.get_children.live.in_menu %}
25+
<a class="text-gray-600 hover:text-gray-800" href="{% pageurl menu_page %}">{{menu_page.title}}</a>
26+
{% endfor %}
27+
</div>
28+
<div class="md:hidden">
29+
<button id="mobile-menu-button" class="text-gray-600 focus:outline-none">
30+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
31+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
32+
</svg>
33+
</button>
34+
</div>
35+
</div>
36+
</div>
37+
<div id="mobile-menu" class="hidden md:hidden">
38+
{% for menu_page in current_site.root_page.get_children.live.in_menu %}
39+
<a class="block px-4 py-2 text-gray-600 hover:bg-gray-200" href="{% pageurl menu_page %}">{{menu_page.title}}</a>
40+
{% endfor %}
41+
</div>
42+
</nav>
43+
44+
<main class="container mx-auto px-4 py-8">
45+
{% block content %}{{ page.content|richtext }}{% endblock %}
46+
</main>
47+
48+
<footer class="bg-white border-t mt-12">
49+
<div class="container mx-auto px-4 py-8">
50+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center space-y-4 md:space-y-0">
51+
<!-- 로고 및 설명 -->
52+
<div>
53+
<h2 class="text-lg font-semibold text-gray-800">Python Korea</h2>
54+
<p class="text-sm text-gray-500 mt-1">
55+
파이썬 한국 사용자 모임은 파이썬을 사용하는 모든 사람들을 위한 열린 커뮤니티입니다.
56+
</p>
5157
</div>
52-
</nav>
58+
</div>
59+
60+
<div class="border-t mt-6 pt-4 text-center text-sm text-gray-400">
61+
© 2025 Python Korea. All rights reserved.
62+
</div>
63+
</div>
64+
</footer>
5365

54-
<!-- Main Content -->
55-
<main class="container mt-5 pt-5">
56-
{% block content %}
57-
{{ page.content|richtext }}
58-
{% endblock %}
59-
</main>
66+
<script>
67+
const mobileMenuButton = document.getElementById('mobile-menu-button');
68+
const mobileMenu = document.getElementById('mobile-menu');
6069

70+
mobileMenuButton.addEventListener('click', () => {
71+
mobileMenu.classList.toggle('hidden');
72+
});
73+
</script>
74+
</body>
75+
</html>
6176
<!-- Footer -->
6277
<footer class="sponsor-footer mt-5">
6378
<div class="container text-center">

pythonkr_backend/pythonkr_backend/settings/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"wagtailbakery",
5757
"tailwind",
5858
"theme",
59+
"django_browser_reload",
5960
"pythonkr",
6061
]
6162

@@ -68,6 +69,7 @@
6869
'django.contrib.messages.middleware.MessageMiddleware',
6970
'django.middleware.clickjacking.XFrameOptionsMiddleware',
7071
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
72+
'django_browser_reload.middleware.BrowserReloadMiddleware',
7173
]
7274

7375
ROOT_URLCONF = 'pythonkr_backend.urls'

pythonkr_backend/pythonkr_backend/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
path("admin/", admin.site.urls),
3232
path("cms/", include(wagtailadmin_urls)),
3333
path("documents/", include(wagtaildocs_urls)),
34+
path("__reload__/", include("django_browser_reload.urls")),
3435
path("", include(wagtail_urls)),
3536
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
3637

37-
urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images'))
38+
urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images'))

0 commit comments

Comments
 (0)