I've made a little more progress this morning...

I created a run script to start up Django without needed to edit
manage.py directly.  With this run script I can add other features
later.  Here's the gist of it.  (Quotes is my test app I created)

#!/usr/bin/env python
import sys, os
sys.path.append(os.getcwd())

from Quotes.manage import *
# We can also pass in host:port info to start server on.
# Possibly add checks to see if port is open already and increment
# to next one for the case of >1 app running simultaneously.
execute_manager(settings, ['','runserver'])

# NOTE: execute_manager takes over script control.  If we want to
# fire up a browser window we need to do that in another thread.
# Now that server is running, open web browser?
#import webbrowser
#webbrowser.open_new('http://localhost:8000')

Some other notes: My directory structure is:
  Django-0.95/
    (all of the source of Django)
    Quotes/ (my app)
    run.py
    py2app-setup.py

My py2app-setup.py file is simply this:
#!/usr/bin/env python
from distutils.core import setup
import py2app

setup(
        app=['run.py'],
)

Running this command to build py2app and include a few modules that it
told me it was missing:

python py2app-setup.py py2app
--includes=django.contrib.auth,django.contrib.sessions,django.contrib.sites

Executing the resulting "run.app" from the dist directory gives me the
following error:

Validating models...
Unhandled exception in thread started by <function inner_run at
0x27a9f0>
Traceback (most recent call last):
  File "django/core/management.pyc", line 1039, in inner_run
  File "django/core/management.pyc", line 1003, in validate
  File "django/core/management.pyc", line 815, in get_validation_errors
  File "django/db/__init__.pyc", line 18, in ?
OSError: [Errno 20] Not a directory:
'/Users/rhudson/Desktop/Django-0.95/dist/run.app/Contents/Resources/lib/python2.3/site-packages.zip/django/db/backends'

It looks like it started fine (the validating models...), but then got
caught up in the database stuff.  I'll take a deeper look but that's
about all the time I can spend on this today.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to