Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8156

Re: using only the django ORM (DB access model) and nothing else.

References <4e012e8d$0$23682$426a34cc@news.free.fr> <4e013a7b$0$26173$426a74cc@news.free.fr>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-06-21 19:04 -0600
Subject Re: using only the django ORM (DB access model) and nothing else.
Newsgroups comp.lang.python
Message-ID <mailman.259.1308704678.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Jun 21, 2011 at 6:42 PM, News123 <news1234@free.fr> wrote:
> ###############################################
> If running myapp.py I get following output:
>
> yes this line is executed
> Traceback (most recent call last):
>  File "./myapp.py", line 11, in <module>
>    class Mini(models.Model):
>  File
> "/opt/my_python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/models/base.py",
> line 52, in __new__
>    kwargs = {"app_label": model_module.__name__.split('.')[-2]}
> IndexError: list index out of range
> (my_python)n1234@mypc:~/minidjango$
>
>
> So I need at least a little more to make my script work.

There's a bit of magic in the way Django finds things, and I think
you'll still need to keep the basic structure of a Django project --
models should be in a "models.py" file located in an "app" package,
which should be included in the INSTALLED_APPS setting.  You just
won't have any views or urlconfs or templates or admin sites or
anything like that.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

using only the django ORM (DB access model) and nothing else. News123 <news1234@free.fr> - 2011-06-22 01:51 +0200
  Re: using only the django ORM (DB access model) and nothing else. News123 <news1234@free.fr> - 2011-06-22 02:42 +0200
    Re: using only the django ORM (DB access model) and nothing else. Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-21 19:04 -0600
      Re: using only the django ORM (DB access model) and nothing else. News123 <news1234@free.fr> - 2011-06-22 03:14 +0200
    Re: using only the django ORM (DB access model) and nothing else. News123 <news1234@free.fr> - 2011-06-22 03:10 +0200
  Re: using only the django ORM (DB access model) and nothing else. Roy Smith <roy@panix.com> - 2011-06-21 21:02 -0400
    Re: using only the django ORM (DB access model) and nothing else. News123 <news1234@free.fr> - 2011-06-22 03:16 +0200

csiph-web