WebFaction
Community site: login faq

Hello,

I've read a few posts on the subject but still can't figure this out. I have a few Django projects set-up nicely on Webfaction and I'd like to try some useful functionalities found on Django CMS. However, their installation notes are rather cryptic as to how to go about it on Webfaction's file server structure.

Basically: where do I copy the downloaded files? (https://github.com/downloads/divio/django-cms/django-cms-2.0.2.tar.gz). Is there a script I can use for an automatic install?

asked 18 Feb '11, 12:27

yuri2k
1113
accept rate: 0%


Unfortunately it is much more complicated than copying a few files and running an installation script.

You need to create a new Django application and a new static application via the Webfaction control panel. You need to install the django-cms and all other dependencies you might want to use (such as south, filer, compress etc) to a place where your python path can find it. The easiest way to do that is doing "easy_install-2.7 pip" and then "pip install django-cms". The packages will be installed under "$HOME/lib/python2.7" and will be available to your Django project.

After that you need to add symlinks into your static folder pointing to all the media directories of your python packages (such as django/contrib/admin/media or cms/media/cms or filer/media/filer).

Finally you need to upload your local project sources into $HOME/webapps/django and adjust the myproject.wsgi file, edit some paths in your settings.py and restart the apache webserver.

All this is nothing that you will be able to do in 20 minutes. With a good understanding of django and python and linux you might manage to do it in 4 to 6 hours.

After many years of doing this repeatedly I got sick of it and created some neat kickstart scripts.

IF you run Ubuntu and IF you use Git and IF you don't care to have some awesome extra goodies added to your django-cms installation, you can do everything I described above with some simple commands:

First install all neccessary tools to your Ubuntu installation: https://github.com/bitmazk/bitmazk-environment

Next create a new local django-cms project: https://github.com/bitmazk/django-cms-html5-1140px-boilerplate

Finally deploy your new project to your Webfaction account: https://github.com/bitmazk/webfaction-django-cms-boilerplate

If anything fails, just open issues on github and I will try my best to assist you / fix my scripts...

If you don't use Linux, you should give it a try. The easiest way is to install Virtualbox, download the Ubuntu ISO and install it into your VirtualBox. After the installation completed you can just follow the 3 steps above and things should just magically work.

Sorry to say that, but this will keep you busy for many many hours. Once you got it, however, you will be so much more productive...

permanent link

answered 18 Feb '11, 12:42

mbrochh
862510
accept rate: 16%

edited 18 Feb '11, 12:56

Thank you for that. Installing a new instance of Django is something that I'm familiar with. I just didn't understand what was the dependencies' architecture, but your answer gives me a nice Friday evening assignment. ;-) Diving into it now...

(18 Feb '11, 12:51) yuri2k

Hey mbrochh: I've had a look at those github links, and they look helpful. A few questions, though:

  1. A year's passed since your comment—is the info here still current? Does it all still work? webfaction-django-cms-boilerplate refers to Python 2.6; will Python 2.7 give any problems? Django 1.3.1 is okay, presumably?

  2. What are the 'extra awesome goodies'? Are they just django-cms boilerplate for Webfaction, SASS (which I keep getting confused with SAAS ;) ) and some basic page look and feel? How flexible are they?

  3. Regarding the steps in webfaction-django-cms-boilerplate: which steps have wiggle room for names of things? I run several web apps at Web Faction and use naming conventions to keep track of it all. The names 'django' and 'static' seem generic and meaningless to me, and I prefer to use '/s' in URLs instead of '/static'. Will this be hard to work around? Is it easy to have multiple sites use the same Django instance named 'django'?

Thanks, Mik.

(22 Mar '12, 00:41) original_mikz

Hi Mik, we are living in fast paced times :) I have abandonned that boilerplate and created a new, much more powerful one: https://github.com/bitmazk/webfaction-django-boilerplate It can get you up to speed with almost just one command: "fab install_everything". However, it is still a work in progress and I would not recommend to use it on a server where you have other projects installed, unless you really know what you are doing.

(22 Mar '12, 01:38) mbrochh

To answer your other questions:

1) Sure, the django-cms-html5-1140px-boilerplate does use python2.7 and django1.3.1

2) Yes I think the awesome goodies were sass and compressor and django-filer. However I have given up on sass. It didn't play well with django-compressor and caused too much headache, so today I just compile my .sass files while I am editing them and checkin the compiled .css files into my project. SASS is a better way to write CSS, not to be confused with Software As A Service :)

