티스토리 뷰
INTRO
Python 3.10.0
Django 3.2.8
bootstrap
bootstrap 무료 테마 : https://startbootstrap.com/template/sb-admin
다운로드 파일 django-erp/statics 복사
templates 하위에 templates/bstest 폴더 생성 후 .html 모든 파일 이동
{SublimeText} config/settings.py : TEMPLATES_TEST 경로 추가
TEMPLATES_TEST = os.path.join(BASE_DIR, 'templates', 'bstest')
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
TEMPLATES_DIR, TEMPLATES_TEST,
],
....
},
]
{SublimeText} templates/index.html : {% load static %} 추가 및 css, js link 수정
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
....
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" />
<link href="{% static 'css/styles.css' %}" rel="stylesheet" />
<!-- <link href="css/styles.css" rel="stylesheet" /> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js" crossorigin="anonymous"></script>
</head>
....
....
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="{% static 'js/scripts.js'%}"></script>
<!-- <script src="js/scripts.js"></script> -->
....
</body>
</html>
- home/urls.py에 bstest url 적용
{SublimeText} home/urls.py
from django.contrib import admin
from django.urls import path, include
from home import urls, views
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
urlpatterns = [
path('admin/', admin.site.urls),
path('', TemplateView.as_view(template_name='welcome.html'), name='welcome'),
path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('signup/', views.signup, name='signup'),
path('signup_waiting/', TemplateView.as_view(template_name='signup_waiting.html'), name='signup_waiting'),
path('home/', include("home.urls")),
path('bstest', TemplateView.as_view(template_name='index.html'), name='index'),
]
- bootstrap theme 적용 확인
chrome browser : http://localhost:8000/bstest
반응형
'python > django_ERP2' 카테고리의 다른 글
(macOS)[python] django-erp : templates 분리 (2) bstest layout 분리 (0) | 2021.11.15 |
---|---|
(macOS)[python] django-erp : templates 분리 (1) mysite (0) | 2021.11.07 |
(macOS)[python] django-erp : login, logout, signup, signup_waiting (0) | 2021.11.05 |
(macOS)[python] django-erp : app 생성 (0) | 2021.11.04 |
(macOS)[python] django-erp : Django 초기설정 (0) | 2021.11.01 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- pyserial
- Regression
- Templates
- arduino
- Raspberry Pi
- server
- template
- Model
- SSH
- git
- 라즈베리파이
- Pandas
- 자가격리
- 확진
- github
- r
- MacOS
- 코로나
- Django
- vscode
- analysis
- raspberrypi
- DS18B20
- DAQ
- sublime text
- COVID-19
- CSV
- Python
- ERP
- 코로나19
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함