On Thu, Aug 1, 2013 at 8:41 AM, Tom Evans <[email protected]> wrote:
> On Thu, Aug 1, 2013 at 3:17 PM, Larry Martell <[email protected]> wrote:
>> On Thu, Aug 1, 2013 at 2:30 AM, Branko Majic <[email protected]> wrote:
>>> On Wed, 31 Jul 2013 17:59:56 -0600
>>> Larry Martell <[email protected]> wrote:
>>>
>>>> On my Mac, running python 2.7, I upgraded from 1.4 to 1.5 by doing this:
>>>>
>>>> rm -rf /Library/Python/2.7/site-packages/django
>>>>
>>>> Followed by python setup.py install in the dir I untar-ed Django-1.5.1
>>>> to. This all worked fine.
>>>>
>>>>
>>>> On a Centos system running python 2.6 I did:
>>>>
>>>> rm -rf /usr/lib/python2.6/site-packages/django followed by the
>>>> setup.py install. My django app is working, and appears to be running
>>>> 1.5, however anytime I use manage.py (for collectstatic or syncdb or
>>>> test, for example) I get these messages:
>>>>
>>>> /usr/lib/python2.6/site-packages/django/core/management/__init__.py:465:
>>>> DeprecationWarning: The 'execute_manager' function is deprecated, you
>>>> likely need to update your 'manage.py'; please see the Django 1.4
>>>> release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
>>>>   DeprecationWarning)
>>>> /usr/lib/python2.6/site-packages/django/core/management/__init__.py:409:
>>>> DeprecationWarning: The 'setup_environ' function is deprecated, you
>>>> likely need to update your 'manage.py'; please see the Django 1.4
>>>> release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
>>>>   DeprecationWarning)
>>>>
>>>> So it seems I still have some 1.4 stuff around. I don't get this on my
>>>> Mac. How can I get rid of these messages?
>>>>
>>>
>>> How are you running management commands? Using the ./manage.py from the
>>> project? In that case you probably just need to replace the manage.py
>>> with a newer version (from Django 1.5).
>>
>> Yes, I'm running manage from the project. I copied in the new 1.5
>> manage and now I'm getting this:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in <module>
>>     execute_from_command_line(sys.argv)
>>   File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
>> line 453, in execute_from_command_line
>>     utility.execute()
>>   File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
>> line 392, in execute
>>     self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
>> line 263, in fetch_command
>>     app_name = get_commands()[subcommand]
>>   File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
>> line 109, in get_commands
>>     apps = settings.INSTALLED_APPS
>>   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py",
>> line 53, in __getattr__
>>     self._setup(name)
>>   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py",
>> line 48, in _setup
>>     self._wrapped = Settings(settings_module)
>>   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py",
>> line 134, in __init__
>>     raise ImportError("Could not import settings '%s' (Is it on
>> sys.path?): %s" % (self.SETTINGS_MODULE, e))
>> ImportError: Could not import settings '{{ project_name }}.settings'
>> (Is it on sys.path?): No module named {{ project_name }}.settings
>>
>> There is a settings.py file in the dir I an running from. The actual
>> error is coming here"
>>
>> (Pdb) l
>> 104             _commands = dict([(name, 'django.core') for name in
>> find_commands(__path__[0])])
>> 105
>> 106             # Find the installed apps
>> 107             from django.conf import settings
>> 108             try:
>> 109 B->             apps = settings.INSTALLED_APPS
>> 110             except ImproperlyConfigured:
>> 111                 # Still useful for commands that do not require
>> functional settings,
>> 112                 # like startproject or help
>> 113                 apps = []
>> 114
>> (Pdb) print settings.INSTALLED_APPS
>> *** ImportError: Could not import settings '{{ project_name
>> }}.settings' (Is it on sys.path?): No module named {{ project_name
>> }}.settings
>
> You've copied the template of manage.py. This template is usually
> filled in by django-admin.py when you create a new project, so two
> options, run django-admin.py to create a filled in template of
> manage.py, copy manage.py into place and remove the new stub project
> from which it came, or fill in the template manually.
>
> This was covered in the release notes for 1.4, which is when it
> changed (1.5 stopped working with manage.py from 1.3, where as 1.4
> would work with a manage.py from 1.3.)
>
> https://docs.djangoproject.com/en/1.5/releases/1.4/#updated-default-project-layout-and-manage-py

Thanks very much Tom. This explains a lot - we were using the 1.3
manage file with 1.4. I'm very close now, but I'm not sure what to put
in for project_name - my project is called 'motor'. I tried
motor.settings, but I got 'could not import motor.settings: No module
named motor.settings'. I tried just 'settings' and that made manage
happy, but then it could not import any of my installed apps (which
all start with motor.).

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to