Problemas de django-cms en el servidor apache

I've installed Django 1.3 with django-cms. All is working perfect under self development webserver. While I install a fresh copy based on apache + mod_python, it has some problems that not meet in development.

Configuro el http://www.domain.com/mycms as the root link for cms, the physical directory is /www/domain/mycms.

  1. The first welcome webpage (www.domain.com/mycms/) is show correcyly with the logo. but the admin(www.domain.com/admin/) and the add-page(www.domain.com/admin/cms/page/add/) link is not correct. the should be like this (www.domain.com/mycms/admin/) and (www.domain.com/mycms/admin/cms/page/add/).
  2. While I manually enter the admin url(www.domain.com/mycms/admin/), I can get the login screen and got admin page. But in the pages screen, it can not show any page already created, and just show 'loading...' under the title 'Select page to change'. But I can manually input the link to edit and create the pages.
  3. In the page editing, it show the default available plugins(text, googlemap, file, link, picture, etc.) to select from drop-down list, but can not plus any. a message show below: 'No Plugins present. Add a plugin to this placeholder-slot.'

Any one can point out how to fix these problems? Thanks a lot.

I think it maybe due to the environment I build and have some incorrectly parameters.

Aquí está el medio ambiente:

1) apache virtual host config is below:

<VirtualHost *:80>
    ServerName www.domain.com
    DocumentRoot /www/domain

# The alias is for link the admin style file to apache.
    alias /static/admin/ /usr/share/pyshared/django/contrib/admin/media/

    <Location "/mycms/">
        SetHandler python-program
        PythonPath "['/www/domain/','/www/domain/mycms/'] + sys.path"
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mycms.settings
        PythonInterpreter mycms
        PythonOption django.root /mycms
        PythonAutoReload On
        PythonDebug On
    </Location>
</VirtualHost>

2) the settings.py is list the relevant config:

PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
WWW_DIR = '/mycms'

MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')

MEDIA_URL = WWW_DIR+'/media/'
STATIC_URL = WWW_DIR+'/static/'

ADMIN_MEDIA_PREFIX = '/static/admin/'

CMS_TEMPLATES = (
    ('example.html', 'Example Template'),
)

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = (
    os.path.join(PROJECT_DIR, 'templates'),
)
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.staticfiles',
    'cms',
    'menus',
    'mptt',
    'south',
    'cms.plugins.text',
    'cms.plugins.picture',
    'cms.plugins.link',
    'cms.plugins.file',
    'cms.plugins.snippet',
    'cms.plugins.googlemap',
    'sekizai',
)

3) The urls.py is not changed as default.

preguntado el 10 de marzo de 12 a las 09:03

Django does not work well in subdirs. Can you put the project on separate sudomain? -

I tried Django on another subdirectories, not Django-cms, it seams work well. The directory is /www/domain/dtest. That's why I think it may works for cms because cms document point out the environment is depended by Django. -

Anyway, let me try to move the cms to another domain's root to test it. Thanks a advise. -

Please not that mod_python is deprecated in Django (see docs.djangoproject.com/en/1.3/howto/deployment/modpython). I suggest you look into mod_wsgi or wsgi servers such as gunicorn as alternatives. They increase your chances to get help online since more people are familiar with them. -

Thanks for information. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.