1. 디렉토리 구조 만들기

├── BOARD
│   ├── BOARD
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── settings.py
│   │   ├── settings.pyc
│   │   ├── urls.py
│   │   ├── urls.pyc
│   │   ├── wsgi.py
│   │   └── wsgi.pyc
│   ├── WEB
│   │   ├── css
│   │   ├── html
│   │   ├── img
│   │   ├── js
│   │   └── less
│   ├── WEB.tar.gz
│   ├── board
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── models.py
│   │   ├── tests.py
│   │   ├── views.py
│   │   └── views.pyc
│   └── manage.py
└── django-admin.py

 [Project Name]/WEB/css : css 파일 모음

 [Project Name]/WEB/js   : js 파일 모음

 [Project Name]/WEB/img : 이미지 파일 모음

 -> 해당 파일들은 첨부 파일의 WEB.tar.gz 파일로 첨부했습니다. Project 폴더에서 tar -xvzf WEB.tar.gz 를 입력하시면 됩니다.

      해당 폴더 안에는 Twitter의 WEB UI Framework인 bootstrap가 들어 있습니다.


2. settings.py 설정

STATIC_ROOT = '/home/nijin39/DEV/BOARD/WEB'
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
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.
('css', '/home/nijin39/DEV/BOARD/WEB/css'),
('js', '/home/nijin39/DEV/BOARD/WEB/js'),
('img', '/home/nijin39/DEV/BOARD/WEB/img'),
)

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.
'/home/nijin39/DEV/BOARD/WEB/html'
)

3. HTML 파일 만들기

    <!DOCTYPE html>
    <html>
    <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
    </head>
    <body>
    <h1>Hello, world!</h1>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    </body>
    </html>

5. 결과



WEB.tar.gz


+ Recent posts