Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'package,': 0.03; 'subject:using': 0.04; '21,': 0.09; 'executed': 0.09; 'subject:access': 0.09; 'subject:django': 0.09; 'pm,': 0.10; 'wrote:': 0.14; '52,': 0.16; 'indexerror:': 0.16; 'to:addr:free.fr': 0.16; 'traceback': 0.16; '(most': 0.16; 'cc:addr:python-list': 0.17; 'tue,': 0.17; 'admin': 0.18; 'header :In-Reply-To:1': 0.21; 'skip:m 30': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'last):': 0.23; 'received:209.85.161.46': 0.23; 'received:mail-fx0-f46.google.com': 0.23; 'structure': 0.23; 'skip:( 30': 0.24; 'index': 0.25; 'received:209.85.161': 0.26; 'script': 0.27; 'work.': 0.28; 'message-id:@mail.gmail.com': 0.28; 'bit': 0.30; 'least': 0.30; "won't": 0.30; 'cc:addr:python.org': 0.30; 'django': 0.31; 'list': 0.33; 'project': 0.33; 'file': 0.34; 'skip:" 10': 0.35; 'skip:{ 10': 0.35; 'running': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.37; 'think': 0.38; 'anything': 0.38; 'subject:: ': 0.38; 'subject: (': 0.39; 'should': 0.39; 'received:209': 0.39; 'basic': 0.40; 'more': 0.60; 'sites': 0.65; '11,': 0.68; 'news123': 0.84; 'skip:# 40': 0.84; 'subject:nothing': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=XyVdwU+SPUrEBpf0QfWPxiBoufyfrBlCD3mKnztu3GA=; b=Q65pEVzBHLRt6d88ZU4/9bQOB9xTxsndIOjNInHYmQwZJ5UIES+HBdjJpcZYLzWpOO UqW98lzZLhD/4KHvuqQFcm+6JlgaFslb/A4brvMfD9CugvrHxm7sLPpFFT1tEjbZHChp KOv8SyvVgs0upmfwjmgvwhUq8aEySEssArJns= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=aANu48nT7T+uP6PUdqX5PvfPAkAx3pUXApI5zChATzpw3NU6ik4HnKdeuHyeTPJ3Qd JKlBI/OlvkL/L/uF5keuicEau6Cd53TFZRyKlsj+2po9izr2HDMZfZVBg1OdRZlgoLfI aqUd+M/rUAc+brG6uwBB/Tl7hjEiWZ40mV9fo= MIME-Version: 1.0 In-Reply-To: <4e013a7b$0$26173$426a74cc@news.free.fr> References: <4e012e8d$0$23682$426a34cc@news.free.fr> <4e013a7b$0$26173$426a74cc@news.free.fr> From: Ian Kelly Date: Tue, 21 Jun 2011 19:04:07 -0600 Subject: Re: using only the django ORM (DB access model) and nothing else. To: News123 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308704679 news.xs4all.nl 49046 [::ffff:82.94.164.166]:37027 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8156 On Tue, Jun 21, 2011 at 6:42 PM, News123 wrote: > ############################################### > If running myapp.py I get following output: > > yes this line is executed > Traceback (most recent call last): > =A0File "./myapp.py", line 11, in > =A0 =A0class Mini(models.Model): > =A0File > "/opt/my_python/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/d= b/models/base.py", > line 52, in __new__ > =A0 =A0kwargs =3D {"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.