29 Ağustos 2013 Perşembe

Django os.path proje klasörü ve bi üst klasör.

Djangoda static file ve template çalıştırmak için settings.py da aşağıdaki değişiklikleri yapın.
 
settings.py

En başa üc kodu ekliyoruz.


import os.path
import sys
PROJECT_ROOT = os.path.dirname(__file__)
 
 
70. 
STATIC_URL = '/static/'  
 
 
73. 
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(os.path.dirname(__file__), 'templates/static'),
    
) 

113.

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(os.path.dirname(__file__), 'templates'),
)

Hiç yorum yok:

Yorum Gönder