py2exe + Django 1.6

167 views
Skip to first unread message

Antonio Francisco Martín Romero

unread,
Apr 10, 2014, 8:19:19 AM4/10/14
to django...@googlegroups.com
Hi everyone,

I was using py2exe + Django 1.3 without problems. From Django 1.4 the way to find the commands changed  and it tries to find .py files as you can see in the find_commands() function in the file core/management/__init__.py . When you compile Django using py2exe, your don't have .py files, just .pyc and manage.exe won't have any command. I have tried to modify the find_command() function but the result was negative. Also, I have tried to run commands manually but the functions try to find .py files as well.

Did anyone manage to do it?

Cheers

johan de taeye

unread,
Apr 10, 2014, 9:29:38 AM4/10/14
to django...@googlegroups.com

This is very old issue in Django: see ticket https://code.djangoproject.com/ticket/8280
I've attached the patch I'm already using for years to package my django application with py2exe.

I don't understand why the core team continues to use the current un-pythonic code to discover commands and fails to merge any of the fixes that have been proposed.

Johan


Op donderdag 10 april 2014 14:19:19 UTC+2 schreef Antonio Francisco Martín Romero:
django_core_management_init.patch
Message has been deleted

Johan De Taeye

unread,
Apr 10, 2014, 12:46:23 PM4/10/14
to django...@googlegroups.com

Here’s a revised patch.

The previous patch addresses the issue with commands, but I needed some additional things to get things up and running with py2exe.

 

If it helps, you can download the installer of my application at http://sourceforge.net/projects/frepple/files/ and browse all source code at https://github.com/jdetaeye/frePPLe

 

Johan

 

From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf Of Antonio Francisco Martín Romero
Sent: Thursday, April 10, 2014 5:46 PM
To: django...@googlegroups.com
Subject: Re: py2exe + Django 1.6

 

Thank you very much.

 

I can see the commands but I get an error when I try to run one. I have attached my manage.py file. See below the errors

 

 

>manage.exe shell

Traceback (most recent call last):

  File "manage.py", line 28, in <module>

  File "django\core\management\__init__.pyc", line 365, in execute_from_command_

line

  File "django\core\management\__init__.pyc", line 358, in execute

  File "django\core\management\base.pyc", line 242, in run_from_argv

  File "django\core\management\base.pyc", line 280, in execute

  File "django\utils\translation\__init__.pyc", line 130, in activate

  File "django\utils\translation\trans_real.pyc", line 188, in activate

  File "django\utils\translation\trans_real.pyc", line 178, in translation

  File "django\utils\translation\trans_real.pyc", line 146, in _fetch

AttributeError: 'NoneType' object has no attribute '_info'

 

Cheers

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/dRQ8owj0myU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/22a72b73-76a0-4730-bbf8-2c1e0d79bee8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

django_py2exe.patch
Reply all
Reply to author
Forward
0 new messages