Hey Artellos,
One more question for you
I figured out that I couldn't keep a computer running at all times because each user's computer has a different server. I figured out the code to make this work:
import os, sys
sys.path += [r'c:\dev\incidents']
os.environ['DJANGO_SETTINGS_MODULE'] = 'incidents.settings'
from django.core.management import call_command
from threading import Thread
t = Thread(target=call_command, args=('runserver',), kwargs={'shutdown_message':"done", 'use_reloader':False})
t.start()
import webbrowser
webbrowser.open('http://127.0.0.1:8000/admin/base/incident/add/')
I also had to change my setup a little:
from distutils.core import setup
import py2exe
import sys
sys.argv.append("py2exe")
setup(windows = [{"script": 'pyweb.py'}])
Everything was working great until I went to make it into an .exe -- I made it into it and when I run it, I get an error saying to see the logfile in my file, so i did that and these are the errors it is giving me:
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyc", line 486, in __bootstrap_inner
File "threading.pyc", line 446, in run
File "django\core\management\__init__.pyc", line 125, in call_command
CommandError: Unknown command: 'runserver'
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyc", line 486, in __bootstrap_inner
File "threading.pyc", line 446, in run
File "django\core\management\__init__.pyc", line 125, in call_command
CommandError: Unknown command: 'runserver'
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyc", line 486, in __bootstrap_inner
File "threading.pyc", line 446, in run
File "django\core\management\__init__.pyc", line 125, in call_command
CommandError: Unknown command: 'runserver'
I'm not sure what to do to change that line runserver??
Thanks
Edited by FutbolMolly, 10 June 2008 - 12:33 PM.