mentor_ds templates for demiansoft
Project description
django-mentor_ds
django-mentor_ds is a Django app to use for demiansoft.
Quick start
- 본 템플릿은 다음의 필수 앱들이 필요하다. 프로젝트의 settings.py에 다음을 추가한다. DATA_PATH 경로도 설정한다.
INSTALLED_APPS = [
...
'django.contrib.humanize',
'mentor_ds',
# 필수 컴포넌트
'popup',
'base',
'home',
'hero',
# 선택 공통 컴포넌트
'counts',
'about',
'whyus',
'testimonials',
'team',
'faq',
'contact',
'appointment', # contact에서 내부적으로 사용함
# 선택 유니크 컴포넌트
'courses',
'features',
'events',
'pricing',
]
...
DATA_PATH = os.path.join(BASE_DIR, '_data', 'context.pickle')
- home app을 추가한다.
python manage.py startapp home
- 프로젝트의 urls.py에 다음을 추가하여 home app과 템플릿에 연결한다.
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ...
path('', include('home.urls')),
path('mentor_ds', include('mentor_ds.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
- home app의 urls.py에 다음을 추가하여 view함수와 연결한다.
app_name = 'home'
urlpatterns = [
path('', views.home, name='home'),
path('<str:lang>/', views.home, name='home'),
...
]
- views.py에서 context를 pickle로 저장하도록 준비한다.
def home(request):
...
# context가 될 내용을 context.pickle에 저장한다.
with open(settings.DATA_PATH, 'wb') as fw:
pickle.dump(context, fw)
return render(request, f"home/home.html", {'theme': mytheme})
- home.html에서는 템플릿을 호출할수 있도록 다음을 작성한다.
<meta http-equiv="refresh" content="0;URL='{{ url mentor_ds:buildup }}'">
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-mentor_ds-0.1.2.tar.gz
(21.6 kB
view hashes)
Built Distribution
Close
Hashes for django_mentor_ds-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf301969438e0021b0abdd41b35761e52179e0193cf239b261599eda7cb72d93 |
|
MD5 | 5e7052ceccbdc38883fb8d8fbdb69c95 |
|
BLAKE2b-256 | 879dddae69dfd03f0003c63335a0bb2a7da414ac94330aacf8569fde5c7ec97e |