0

I Have tried to solve this issue by following few posts but still not able to solve it.Admin sit is missing its css javascripts and images. My setting.py file is

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

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 = '-g&@qu=+mm-li1xtsz_9a7c5uz6-&jq3y==7ib1%8zy2f@-_q4'

# 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',
    'book',
)

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 = 'Onlinebook.urls'

WSGI_APPLICATION = 'Onlinebook.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, 'db.sqlite3'),
    }
}

# 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


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static/')

STATIC_URL = '/static/'


# STATICFILES_DIRS = (
#     'K:/Analytics/Java/Onlinebook/src/book',
#      
#     # 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.
# )

TEMPLATE_DIRS= (
              os.path.join (os.path.dirname(__file__),'templates').replace('\\','/')
)

and display is like

Django administration Welcome, awaisali. Change password / Log out Site administration Auth Groups Add Change Users Add Change Book Authors Add Change Books Add Change Publishers Add Change

Any help would be much appreciated

Ashoka Lella
  • 6,631
  • 1
  • 30
  • 39
AWais ALi
  • 1
  • 2
  • possible duplicate of [why my django admin site does not have the css style](http://stackoverflow.com/questions/4420378/why-my-django-admin-site-does-not-have-the-css-style) – Boris Burkov Aug 07 '14 at 08:22
  • http://stackoverflow.com/questions/4420378/why-my-django-admin-site-does-not-have-the-css-style, http://stackoverflow.com/questions/5537268/django-admin-page-missing-css, https://www.google.com/?gws_rd=ssl#newwindow=1&q=django+admin+site+no+css :) – Boris Burkov Aug 07 '14 at 08:23

1 Answers1

0

Okay, after wasting 3-4 days i finally figured what was wrongwith my project. I was using it on Windows 8.1 and therfore due to some unknown issues it was unable to support all static files. i tried to run my project on another system with Windows 7 and it was working perfectly fine. so here it is Windows 8.1 users can stop wasting time on following solutions provided on forums..

AWais ALi
  • 1
  • 2