jesouhaite08 0 Newbie Poster

I created a program and when I click on it, it launches the server and runs at http://127.0.0.1:8000

This is my code for it:

pyweb.py:

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/')
input('Press the enter key when ready to exit')

my setup.py:

from distutils.core import setup
import py2exe

setup(windows = [{"script": 'pyweb.py'}])

Now, I need to make it an executable to run on other computers in my office. I did py2exe and when i launch the exe it creates, I get this error:

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'

Traceback (most recent call last):
  File "pyweb.py", line 11, in <module>
EOFError: EOF when reading a line

Hope that makes sense..
I would really appreciate any help you can give me, I have been trying to figure this out for the past week.

Thanks alot,
Molly

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.