ImportError at /admin/

18 views
Skip to first unread message

Mane alioune

unread,
Apr 28, 2016, 7:54:26 AM4/28/16
to django-admin-tools

Hi,
I would like to configure Django-admin-tools-stats everything went well except that when I type the following command :

$ python manage.py bower_install

it only creates the components folder but not the other dependencies suddenly I have to manually download but by running the command :
$python manage.py runserver

everything is OK and Here rendering the actual execution : 




here is my settings : 


import os
import pymysql
pymysql
.install_as_MySQLdb()




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


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
   
'admin_tools',
   
'admin_tools.theming',
   
'admin_tools.menu',
   
'admin_tools.dashboard',
   
'django.contrib.admin',
   
'django.contrib.auth',
   
'django.contrib.contenttypes',
   
'django.contrib.sessions',
   
'django.contrib.messages',
   
'django.contrib.staticfiles',
   
'transports.apps.TransportsConfig',
   
'import_export',
   
'rest_framework',
   
'adminsortable',
   
'daterange_filter',
   
'djangobower',
   
'admin_tools_stats',
   
'django_nvd3',
]

MIDDLEWARE_CLASSES
= [
   
'django.middleware.security.SecurityMiddleware',
   
'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',
]

ROOT_URLCONF
= 'DDD.urls'

SITE_ID = 1



TEMPLATES
= [
   
{
       
'BACKEND': 'django.template.backends.django.DjangoTemplates',
       
'DIRS': [
            os
.path.join(BASE_DIR, 'templates')
       
],
        'OPTIONS': {
           
'context_processors': [
                'django.core.context_processors.request',
               
'django.contrib.auth.context_processors.auth',
               
'django.template.context_processors.debug',
               
'django.template.context_processors.request',
               
'django.contrib.messages.context_processors.messages',
           
],
           
'loaders': [
               
'admin_tools.template_loaders.Loader',
                'django.template.loaders.filesystem.Loader',
               
'django.template.loaders.app_directories.Loader',
               
'django.template.loaders.eggs.Loader',
           
],
       
},
   
},
]


WSGI_APPLICATION
= 'DDD.wsgi.application'


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

DATABASES = {
   
'default': {
        'ENGINE': 'django.db.backends.mysql',
       
'NAME': 'xxxxx',
       
'USER': 'xxxxx',
       
'PASSWORD': 'xxxxxx',
       
'HOST': '127.0.0.1',
       
'PORT': '',
   
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
   
{
       
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
   
},
   
{
       
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
   
},
   
{
       
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
   
},
   
{
       
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
   
},
]


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

LANGUAGE_CODE = 'fr-FR'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'

REST_FRAMEWORK = {
   
'DEFAULT_PERMISSION_CLASSES': (
       
'rest_framework.permissions.IsAuthenticated',
       
#'rest_framework.permissions.AllowAny',
    ),
   
'DEFAULT_AUTHENTICATION_CLASSES': (
       
'rest_framework.authentication.SessionAuthentication',
       
'rest_framework.authentication.BasicAuthentication',
       
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
   
),
}


BOWER_INSTALLED_APPS = (
   
'jquery#2.0.3',
   
'jquery-ui#~1.10.3',
   
'd3#3.3.6',
   
'nvd3#1.1.12-beta',
   
'underscore',
)


STATICFILES_FINDERS = (
   
'django.contrib.staticfiles.finders.FileSystemFinder',
   
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
   
'djangobower.finders.BowerFinder',
)

STATIC_ROOT
= os.path.join(BASE_DIR, 'static')
BOWER_COMPONENTS_ROOT
= os.path.join(BASE_DIR, 'components')


# Configuration
#ADMIN_TOOLS_THEMING_CSS = 'css/theming.css'
#ADMIN_TOOLS_MENU = 'admin.menu.CustomMenu'
#ADMIN_TOOLS_INDEX_DASHBOARD = 'admin.dashboard.CustomIndexDashboard'
#ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'admin.dashboard.CustomAppIndexDashboard'



and when I removed the comment from the line ADMIN_TOOLS_MENU or ADMIN_TOOLS_INDEX_DASHBOARD or ADMIN_TOOLS_APP_INDEX_DASHBOARD
here is the error that appears 


and and I would customize the menuHelp me please to solve this problems ??? 

Reply all
Reply to author
Forward
0 new messages