On Sunday, March 9, 2014 10:29:37 PM UTC+3:30, Camilo Torres wrote:
>
> On Sunday, March 9, 2014 12:11:11 PM UTC-4:30, rafiee.nima wrote:
>>
>> I am new to bootstarp and I want to use it in my django project.
>> I put the needed folder's(css , js , img) in my project static folder and 
>> config my setting.py to access static directory
>> I can access bootstrap.css from http:///..myprojecet/static/bootstrap.css 
>> which means I correctly config setting.py
>> but the problem is that no bootstrap style applied to my temeplates. (I 
>> also check in  firebug if css and js files been inclueded )
>>
>> here is my base.html code that other templates inhierent from it
>>
>> {% load static %}
>> <!DOCTYPE html>
>> <html>
>> <head>
>>     <meta name="viewport" content="width=device-width, initial-scale=1.0">
>>     <!-- Bootstrap -->
>>  <link href="{% static 'css/bootstrap.min.css'% }" rel="stylesheet" 
>> media="screen">
>> <link href="{% static 'css/bootstrap-theme.min.css' %}" rel="stylesheet">
>>  </head>
>> <body>
>> <div class="btn-group dropup">
>>   <button type="button" class="btn btn-default">Dropup</button>
>>   <button type="button" class="btn btn-default dropdown-toggle" 
>> data-toggle="dropdown">
>>     <span class="caret"></span>
>>     <span class="sr-only">Toggle Dropdown</span>
>>   </button>
>>   <ul class="dropdown-menu">
>>   </ul>
>> </div>
>> {% block body_block %}
>> {% endblock %}
>>
>> <script src="{% static 'js/jquery-2.1.0.js"></script>
>> <script src="{% static 'js/bootstrap.min.js"></script>
>> </body>
>> </html>
>>
> Hello,
>
> This URL looks bad:  http:///..myprojecet/static/bootstrap.css
> What is in your settings.py?
> Should it be: {% static 'bootstrap.min.css'% }?
>


tnx for reply 
the actual ulr was http://127.0.0.1:8000/static/css/bootstrap.min.css which 
I use to test if I correctly configure static path and url in my setting.py 
I attached my setting.py  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/008d8e89-6d8b-4867-a19d-c3db6ce54e6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"""
Django settings for tango_with_django_project project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ip1$@b#8a3$nz=l0e*ij@3(t%ouid$gc^!6qxshw5a(g3sv8&u'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rango',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'tango_with_django_project.urls'

WSGI_APPLICATION = 'tango_with_django_project.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'rango.db'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True
LOGIN_URL = '/rango/login/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

STATIC_URL = '/static/'
MEDIA_URL = '/media/'

TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'),)
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'),)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)


TEMPLATE_CONTEXT_PROCESSORS=(

    "django.contrib.auth.context_processors.auth",
    'django.core.context_processors.request',
     "django.core.context_processors.debug",
     "django.core.context_processors.i18n",
     "django.core.context_processors.media",
     "django.core.context_processors.static",
     "django.core.context_processors.tz",
     "django.contrib.messages.context_processors.messages"
)

Reply via email to