Skip to content

Commit ffcef97

Browse files
authored
Merge pull request #18 from lqez/main
Apply styles and add fixtures
2 parents 34cb90f + 3da659c commit ffcef97

File tree

25 files changed

+1983
-90
lines changed

25 files changed

+1983
-90
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,6 @@ cython_debug/
169169

170170
# PyPI configuration file
171171
.pypirc
172+
173+
# Misc
174+
.DS_Store

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
# python.or.kr-wip
22

3-
# 개발 환경 구축
3+
## 개발 환경 구축
44

5-
```
6-
docker compose up
7-
```
5+
### 1. Docker compose 이용
86

9-
http://localhost:8080/cms/
7+
테스트용 계정 정보
8+
- id: test
9+
- password: test
1010

11-
test / test
11+
```
12+
$ docker-compose up
13+
```
14+
- 접속 URL: http://localhost:8080/cms/
1215

1316

14-
# settings
17+
### 2. Django runserver 이용
18+
19+
```
20+
$ source .venv/bin/activate
21+
$ cd pythonkr_backend
22+
$ python manage.py migrate
23+
$ python manage.py runserver
24+
```
25+
26+
Tailwind CSS 작업을 위해 다른 창에서 다음을 실행
27+
```
28+
$ python manage.py tailwind start
29+
```
30+
31+
## Django settings
1532
- pythonkr_backend.settings # local sqlite testing
1633
- pythonkr_backend.settings.localtesting # docker compose testing
1734
- pythonkr_backend.settings.prod # production

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

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ requires-python = ">=3.12"
77
dependencies = [
88
"beautifulsoup4>=4.13.3",
99
"django>=5.1.7",
10+
"django-tailwind[reload]>=3.8.0",
1011
"gunicorn>=23.0.0",
1112
"httpx>=0.28.1",
1213
"llm>=0.24.2",

pythonkr_backend/pythonkr/fixtures/pythonkr.json

Lines changed: 37 additions & 0 deletions
Large diffs are not rendered by default.

pythonkr_backend/pythonkr/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
3030
name='PKHomePage',
3131
fields=[
3232
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
33-
('body', wagtail.fields.RichTextField(blank=True)),
33+
('content', wagtail.fields.RichTextField(blank=True)),
3434
],
3535
options={
3636
'abstract': False,

pythonkr_backend/pythonkr/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Meta:
1313
abstract = True
1414

1515
def get_context(self, request, *args, **kwargs):
16-
"common context for PK"
16+
"common context for Python Korea"
1717
context = super().get_context(request, *args, **kwargs)
1818

1919
SponsorPageModel = apps.get_model("pythonkr", "PKSponsors")
@@ -81,17 +81,17 @@ def save(self, *args, **kwargs):
8181

8282
class PKHomePage(PKBasePage):
8383
template = "pythonkr/pk_home.html"
84-
body = RichTextField(blank=True)
84+
content = RichTextField(blank=True)
8585

8686
subpage_types = [
8787
PKPage,
8888
PKDocPage,
8989
]
9090

9191
content_panels = Page.content_panels + [
92-
FieldPanel("body"),
92+
FieldPanel("content"),
9393
]
9494

9595
def get_context(self, request, *args, **kwargs):
9696
context = super().get_context(request, *args, **kwargs)
97-
return context
97+
return context
Binary file not shown.
Binary file not shown.
Loading
Lines changed: 76 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,88 @@
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 Asia{% 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 'pao/01-Main2.png' %}" alt="Python Asia Organization 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-white min-h-screen flex flex-col">
16+
<!-- 내비게이션 -->
17+
<nav class="bg-white border-b">
18+
<div class="container mx-auto px-4">
19+
<div class="flex justify-between items-center py-4">
20+
<!-- 로고 + 텍스트 타이틀 -->
21+
<div class="flex flex-row items-center space-x-4 w-auto">
22+
<a class="navbar-brand" href="{% pageurl current_site.root_page %}">
23+
<img class="h-12 mx-auto md:mx-0" src="{% static 'pythonkr/pythonkr-badge.png' %}" alt="Python Korea Logo"/>
24+
</a>
25+
<h1 class="text-xl font-bold text-gray-800 mt-2 md:mt-0 text-center md:text-left">
26+
파이썬 한국 사용자 모임
27+
</h1>
28+
</div>
29+
<!-- 내비게이션 -->
30+
<div class="hidden md:flex space-x-4">
31+
{% for menu_page in current_site.root_page.get_children.live.in_menu %}
32+
<a class="text-gray-600 hover:text-gray-800" href="{% pageurl menu_page %}">{{ menu_page.title }}</a>
33+
{% endfor %}
34+
</div>
35+
<!-- 모바일 메뉴 버튼 -->
36+
<div class="md:hidden">
37+
<button id="mobile-menu-button" class="text-gray-600 focus:outline-none">
38+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
39+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
40+
d="M4 6h16M4 12h16M4 18h16"></path>
41+
</svg>
42+
</button>
5143
</div>
52-
</nav>
44+
</div>
45+
</div>
46+
<!-- 모바일 메뉴 -->
47+
<div id="mobile-menu" class="hidden md:hidden px-4 pb-4">
48+
{% for menu_page in current_site.root_page.get_children.live.in_menu %}
49+
<a class="block py-2 text-gray-600 hover:bg-gray-200" href="{% pageurl menu_page %}">{{ menu_page.title }}</a>
50+
{% endfor %}
51+
</div>
52+
</nav>
5353

54-
<!-- Main Content -->
55-
<main class="container mt-5 pt-5">
56-
{% block content %}{% endblock content %}
57-
</main>
54+
<!-- 메인 -->
55+
<main class="flex-grow container mx-auto px-4 py-8">
56+
<div class="prose">
57+
{% block content %}{{ page.content|richtext }}{% endblock %}
58+
</div>
59+
</main>
5860

59-
<!-- Footer -->
60-
<footer class="sponsor-footer mt-5">
61-
<div class="container text-center">
62-
<h4 class="text-center mb-4">Our Sponsors</h4>
63-
<div class="row justify-content-center">
64-
{% for sponsor in sponsors %}
65-
<div class="col-md-3 col-6 text-center mb-3">
66-
<img src="{{ sponsor.logo }}" alt="{{ sponsor.name }}" class="img-fluid" style="max-height: 60px;">
67-
</div>
68-
{% endfor %}
69-
</div>
61+
<!-- 푸터 -->
62+
<footer class="bg-white border-t">
63+
<div class="container mx-auto px-4 py-8">
64+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center space-y-4 md:space-y-0">
65+
<!-- 로고 및 설명 -->
66+
<div>
67+
<h2 class="text-lg font-semibold text-gray-800">Python Korea</h2>
68+
<p class="text-sm text-gray-500 mt-1">
69+
파이썬 한국 사용자 모임은 파이썬을 사용하는 모든 사람들을 위한 열린 커뮤니티입니다.
70+
</p>
71+
<p class="mt-6 pt-4 text-sm text-gray-400">
72+
© 2025 Python Korea. All rights reserved.
73+
</p>
7074
</div>
71-
{% if looking_for_sponsors %}
72-
<h4 class="text-center mb-4">looking for sponsors!</h4>
73-
{% endif %}
74-
</footer>
75+
</div>
76+
</div>
77+
</footer>
78+
79+
<script>
80+
const mobileMenuButton = document.getElementById('mobile-menu-button');
81+
const mobileMenu = document.getElementById('mobile-menu');
82+
mobileMenuButton.addEventListener('click', () => {
83+
mobileMenu.classList.toggle('hidden');
84+
});
85+
</script>
7586
</body>
76-
</html>
87+
</html>
88+
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
{% extends 'pythonkr/pk_base.html' %}
22
{% load wagtailcore_tags %}
3-
4-
{% block title %}Home - Python Asia - {{ page.title }}{% endblock %}
5-
6-
{% block content %}
7-
{{ page.body|richtext }}
8-
{% endblock %}
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
{% extends 'pythonkr/pk_base.html' %}
22
{% load wagtailcore_tags %}
3-
4-
{% block title %}Home - Python Asia - {{ page.title }}{% endblock %}
5-
6-
{% block content %}
7-
{{ page.body|richtext }}
8-
{% endblock %}

pythonkr_backend/pythonkr_backend/settings/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"taggit",
5656
"bakery",
5757
"wagtailbakery",
58+
"tailwind",
59+
"theme",
60+
"django_browser_reload",
5861
"pythonkr",
5962
"curation",
6063
]
@@ -68,6 +71,7 @@
6871
'django.contrib.messages.middleware.MessageMiddleware',
6972
'django.middleware.clickjacking.XFrameOptionsMiddleware',
7073
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
74+
'django_browser_reload.middleware.BrowserReloadMiddleware',
7175
]
7276

7377
ROOT_URLCONF = 'pythonkr_backend.urls'
@@ -172,7 +176,12 @@
172176
"wagtailbakery.views.AllPublishedPagesView",
173177
)
174178

179+
TAILWIND_APP_NAME = 'theme'
175180

181+
INTERNAL_IPS = [
182+
"127.0.0.1",
183+
"0.0.0.0",
184+
]
176185

177186
# setup logfire
178187

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'))

pythonkr_backend/theme/__init__.py

Whitespace-only changes.

pythonkr_backend/theme/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ThemeConfig(AppConfig):
5+
name = 'theme'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)