Re: Django newbie with issues

1,373 views
Skip to first unread message

Cal Leeming [Simplicity Media Ltd]

unread,
Sep 11, 2012, 6:44:55 AM9/11/12
to django...@googlegroups.com
Ouch, 1.1 is very old indeed.

I have seen compatibility issues before when running django/py apps on a mac, but can't say I've ever ran into this before.

Could you upgrade to the latest (1.4.1) and see if you still experience the same issue?

Cal

On Tue, Sep 11, 2012 at 11:03 AM, Morrti <sirr...@googlemail.com> wrote:
Hi,

I'm a total newbie to Django and I'm trying to follow the build your first app tutorial from the site https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but have soon run into problems, please see below. This is as a result of running the  python manage.py runserver command.

If anyone can help, I believe I'm running version 1.1 of django, not sure what else you may want to know.

Thanx,

python manage.py runserver
Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x10114d0d0>>
Traceback (most recent call last):
  File "/Users/timmorris/Sites/django/django-trunk/django/core/management/commands/runserver.py", line 91, in inner_run
    self.validate(display_num_errors=True)
  File "/Users/timmorris/Sites/django/django-trunk/django/core/management/base.py", line 277, in validate
    num_errors = get_validation_errors(s, app)
  File "/Users/timmorris/Sites/django/django-trunk/django/core/management/validation.py", line 32, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", line 163, in get_app_errors
    self._populate()
  File "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", line 69, in _populate
    self.load_app(app_name, True)
  File "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", line 93, in load_app
    models = import_module('.models', app_name)
  File "/Users/timmorris/Sites/django/django-trunk/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Users/timmorris/Sites/django/django-trunk/django/contrib/auth/models.py", line 18, in <module>
    from django.contrib.contenttypes.models import ContentType
  File "/Users/timmorris/Sites/django/django-trunk/django/contrib/contenttypes/models.py", line 125, in <module>
    class ContentType(models.Model):
  File "/Users/timmorris/Sites/django/django-trunk/django/db/models/base.py", line 64, in __new__
    new_class.add_to_class('_meta', Options(meta, **kwargs))
TypeError: Error when calling the metaclass bases
    __init__() keywords must be strings

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/xxWivGGykWYJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Morrti

unread,
Sep 11, 2012, 9:29:05 AM9/11/12
to django...@googlegroups.com
Hi,

We did try things with v1.5, but that also failed. Looking further it seems that my branch on git was wrong.
Moving to the correct one for 1.1 has seemed to have corrected things, well we got past that issue.
I'm going to continue with the tutorial now and see how that goes.

Thanx,
Tim

Thomas Lockhart

unread,
Sep 11, 2012, 9:59:19 AM9/11/12
to django...@googlegroups.com
On 9/11/12 6:29 AM, Morrti wrote:
> Hi,
>
> We did try things with v1.5, but that also failed. Looking further it
> seems that my branch on git was wrong.
> Moving to the correct one for 1.1 has seemed to have corrected things,
> well we got past that issue.
> I'm going to continue with the tutorial now and see how that goes.
Please take the advice and use 1.4.1. And on the Mac I strongly
recommend using virtualenv; it is hard to keep things straight otherwise.

hth

- Tom

Cal Leeming [Simplicity Media Ltd]

unread,
Sep 11, 2012, 3:13:35 PM9/11/12
to django...@googlegroups.com
+1 on virtualenv - I only just started using it about 3 months ago.. don't know how the hell I survived without it for so long!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

Morrti

unread,
Sep 12, 2012, 5:46:21 AM9/12/12
to django...@googlegroups.com
Hi,

Thanks for your comments on version numbers, but moving to 1.4 isn't a quick option for me/us so I'm stuck on 1.1 for a while.

Trying to run the app and instead of getting the "welcome" page I get the following, see below.

Not withstanding my version issue, anyone got any ideas on this.

Thanx,
Tim

Traceback (most recent call last):

  File "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", line 279, in run
    self.result = application(self.environ, self.start_response)

  File "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", line 651, in __call__
    return self.application(environ, start_response)

  File "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/wsgi.py", line 230, in __call__
    self.load_middleware()

  File "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/base.py", line 42, in load_middleware
    raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware django.middleware.common: "cannot import name force_text"


On Tuesday, September 11, 2012 11:45:17 AM UTC+1, Cal Leeming [Simplicity Media Ltd] wrote:

Cal Leeming [Simplicity Media Ltd]

unread,
Sep 12, 2012, 6:17:23 AM9/12/12
to django...@googlegroups.com
May I ask the reason you cannot upgrade to 1.4???

Sticking to 1.1 is usually only done if you have an existing code base that absolutely requires 1.1.

You really need to upgrade :/

Cal

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/NBUbUejFjbgJ.

Paul Backhouse

unread,
Sep 12, 2012, 6:23:36 AM9/12/12
to django...@googlegroups.com
On Wed, 2012-09-12 at 02:46 -0700, Morrti wrote:
> moving to 1.4 isn't a quick option for me/us so I'm stuck on 1.1 for a
> while.

Why is this? If you're new to Django you should dive in at the latest
version.

If your company has existing projects that are dependent on 1.1, then
why not create a virtualenv with Django 1.4 on it so you can play around
getting to know Django. Then you can go back to 1.1 with some
confidence.

I suspect you'll get more support using a more recent version.

Morrti

unread,
Sep 12, 2012, 10:13:25 AM9/12/12
to django...@googlegroups.com
Hi,

We already have django developers here and talking to them they would like to move to 1.4
but they have not had any meaningful discussions with all the interested parties to know when this is likely to be.

I'll pass your advice back to them and see what happens though knowing the pace this place works at don't hold your breath.

Thanx,
Tim

Karen Tracey

unread,
Sep 15, 2012, 7:47:40 AM9/15/12
to django...@googlegroups.com
On Wed, Sep 12, 2012 at 5:46 AM, Morrti <sirr...@googlemail.com> wrote:
Thanks for your comments on version numbers, but moving to 1.4 isn't a quick option for me/us so I'm stuck on 1.1 for a while.

Trying to run the app and instead of getting the "welcome" page I get the following, see below.

Not withstanding my version issue, anyone got any ideas on this.

[snip]


Traceback (most recent call last):

  File "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", line 279, in run
    self.result = application(self.environ, self.start_response)

  File "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", line 651, in __call__
    return self.application(environ, start_response)

  File "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/wsgi.py", line 230, in __call__
    self.load_middleware()

  File "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/base.py", line 42, in load_middleware
    raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware django.middleware.common: "cannot import name force_text"


force_text did not exist in 1.1, but it exists in current master. Getting an error referring to it rather implies that you're running a mutant version with some leftover py/pyc files form when you were running current master (which appears to be what you were running for the first traceback posted -- the " __init__() keywords must be strings" error there is what you get today on master if you run with Python earlier than 2.6.5).

I'd start over with a completely new install, in a completely new directory tree. (I also would not include "django-trunk" in the name of that tree, if it was actually intended to hold 1.1.something.)

Karen
--
http://tracey.org/kmt/

Message has been deleted

Morrti

unread,
Sep 18, 2012, 6:15:57 AM9/18/12
to django...@googlegroups.com
Hi,

Thought I'd update you all and bring this thread to a close.

The issue was down to a typo on my part. This was corrected and symlink recreated, things seem to be ok now.
Thanks for the help/advice. 

Thanx,
Tim
Reply all
Reply to author
Forward
0 new messages