Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Deployment

I am just about finished setting-up my new site based around SCT :)

I am now thinking about how to deploy the site. Are my ideas/assumptions valid? I am going to use Django with Apache and mod_python as that seems to be the recommended route (at least by Django).

As I will be doing at least one other SCT based site I was going to put the communitytools apps into my site-packages location.

I created my project in the normal way
django-admin.py startproject mysite
The SCT templates and the configs will then live in the directory mysite/community/. In the future additional Django apps will go into mysite/otherapp/ etc. The static stuff will live outside the project directory to be served by Apache directly.

I have made the assumption that the settings_local.py takes precedence over settings.py. So I have deleted the SCT settings.py but incorporated relevant variables into mysite/settings.py. The remaining SCT specific stuff has gone into mysite/community/settings_local.py.

In a similar way I have removed the SCT urls.py but included the locations into mysite/urls.py.

Now I haven't got this all working yet but I think this is just down to some paths being incorrect. Does this sound feasible or is there a better way of doing it.

Iain.
I am now thinking about how to deploy the site. Are my ideas/assumptions valid? I am going to use Django with Apache and mod_python as that seems to be the recommended route (at least by Django).
i personally am using apache 2 with mod_wsgi - the reason is quite simple.. mod_python didn't work well together with the python xapian libraries (for the forum search functionality) - so if you need search you need mod_wsgi ...

another important thing to consider is.. if you have multi byte characters (ie. non-ascii characters) in the wiki you should use python2.5 otherwise the 'diff' between wiki snips will not work..

As I will be doing at least one other SCT based site I was going to put the communitytools apps into my site-packages location.


cool :)
well.. i would actually just symlink it into site-packages instead of moving it there.. (this way the sources and the static css & co could still be in one place)

I created my project in the normal way
django-admin.py startproject mysite
The SCT templates and the configs will then live in the directory mysite/community/.


hmm.. yes.. sounds good.. are you also using the CommunityDraft project as a base ?
on my installation i have a simple dummy project which includes the CommunityDraft configuration in it's settings.py and then builds upon it:

from community.settings import *

In a similar way I have removed the SCT urls.py but included the locations into mysite/urls.py.


you mean you copied these statements like:
(r'^community/', include('sphene.community.urls'), defaultdict),

? i guess this makes sense.. another way would be to have CommunityDraft in your PYTHON_PATH and just include it like ..

from community.urlconfs import community_urls
urlpatterns = patterns( '', ... *patterns for your application* )
urlpatterns += community_urls.urlpatterns


(ie. just append the original urlconfs to yours) .. but i gues it doesn't really matter to ahve 1 line per SCT application you are using ..

Now I haven't got this all working yet but I think this is just down to some paths being incorrect. Does this sound feasible or is there a better way of doing it.


let me know if i can help you in any way :)
Hey, we have Signatures !!! Great, isn't it ? ;)
Thanks for the reply.

i personally am using apache 2 with mod_wsgi - the reason is quite simple.. mod_python didn't work well together with the python xapian libraries (for the forum search functionality) - so if you need search you need mod_wsgi ...


The search facility is of interest. I saw the warning in the SCT docs for search however the server I was going to use (Debian Etch) is using mod_python 3.2 and thought I might be OK.


another important thing to consider is.. if you have multi byte characters (ie. non-ascii characters) in the wiki you should use python2.5 otherwise the 'diff' between wiki snips will not work..

Oh! Like accented characters. Everything is currently on python2.4 bummer.

well.. i would actually just symlink it into site-packages instead of moving it there.. (this way the sources and the static css & co could still be in one place)


Just to be clear are you suggesting something like
mkdir /home/iain/src
cd /home/iain/src
svn co http://..communitytools communitytools
svn co http://..communitydraft communitydraft
ln -s /u/l/p/site-packages/communitytools communitytools
ln -s /u/l/p/site-packages/communitydraft communitydraft


I can see that would make upgrading much easier. The different sites would still have different css, images and possibly templates.

