Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Exe


  • Please log in to reply

#31
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
Your welcome :)
And thank you for posting back it worked! :)

Regards,
Olrik

Edited by Artellos, 11 June 2008 - 11:46 PM.

  • 0

Advertisements


#32
FutbolMolly

FutbolMolly

    Member

  • Topic Starter
  • Member
  • PipPip
  • 33 posts
Olrik,

Can you help me?!

I made a new server because the one i had wasn't working:

import os
import sys
import time
from django.core.management import call_command
import threading 
import thread
from django.core.management.commands.runserver import Command
import webbrowser

sys.path += [r'c:\dev']
sys.path += [r'p:\Hazard_Inventory']
os.environ['DJANGO_SETTINGS_MODULE'] = 'incidents.settings'

#t = thread.start_new_thread(os.system, (u'C:\\Python25\\python C:\\dev\\\\incidents\\manage.py runserver > nul', ))

class RunDevServer(threading.Thread):
	def run(self):
		s = Command()
		s.execute(use_reloader=False)

def start_dev_server():
	t = RunDevServer()
	t.setDaemon(False)
	t.start()
	time.sleep(.2)

start_dev_server()

webbrowser.open('http://127.0.0.1:8000/admin/base/incident/add/')

This new code works and then i make it into an exe and I get this error:

Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyo", line 486, in __bootstrap_inner
File "pyweb.py", line 20, in run
File "django\core\management\base.pyo", line 81, in execute
File "django\utils\translation\__init__.pyo", line 73, in activate
File "django\utils\translation\__init__.pyo", line 43, in delayed_loader
File "django\utils\translation\trans_real.pyo", line 211, in activate
File "django\utils\translation\trans_real.pyo", line 200, in translation
File "django\utils\translation\trans_real.pyo", line 183, in _fetch
AttributeError: 'module' object has no attribute 'auth'


I'm really confused because I don't see how it would work before the exe and then not as an exe..

Thanks :)
Molly
  • 0

#33
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
Hmm, Maybe it's a good idea to get someone better in python to take a look at it.
Post in the following forum.
http://www.geekstogo...opment-f60.html

You can also apply to one of the python mail lists and ask a question there.

I'm just a beginner at python and the initial post seemed simple so I took it on :) (I like a challenge)
Though I haven't had the time to grow much in coding.

I wish you good luck in that forum!

Regards,
Olrik
  • 0

#34
FutbolMolly

FutbolMolly

    Member

  • Topic Starter
  • Member
  • PipPip
  • 33 posts
Alright thanks a lot, Olrik :)
  • 0

#35
FutbolMolly

FutbolMolly

    Member

  • Topic Starter
  • Member
  • PipPip
  • 33 posts
Also..

I wanted to show you this..

For doing py2exe if in the setup you use this code:

from distutils.core import setup
import py2exe
import sys

if len(sys.argv) == 1:
	sys.argv.append("py2exe")

setup( options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1, "bundle_files": 1}},
	zipfile = None,

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

If you use that, it only makes 3 icons instead of a bunch that the other code does.

I found that in a forum somewhere, thought you might like to see that!
  • 0

#36
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
For me that caused a few problems!
You might want to try and remove that part and see if it works then :)

Regards,
Olrik
  • 0

#37
FutbolMolly

FutbolMolly

    Member

  • Topic Starter
  • Member
  • PipPip
  • 33 posts
Darn, same problem still..

I wish that was the problem!
  • 0

#38
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
I suggest you post in the software forum then :)

Regards,
Olrik
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP