Closed kartikdanidhariya closed 8 years ago
hello @kartikdanidhariya, are your settings somewhat similar to https://github.com/divio/django-cms-demo/blob/master/src/settings.py ? Especially the template paths and BASE_DIR
need to point to the correct place.
I assume you were only using the djangocms-installer
An other alternative would be the above mentioned demo project.
hi i try with that but not work my settings.py in
import os gettext = lambda s: s DATA_DIR = os.path.dirname(os.path.dirname(file)) """ Django settings for deldecam project.
Generated by 'django-admin startproject' using Django 1.8.8.
For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
DATA_DIR = os.path.join(BASE_DIR, 'data')
SECRET_KEY = 'wyfyhlqc0d+^1090v=7%=yk$!txnqhyngj3grw5s192!p2ur'
DEBUG = True
ALLOWED_HOSTS = []
ROOT_URLCONF = 'deldecam.urls'
WSGI_APPLICATION = 'deldecam.wsgi.application'
LANGUAGE_CODE = 'en'
TIME_ZONE = 'Asia/Kolkata'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/' MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(DATA_DIR, 'media') STATIC_ROOT = os.path.join(DATA_DIR, 'static')
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'deldecam', 'static'), ) SITE_ID = 1
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'deldecam', 'templates'), os.path.join(BASE_DIR, 'templates'),], 'OPTIONS': { 'context_processors': [ 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.i18n', 'django.core.context_processors.debug', 'django.core.context_processors.request', 'django.core.context_processors.media', 'django.core.context_processors.csrf', 'django.core.context_processors.tz', 'sekizai.context_processors.sekizai', 'django.core.context_processors.static', 'cms.context_processors.cms_settings' ], 'loaders': [ 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'django.template.loaders.eggs.Loader' ], }, }, ]
MIDDLEWARE_CLASSES = ( 'cms.middleware.utils.ApphookReloadMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware', 'cms.middleware.language.LanguageCookieMiddleware' )
INSTALLED_APPS = ( 'djangocms_admin_style', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'django.contrib.messages', 'cms', 'menus', 'sekizai', 'treebeard', 'djangocms_text_ckeditor', 'djangocms_style', 'djangocms_column', 'filer', 'easy_thumbnails', 'cmsplugin_filer_image', 'cmsplugin_filer_file', 'cmsplugin_filer_folder', 'cmsplugin_filer_teaser', 'cmsplugin_filer_utils', 'cmsplugin_filer_video', 'djangocms_googlemap', 'djangocms_inherit', 'djangocms_link', 'reversion', 'deldecam', 'consulate_catalog', )
LANGUAGES = (
('en', gettext('en')),
('fr', gettext('fr')),
)
CMS_LANGUAGES = {
'default': {
'public': True,
'hide_untranslated': False,
'redirect_on_fallback': True,
},
1: [
{
'public': True,
'code': 'en',
'hide_untranslated': False,
'name': gettext('en'),
'redirect_on_fallback': True,
},
{
'public': True,
'code': 'fr',
'hide_untranslated': False,
'name': gettext('fr'),
'redirect_on_fallback': True,
},
],
}
CMS_TEMPLATES = (
('fullwidth.html', 'Fullwidth'),
('sidebar_left.html', 'Sidebar Left'),
('sidebar_right.html', 'Sidebar Right')
)
CMS_PERMISSION = True
CMS_PLACEHOLDER_CONF = {}
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'HOST': 'localhost', 'NAME': 'project.db', 'PASSWORD': '', 'PORT': '', 'USER': '' } }
MIGRATION_MODULES = { 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django', 'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django', 'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django', 'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django', 'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django' }
THUMBNAIL_PROCESSORS = ( 'easy_thumbnails.processors.colorspace', 'easy_thumbnails.processors.autocrop', 'filer.thumbnail_processors.scale_and_crop_with_subject_location', 'easy_thumbnails.processors.filters' )
OPENERP_HOST = '75.99.235.10' OPENERP_PORT = '8069' OPENERP_DB = 'odoo9' OPENERP_UID = 'admin' OPENERP_PWD = 'admin'
I did the following using the installer:
virtualenv env
source env/bin/activate
pip install djangocms-installer
djangocms -f -p . mysite
after this follow the installation instructions, use just the defaults, type in "en" on language selection and then set your admin user / password.
next copy all files into the mysite/
directory. It should look like:
My settings file:
import os
gettext = lambda s: s
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
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.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '9m8awp5ectxc89=56yn+6e@#e#6txerj6579ebpa7^2%5&b8ij'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
ROOT_URLCONF = 'mysite.urls'
WSGI_APPLICATION = 'mysite.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'de'
TIME_ZONE = 'Europe/Zurich'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
STATIC_ROOT = os.path.join(DATA_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'mysite', 'static'),
)
SITE_ID = 1
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'mysite', 'templates'),],
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.i18n',
'django.core.context_processors.debug',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.csrf',
'django.core.context_processors.tz',
'sekizai.context_processors.sekizai',
'django.core.context_processors.static',
'cms.context_processors.cms_settings'
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader'
],
},
},
]
MIDDLEWARE_CLASSES = (
'cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware'
)
INSTALLED_APPS = (
'djangocms_admin_style',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_text_ckeditor',
'djangocms_style',
'djangocms_column',
'filer',
'easy_thumbnails',
'cmsplugin_filer_image',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_teaser',
'cmsplugin_filer_utils',
'cmsplugin_filer_video',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'reversion',
'mysite'
)
LANGUAGES = (
## Customize this
('de', gettext('de')),
)
CMS_LANGUAGES = {
## Customize this
'default': {
'public': True,
'hide_untranslated': False,
'redirect_on_fallback': True,
},
1: [
{
'public': True,
'code': 'de',
'hide_untranslated': False,
'name': gettext('de'),
'redirect_on_fallback': True,
},
],
}
CMS_TEMPLATES = (
## Customize this
('fullwidth.html', 'Fullwidth'),
('sidebar_left.html', 'Sidebar Left'),
('sidebar_right.html', 'Sidebar Right')
)
CMS_PERMISSION = True
CMS_PLACEHOLDER_CONF = {}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'HOST': 'localhost',
'NAME': 'project.db',
'PASSWORD': '',
'PORT': '',
'USER': ''
}
}
MIGRATION_MODULES = {
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django'
}
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters'
)
@kartikdanidhariya did this solve your issue?
hi, i install django using djangocms-installer my pip freeze is Django==1.8.8 Django-Select2==4.3.2 Pillow==3.1.0 Unidecode==0.04.19 argparse==1.2.1 cmsplugin-filer==1.0.1 dj-database-url==0.3.0 django-appconf==1.0.1 django-classy-tags==0.7.1 django-cms==3.2.0 django-filer==1.1.1 django-formtools==1.0 django-mptt==0.8.0 django-polymorphic==0.8.1 django-reversion==1.8.7 django-sekizai==0.9.0 django-treebeard==4.0 djangocms-admin-style==1.0.9 djangocms-column==1.6.0 djangocms-googlemap==0.4.0 djangocms-inherit==0.1.1 djangocms-installer==0.8.5 djangocms-link==1.7.1 djangocms-style==1.6.0 djangocms-text-ckeditor==2.8.1 easy-thumbnails==2.3 html5lib==0.9999999 pytz==2015.7 six==1.10.0 tzlocal==1.2 wsgiref==0.1.2
after i create one project in that and place all static files in static folder and also place directory like templates , tools ,private in project after in home page it return error like
ValueError at /en/ dictionary update sequence element #0 has length 5; 2 is required
my trace back is
Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/en/
Django Version: 1.8.8 Python Version: 2.7.3 Installed Applications: ('djangocms_admin_style', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'django.contrib.messages', 'cms', 'menus', 'sekizai', 'treebeard', 'djangocms_text_ckeditor', 'djangocms_style', 'djangocms_column', 'filer', 'easy_thumbnails', 'cmsplugin_filer_image', 'cmsplugin_filer_file', 'cmsplugin_filer_folder', 'cmsplugin_filer_teaser', 'cmsplugin_filer_utils', 'cmsplugin_filer_video', 'djangocms_googlemap', 'djangocms_inherit', 'djangocms_link', 'reversion', 'deldecam') Installed Middleware: ('cms.middleware.utils.ApphookReloadMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware', 'cms.middleware.language.LanguageCookieMiddleware')
Template error: In template /home/keyur/django_cms_3.2/delecam_no_boot/deldecam/templates/base.html, error at line 42 dictionary update sequence element #0 has length 5; 2 is required
32 :
33 :
34 :
35 :
36 : {% block navbar %}
37 :
38 :
{% trans "Navigation" %}
39 : {% render_model_block request.current_page "changelist" %}
40 : {% with dropdown="true" %}
41 :
42 : {% show_menu 0 0 0 0 "includes/menu/navigation.html" %}
43 :
44 : {% show_menu_below_id "meta" 0 0 0 0 "includes/menu/navigation.html" %}
45 : {% language_chooser "includes/menu/langnav.html" "native" %}
46 :
47 : {% endwith %}
48 : {% endrender_model_block %}
49 :
50 : {% endblock navbar %}
51 :
52 :
Traceback: File "/home/keyur/django_cms_3.2/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: ValueError at /en/ Exception Value: dictionary update sequence element #0 has length 5; 2 is required
can you please explain how can i solve this