hmm.. yes.. sounds good.. are you also using the CommunityDraft project as a base ?

Yes.

on my installation i have a simple dummy project which includes the CommunityDraft configuration in it's settings.py and then builds upon it:

from community.settings import *

I don't understand what you mean here.

you mean you copied these statements like:
(r'^community/', include('sphene.community.urls'), defaultdict),

Yes.

? i guess this makes sense.. another way would be to have CommunityDraft in your PYTHON_PATH and just include it like ..

from community.urlconfs import community_urls
urlpatterns = patterns( '', ... *patterns for your application* )
urlpatterns += community_urls.urlpatterns


(ie. just append the original urlconfs to yours) .. but i gues it doesn't really matter to ahve 1 line per SCT application you are using ..


Not every site would use every app so I thought it would be a good reminder of which site used which apps.

let me know if i can help you in any way :)


Thanks :)

Sorry for being so verbose but I intend to write-up every step taken.
The search facility is of interest. I saw the warning in the SCT docs for search however the server I was going to use (Debian Etch) is using mod_python 3.2 and thought I might be OK.
i have no idea.. i tried it a few months ago and couldn't get it to work with mod_python: http://www.modpython.org/pipermail/mod_python/2008-April/025241.html
and it seems the bug is still not fixed: http://issues.apache.org/jira/browse/MODPYTHON-217

another important thing to consider is.. if you have multi byte characters (ie. non-ascii characters) in the wiki you should use python2.5 otherwise the 'diff' between wiki snips will not work..
Oh! Like accented characters. Everything is currently on python2.4 bummer.

exactly .. this is REALLY annoying.. but the python diff utils prior to python 2.5 didn't handle multi byte characters correctly :(
(the most annoying thing is, that the postgresql driver and a couple of other debian etch packages aren't compatible with python 2.5 :( so it's a real hassle to get it up and running :( )

another thing.. if you are using mysql .. make sure all tables are using utf-8 .. i made the mistake once not to check that (since i'm usually using postgresql) and so no umlauts & co worked ..

well.. i would actually just symlink it into site-packages instead of moving it there.. (this way the sources and the static css & co could still be in one place)
Just to be clear are you suggesting something like


basically yes, but you should only symlink the python modules like

ln -s /mycheckoutdir/communitytools/sphenecoll/sphene /u/l/p/site-packages/sphene



from community.settings import *
I don't understand what you mean here.


well ... if you have the CommunityDraft in your PYTHON_PATH this would import all settings from the default community draft settings .. might safe you configuring all MIDDLEWARE_CLASSES or whatever.. but.. well.. it depends on how heavily you base your work on CommunityDraft .. if you build your site from ground up it probably makes no sense at all because you have a completely different setup anyway :)

Sorry for being so verbose but I intend to write-up every step taken.



no problem, i'm pretty sure it could help other people when they discover those threads..

i'm eager to see your site online :) i hope it will be public on the internet ? ;)
Hey, we have Signatures !!! Great, isn't it ? ;)
I just looked at that bug you linked to and guess what
Affects Version/s: 3.2.10, 3.3.x
Here goes wsgi then... except...

(the most annoying thing is, that the postgresql driver and a couple of other debian etch packages aren't compatible with python 2.5 :( so it's a real hassle to get it up and running :( )

The Etch package of libapache2-mod-wsgi only works with python2.4 too. I only use postgresql so I will need to look into this.

well ... if you have the CommunityDraft in your PYTHON_PATH this would import all settings from the default community draft settings ..


OK got you now.

i'm eager to see your site online :) i hope it will be public on the internet ? ;)


It will certainly be online but I am not the site owner. Some fora will be private, and by invitation only, as the subject matter is about personal finance. That was why I was interested in https in another thread. I will certainly post to the forum when the site goes live (though that might be a wee bit longer than planned for - sorting through all the stuff above ;) )

Please login to post a reply.



Powered by Sphene Community Tools