Hi,
I spent a little time working on this branch:
http://github.com/jamescasbon/codenode/tree/django-commands
It attempts to remove a lot of the magic going on in getting codenode
running to do with running servers, python paths, etc. I really
wanted to do this to try and make codenode installable in an existing
django setup with out too much hassle.
On Tue, Nov 24, 2009 at 1:34 PM, James Casbon <cas...@gmail.com> wrote:
Hi,
I spent a little time working on this branch:
http://github.com/jamescasbon/codenode/tree/django-commands
It attempts to remove a lot of the magic going on in getting codenode
running to do with running servers, python paths, etc. I really
wanted to do this to try and make codenode installable in an existing
django setup with out too much hassle.*Wow*, awesome!!
I can't look at all this very carefully at the moment
( as I'm trying to finish up some other work right now)
but my first impression is "OMG, this rocks!".
We really need to all get on google Wave or IRC soon, and
organize our plan to move forward with this as efficiently as possible.
4. initialize the database './manage.py syncdb --noinput' then
'./manage.py runscript --fixtures development'
(we can perhaps remove the dependency on django_extensions for
runscript here, but really the script is a lot nicer than a json dump)
5. run the dev server './manage.py codenode_desktop'
So you see that this is allows for a django user to deploy codnode in
their environment by customising the settings file (basically to add
to installed apps), and doesn't require a codenode directory with code
copied in. IMHO this is a lot cleaner. We could probably put a
manage.py in the source tree so that we can develop without the
separate codenode initialized directory.
With my sysadmin hat on, not having code copied into different dirs is
appealing for upgrades and maintenance, but really this lowers the
barrier to entry to django users to hook up their business objects to
codenode on their existing django site. Also, a pure
The one glitch is backend settings, which are currently directly
imported. We should probably solve this by expecting a
codenode_settings object to be present in the django settings, so that
you can do something like:
from codenode.backend.settings import development as codenode_settings
The service.py file could do with a tidy up after this.
Hi Dorian,
I'm sorry you ran into a bug using the merged code. I am a little
suspicious of what happened in the merge as Alex ran into missing
imports which I'm sure were not there in my commits. I will see if I
can reproduce later this evening as I have a meeting starting in a few
minutes.
You are right to point out that the new documentation was missing -
that's mainly because I missed your new documentation on all those dev
scripts until after the merge. Apologies.
I'd like to step back and identify the main problem I was trying to
solve: I want to install codenode as a django app - and that is the
main part. The shipped DB seeemed a bit weird to me, as it was
preventing me doing this. I could now probably work around this using
django-admin but it still seems better to me that a bootstrap is done
in code rather than an sqlite database. During my work I stripped out
lamson configuration as I thought having two (django, twisted) was
better than having three (DRY and all that) - I should habe made this
change clearer.
As for having environment directories, I think this is a great idea
and nothing I committed prevents this - it simply chooses a sane
directory for the desktop version (as in end user version). Another
settings file
If this is blocking your work, I am totally happy with rolling back
until we have agreed some changes. I think the important thing here
is to carry on improving codenode - not descending into an argument
about which configuration style is better.
I will be back later with more info.
cheers,
James
On Jan 4, 11:05 am, Dorian Raymer <deldo...@gmail.com> wrote:
> Hi James,
> I've been using this code (it has since been
> merged<http://groups.google.com/group/codenode-devel/browse_thread/thread/0f...>in
OK I got it - you need a 'data' directory inside the directory you are
working in (the django project dir). Just try a 'mkdir data'.
That's because we are just fudging the settings file for the django
project - in a real instance you would have a database defined in a
proper location.
> I also tried the variation _desktop_settings, and i get the same error.
>
> I probably missed better instructions for how to use the new management
> commands somewhere... took me a while to even remember this email after
> being confused by all the new changes in the source for a while ;)
I will submit new documentation if we decide we are not going to roll
this back.
I had previously missed all the stuff in the 'devel' folder - with
this new system we could probably have a '_settings_development' to do
this style configuration.
OK all good points. Just as long as we can preserve a route without
using codenode admin I'm happy enough.
>
> The one glitch is backend settings, which are currently directly> imported. We should probably solve this by expecting a
> > codenode_settings object to be present in the django settings, so that
> > you can do something like:
> > from codenode.backend.settings import development as codenode_settings
> > The service.py file could do with a tidy up after this.
>
> > This is an important and nuanced point that has been around since the days
>
> of Knoboo:
> unification of settings/configuration options.
>
> It was funny to see your implementation of the run
> function<http://github.com/codenode/codenode/blob/master/codenode/management/c...>--
> that was how things used to work until we got better at using twistd
> service options and the twisted application framework! We are repeating a
> pattern here, but instead of learning how to make good twistd plugins, we
> are now talking about making django plugins!
> Not sure if this is good or bad, but the common denominator that deserves
> attention is how best to declare and define configuration options for this
> multi-part system (the two parts of the frontend and the backend).
> So, I see that as a very important implication of your work here, and maybe,
> in a new thread, we can hash out thoughts on how to centralize declaration
> of configuration options...currently declaration happens in the settings.py
> and in codenode/service.py and both those also define the values of those
> options...some options are ambiguously redundant, some un-used...It is
> working, but it's messy :)
Yes, this is always a difficult point. I've seen some projects go
crazy on this, so I think we should keep it simple.
It may be worth keeping this kind of thing in mind:
http://code.google.com/p/django-preferences/
Ideally the settings file should be simple. We already have
dependencies: i.e. the plot dir is the HOME_PATH + 'plot_images'. The
trouble is, if you change HOME_PATH after the plot dir has initialized
this won't change. Ideally you don't want to freeze this kind of
configuration dependency at all in the settings file, since it means
you cannot tweak the settings easy enough.
Cheers,
James
It looks like the code in the repo has the django_settings commented
out in INSTALLED_APPS. You will need it enabled to load the fixture
script.
How do you feel about adding this dependency? It seems pretty useful
(see attached model graph). However, we could probably work around
it.
> I also tried the variation _desktop_settings, and i get the same error.I will submit new documentation if we decide we are not going to roll
>
> I probably missed better instructions for how to use the new management
> commands somewhere... took me a while to even remember this email after
> being confused by all the new changes in the source for a while ;)
this back.
I had previously missed all the stuff in the 'devel' folder - with
this new system we could probably have a '_settings_development' to do
this style configuration.
Ideally the settings file should be simple. We already have
dependencies: i.e. the plot dir is the HOME_PATH + 'plot_images'. The
trouble is, if you change HOME_PATH after the plot dir has initialized
this won't change. Ideally you don't want to freeze this kind of
configuration dependency at all in the settings file, since it means
you cannot tweak the settings easy enough.
Cheers,
Yes.
James