settings.py
# Static files (CSS, JavaScript, Images)
STATIC_URL = '/static/'
# Optional: 추가적인 정적 파일 경로를 지정하고 싶을 때
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'common_static'), # 프로젝트 루트에 있는 공통 정적 파일 디렉토리
]
# collectstatic 명령어로 모아질 파일들이 저장될 위치
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
기본 애플리케이션 urls.py
urlpatterns = [
path('', include('앱이름.urls')),
]
추가 애플리케이션
urlpatterns = [
path('앱이름/', 함수이름, name='함수와 관련된 이름'),
]
최종 렌더링
def index(request):
return render(request, '..폴더주소/index.html')
'python' 카테고리의 다른 글
uwsgi 자동 시작 설정 [우분투] (0) | 2024.12.26 |
---|---|
구글 네이버 sso 로그인 django 설정 정보 (2) | 2024.11.20 |
uWSGI 관련 (0) | 2024.08.23 |
깃허브 관련 (0) | 2024.08.23 |
가상 환경 관련 (0) | 2024.08.21 |