Hi I use this (I am new in Django but it works for me):
settings.py
"""
Django settings for simplesite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import simplesite
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), "templates").replace ('\\','/'),
)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '8x*)8mtzd86&634n=kt!gr=9m**916trc&wd*qb(4uvgpcad3n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'bootstrap3',
'django_admin_bootstrapped.bootstrap3',
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'homepage',
'simpleapp',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
)
# http://django-bootstrap3.readthedocs.org/en/latest/settings.html
BOOTSTRAP3= {
'base_url': '/static/bootstrap3',
'css_url': '/static/bootstrap3/css/bootstrap.min.css',
}
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
ROOT_URLCONF = 'simplesite.urls'
WSGI_APPLICATION = 'simplesite.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
# default language, it will be used, if django can't recognize user's language
LANGUAGE_CODE = 'en-us'
# list of activated languages
LANGUAGES = (
('en', 'English'),
('it', 'Italian'),
)
TIME_ZONE = 'UTC'
# enable django’s translation system
USE_I18N = True
USE_L10N = True
USE_TZ = True
# specify path for translation files
LOCALE_PATHS = (
os.path.join(os.path.dirname(__file__), 'locale'),
)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)
STATIC_URL = '/static/'
urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^', include('homepage.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('simpleapp.urls')),
)
some.html
{% extends 'base.html' %}
{% load staticfiles %}
{%block content%}
...
<script src="{% static 'jquery-1.11.2.js' %}"></script> //here I call js files which I put in static folder
<script src="{% static 'js/conta.js' %}"></script>
<a href="{% url 'conta' %}" class="btn btn-primary" role="button" id="btnGo">GO</a><div id="loading"></div>
...
{% endblock content %}
example of directory tree
MyProject
-MyProject
-settings.py
-...
-MyApp
- ...
-static
-js
-...
-manage.py
-...
Also look at THIS QUESTION.