Running Cappuccino not in root director.

21 views
Skip to first unread message

Seth Buntin

unread,
May 12, 2009, 12:19:03 PM5/12/09
to Cappuccino & Objective-J
I am trying to get Cappuccino to run not from the root directory since
I am using a framework (Django) as my "backend". The issue I am
running into is kinda weird. Everything loads fine, I get no
"unexpected" 404's and everything seems to load but I still see the
progress indicator and applicationDidFinishLaunching doesn't seem to
be ran so I might have something wrong in my INCLUDE PATH.

Here is my folder structure:

static
`-- cappuccino
|-- AppController.j
|-- Frameworks
| |-- AppKit
| |-- BlendKit
| |-- Foundation
| `-- Objective-J
|-- Info.plist
|-- index-debug.html
|-- index.html
`-- main.j

and here is my HTML template head:

<title>Cappuccino Admin</title>
<script type = "text/javascript">
OBJJ_MAIN_FILE = "/static/cappuccino/main.j";
OBJJ_INCLUDE_PATHS = ['/static/cappuccino/Frameworks/', '/static/
cappuccino/']
</script>
<script src = "/static/cappuccino/Frameworks/Objective-J/Objective-
J.js" type = "text/javascript"></script>

Am I missing something? I put '/static/cappuccino/' in the include
path so that AppController.j might be found but I'm not sure if that
is needed or not.

Tom Robinson

unread,
May 12, 2009, 3:07:20 PM5/12/09
to objec...@googlegroups.com
The paths you specify in OBJJ_MAIN_FILE and OBJJ_INCLUDE_PATHS are for
the client, not the server. I don't know Django but I assume it serves
all files in the "static" directory at the root of the app. Try
without the "/static".

-Tom

Seth Buntin

unread,
May 12, 2009, 3:39:35 PM5/12/09
to Cappuccino & Objective-J
Yeah, Django is kinda different, they presume you handle serving media
apart from the framework, so we have to hack a url/route together so
that when in development mode we can access the media. So if I go to /
static/cappuccino/main.j it is serving the file, i just can't figure
out how to get it to work. Taking the /static out didn't work, and
just static without a beginning slash, does the same as if I had the
slash.

fran...@280north.com

unread,
May 12, 2009, 4:07:49 PM5/12/09
to Cappuccino & Objective-J
Tom knows better about this, but what we do in 280 Slides is just set
the base tag in index.html and it seems to work out alright.

Seth Buntin

unread,
May 12, 2009, 5:02:45 PM5/12/09
to Cappuccino & Objective-J
Can you explain the process that Cappuccino goes through to start the
application? I can't seem to figure this out, and I want to know
where I can start debugging. In Django, this is how I normally setup
my static file stuff so it isn't something different than normal (in a
Django sense).

Seth Buntin

unread,
May 13, 2009, 11:57:43 AM5/13/09
to Cappuccino & Objective-J
Well, I never good really figure this out so I just switched back to
using Rails for Cappuccino applications, it just worked with it.

Seth Buntin

unread,
May 13, 2009, 12:33:15 PM5/13/09
to Cappuccino & Objective-J
One last note, I got it working in Django, I re-read Francisco's reply
and it clicked, adding the base template tag worked perfectly. So I
added a base tag that pointed to http://localhost:8000/static/cappuccino/
and everything is great!!!

harish

unread,
May 29, 2009, 12:24:12 PM5/29/09
to Cappuccino & Objective-J
Sorry - I'm not finding a 'base' tag referenced in index.html or the
docs - could someone point me in the right direction?

On May 13, 11:33 am, Seth Buntin <sethtr...@gmail.com> wrote:
> One last note, I got it working in Django, I re-read Francisco's reply
> and it clicked, adding the base template tag worked perfectly.  So I
> added a base tag  that pointed tohttp://localhost:8000/static/cappuccino/

fran...@280north.com

unread,
May 29, 2009, 2:52:47 PM5/29/09
to Cappuccino & Objective-J
The base tag is just references in this thread. Basically you do
something along the lines of

<base href = "directory/with/my/cappuccino/app" />

in your index.html file and you should be all set.

Harish Agarwal

unread,
May 29, 2009, 4:28:19 PM5/29/09
to objec...@googlegroups.com
I see - I didn't realize it was an html tag.

This is a problematic solution for me - I'm including links and paths
inherited in my template which assume that the base url is the default
one. Changing it creates problems during the import of other needed
libraries. It also doesn't solve the problem of keeping
"AppController.j" in a separate directory from the cappuccino
framework code.

Basically I'm looking for a solution which lets me use Cappuccino like
I'm using jQuery already - I can load the jQuery library from any path
(including from other domains) without running into problems
initializing jQuery code. I can also keep my html template separate
from jQuery javascript code I'm writing, which helps immensely with
organization.

How can I arrange for the same behavior with my cappuccino
application? I've tried using the variables which Seth Buntin used
below:

OBJJ_MAIN_FILE
OBJJ_INCLUDE_PATHS

but have had no luck. Any other suggestions would be greatly
appreciated.

Tom Robinson

unread,
May 31, 2009, 1:43:33 PM5/31/09
to objec...@googlegroups.com
This seems to be a bug. Changing OBJJ_MAIN_FILE and OBJJ_INCLUDE_PATHS
should work. Could you file a ticket on Github?

Harish Agarwal

unread,
May 31, 2009, 11:24:34 PM5/31/09
to objec...@googlegroups.com
I created a new issue:

http://github.com/280north/cappuccino/issues#issue/176

if you could point me in the right direction to get started, I'd be
happy to start looking into the issue myself as I'd like to have this
resolved ASAP.
Reply all
Reply to author
Forward
0 new messages