3) You got a good point here. That old boilerplate does not allow much room for configuration. You can enter your DB name and User but it assumes that your static apps are called static and media, which sucks if you are hosting several projects on one server. My new boilerplate does take care about this - however even with that one you can't change the STATIC_URL, I never thought that someone might want to change it. But after running the script you just have to change it in your django settings, not a big deal.

(22 Mar '12, 01:48) mbrochh

G'day Martin,

Thanks for the reply. webfaction-django-boilerplate sounds great, but I'll heed your warning and wait until it's a little more predictable around existing installations. I'll live with the generic names for now, and use last year's scripts instead—I'll let you know how it goes. =)

Weird that SASS and minification don't get along. I assume you're processing them in the right order, but that SASS formats the CSS in a way that confuses the minification process? I might try seeing if I can work it out.

Cheers, Mik.

(22 Mar '12, 16:27) original_mikz

If you just want to add django-cms to one of your existing Django projects all you need to do is to make django-cms available in your python path.

First you should check, wich python version your Django project is using: Just have a look at $HOME/webapps/django/lib and see what is in there (python2.6 or python2.7).

Assuming you have python2.6 now you can do:

mkdir $HOME/lib/python2.6
easy_install-2.6 pip
pip install django-cms

It will be installed to $HOME/lib/python2.6/

Now you need to add a symlink to the django-cms media folder into your static folder (I hope that you already serve your static files through a dedicated static application):

cd $HOME/webapps/name-of-your-static-app
ln -s $HOME/lib/python2.6/cms/media/cms

After that you need to follow the configuration instructions of django-cms: http://django-cms.readthedocs.org/en/2.1.2/getting_started/tutorial.html#configuration-and-setup

It is mainly about changes to your settings.py and your urls.py...

Good luck! :)

permanent link

answered 18 Feb '11, 12:53

mbrochh
862510
accept rate: 16%

edited 18 Feb '11, 13:03

Beautiful, thank you. I'm running python2.7 and running the commands via ssh command prompt. I usually have symlink for the admin media and a static app for everything non-django (images, templates, etc). Following your suggestions and so far so good.

(18 Feb '11, 13:05) yuri2k

ehr... running an easy install of South gives me "/home/[appname]/lib/python2.4/South-0.7.3-py2.4.egg". This means there is no easy install available for python 2.7?

(18 Feb '11, 13:33) yuri2k

Try easy_install-2.7 instead of just easy_install.

(18 Feb '11, 13:41) seanf

that worked.

(18 Feb '11, 13:42) yuri2k

following the config instructions on http://django-cms.readthedocs.org/en/2.1.2/getting_started/tutorial.html#configuration-and-setup gives me an ImportError when doing the first syncdb - 'no module named appmedia'. Obviously it must be missing even though I've declared it on the apps of settings.py. However, I cannot find an individual install for this. Doesn't it come included with the Django CMS package?

(18 Feb '11, 13:53) yuri2k

It doesn't appear to be. But you can install it the same way that you installed django-cms. The package name is django-appmedia and is available here http://pypi.python.org/pypi/django-appmedia/1.0.1

(18 Feb '11, 14:47) bmeyer71 ♦♦
showing 5 of 6 show 1 more comments

Hi, I know this is an old question, but Google brought me here several times, and now I've written up the process I followed to get a Django-CMS app up with Webfaction, in this blog post.

I assume you already have a Django-CMS project going somewhere else, perhaps on your localhost, and you want to port it across. I run through setting up ssh and git, and some other tricks like setting the right version of python, setting up a tmp directory so pip will work for you, and of course setting up static and media directories.

I hope it's helpful. Please let me know if it can be improved!

permanent link

answered 13 Feb '13, 00:07

Arty
4625
accept rate: 50%

edited 28 Mar '13, 18:37

This is great, thank you for sharing! Wayne K | WebFaction Support

(13 Feb '13, 21:30) waynek

I've updated that post to include a fabric script (fabfile) which automates much of the process, though you will need to tailor it to your specific situation. I've posted the fabfile to github too.

(02 Jun '13, 18:53) Arty
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×910
×15

question asked: 18 Feb '11, 12:27

question was seen: 9,568 times

last updated: 02 Jun '13, 18:53

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM