views:

360

answers:

2

This question is from a Django and Django-cms rookie attempting to install django-cms on a shared hosting account. Here's what I have done so far:

  1. Django has been installed in ~/.local/lib/python (using python 2.4.3)

  2. Flup has also been installed in same place

  3. Created my app (site) directory - ~/.local/lib/python/eck

  4. downloaded and extracted django-cms into ~/.local/lib/python/eck

  5. Copied the cms, mptt, and publisher folders into ~/.local/lib/ python/eck

That's where I'm stuck. Not sure what to do from here. Should I copy the contents of the example folder into ~/.local/lib/python/eck and customize the existing settings.py file? What about the other files and folders. Which ones should I copy into "eck?"

There is a "sampleapp" folder under the "example" folder. What do I do with that?

Thanks

TIA

+1  A: 

Have you first gotten Django up and running, without Django-CMS? I'd worry about that first, and then worry about getting Django-CMS installed. You should be able to create a project somewhere outside of your webroot using the django-admin.py commands. Then configure your server to point to it - probably on Apache with either mod_wsgi or mod_python. I would think the former since you're installing a wsgi tools bundle, but make sure you shared hosting provider has mod_wsgi installed.

Also, granted I don't know what your hosting environment is like, but you shouldn't need to create your project in your Python directory. See this answer about where to put your project.

Having installed Django-CMS a couple times, at various levels of Django know-how, I would strongly suggest focusing on getting a skeleton Django project up and running first!

bennylope
A: 

I absolutely agree with bennylope's answer -- make sure you have a Django project running before trying to incorporate django-cms.

Once you do have the skeleton django project up, you'll probably want to add this to the bottom of your root urls.py file:

urlpatterns += patterns('',
    url(r'^', include('cms.urls')),
)

In your settings.py file, make sure that you have added the following to INSTALLED_APPS:

    'cms',
    'cms.plugins.text',
    'cms.plugins.picture',
    'cms.plugins.link',
    'cms.plugins.file',
    'cms.plugins.snippet',
    'cms.plugins.googlemap',
    'mptt',
    'menus',
    'publisher',

Don't bother copying over the example folder. However, you do need to set up your starting CMS templates.

In your root project folder, create a folder templates if you haven't already done so. You need to create a file for outputing the CMS, here is a good start:

# default.html
{% extends "base.html" %}
{% load cache cms_tags menu_tags %}
{% block menu %}
<ul id="navigation">
    {% show_menu 0 100 100 100 %} 
</ul>
{% endblock menu %}
{% block content %}
    <ul class="breadcrumb">
        <li class="you">You are here:</li>
        {% show_breadcrumb %}
    </ul>

    <h1>{% block title %}{% page_attribute title %}{% endblock %}</h1>

    <div>
        <div class="placeholder" id="body">
            {% placeholder "body" %}
         </div>
    </div>
{% endblock content %}

Make sure to add

CMS_TEMPLATES = (
        ('default.html', gettext('default')),
)

to your settings file.

You're responsible for setting up base.html. However you write it, make sure it includes {% block content %}{% endblock content %} somewhere so the contents of the CMS template get displayed.

I'd actually recommend against copying the django-cms folders into your /eck directory. They should be located wherever site-packages or the equivalent is located in your install. My favorite way to set this up is to put django-cms in /opt/ and then use symbolic linking to the subfolders in site-packages. This may not work for you, get in touch with whomever manages your shared hosting to ask them what to do, as it is often different for each provider.

However, the key is you don't want to have the django-cms folders in the same area as your project folders. When setting up a django project, I personally like to keep separate the apps I've coded specifically for this project from other apps.

Jordan Reiter