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
On Thursday, April 10, 2014 2:29:38 PM UTC+1, johan de taeye wrote:
>
>
> 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:
>>
>> 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
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
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.
#!/usr/bin/env python
import multiprocessing
import os
import sys
import Cookie
import htmlentitydefs
import HTMLParser
from server.settings import EMARKER_PRODUCTION
if "manage.exe" in sys.executable:
#We need this so the service can work with multiple process
executable = os.path.join(os.path.dirname(sys.executable), 'multi_helper.exe')
multiprocessing.set_executable(executable)
from django.core.management import execute_from_command_line
import django
try:
import server.settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
sys.argv.append('--settings=server.settings')
execute_from_command_line(sys.argv)