https://docs.djangoproject.com/ko/5.0/intro/tutorial07/
첫 번째 장고 앱 작성하기, part 7 | Django 문서
The web framework for perfectionists with deadlines.
docs.djangoproject.com
관리자 폼 커스터마이징은 서버를 실행시킨 뒤 따라하며 새로고침하면 쉽게 동작하는 것을 확인할 수 있다.
관리자 룩앤필 커스터마이징 부분에서는 본문을 꼼꼼히 읽어야 되는 부분이 있어 조금 헷갈릴 수 있기 때문에 부연 설명을 남긴다.
mysite/settings.py에 DIRS 부분에 [ BASE_DIR / "templates" ] 로 수정하고나면 manage.py 파일이 있는 곳에 templeates 폴더를 생성하고, 그 하위 폴더로 admin 폴더를 생성한다.
그리고 django 소스 파일을 찾아가 django/contrib/admin/templates/admin/base_site.html 의 파일을 admin 폴더에 복사해준다.
그리고 본분에서 안내한대로 템블릿을 바꿔준다.
{% block branding %}
<div id="site-name"><a href="{% url 'admin:index' %}">Polls Administration</a></div>
{% if user.is_anonymous %}
{% include "admin/color_theme_toggle.html" %}
{% endif %}
{% endblock %}
본인은 여기에 Polls Administation 대신 Haku-s Administration 으로 변경하여 확인을 했다.
전체적인 구조는 다음과 같다.

이후 최종 화면은 다음과 같다. (http://127.0.0.1:8000/admin/)

site-name이 올바르게 나왔는지 확인하면 된다.
다음으로
[Django] 9. Django 앱 작성하기 part.8 (디버그 툴바 설치하기)
https://docs.djangoproject.com/ko/5.0/intro/tutorial08/ 첫 번째 Django 앱 작성하기, part 8 | Django 문서The web framework for perfectionists with deadlines.docs.djangoproject.com 이번 튜토리얼에서 디버그 툴바 설치로는 명령어
haku-s.tistory.com
'Python > Django' 카테고리의 다른 글
| [Django] 10. Django 앱 패키징하기 (setuptools ModuleNotFoundError) (0) | 2024.07.23 |
|---|---|
| [Django] 9. Django 앱 작성하기 part.8 (디버그 툴바 설치하기) (0) | 2024.07.23 |
| [Django] 7. Django 앱 작성하기 part.6 (Style 적용하기) (0) | 2024.07.22 |
| [Django] 6. Django 앱 작성하기 part.5 (Unit Test) (0) | 2024.07.22 |
| [Django] 5. Django 앱 작성하기 part.4 (Vote & Results page) (0) | 2024.07.21 |