Re: App inside another app or nesting in django apps

3,622 views
Skip to first unread message

Kurtis Mullins

unread,
May 31, 2012, 12:22:35 PM5/31/12
to django...@googlegroups.com
Sure. They're just Python modules. All you need to do is:

1. Include the files: __init__.py and models.py
2. Add the application to your settings.py, for example: myproject.myapp.subapp

It *should* work, although I haven't personally tested it yet.

On Thu, May 31, 2012 at 7:46 AM, vijay shanker <vshan...@gmail.com> wrote:
> can we write one app inside some another django-app .
> please suggest any reference or articles
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

Jani Tiainen

unread,
Jun 1, 2012, 2:10:35 AM6/1/12
to django...@googlegroups.com
31.5.2012 19:22, Kurtis Mullins kirjoitti:
> Sure. They're just Python modules. All you need to do is:
>
> 1. Include the files: __init__.py and models.py
> 2. Add the application to your settings.py, for example: myproject.myapp.subapp
>
> It *should* work, although I haven't personally tested it yet.
>
> On Thu, May 31, 2012 at 7:46 AM, vijay shanker<vshan...@gmail.com> wrote:
>> can we write one app inside some another django-app .
>> please suggest any reference or articles

It works perfectly. We've been using it in our environment for a good while.

There lies only one caveat - all appnames still must be unique and as
known app name is last part of module hierarchy.

So you can't have two conflicting apps:

myapp.subapp <-- appname is subapp
myotherapp.subapp <-- appname is subapp

--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

Derek

unread,
Jun 1, 2012, 2:16:25 AM6/1/12
to Django users
And the Zen of Python?

"Flat is better than nested"

On Jun 1, 8:10 am, Jani Tiainen <rede...@gmail.com> wrote:
> 31.5.2012 19:22, Kurtis Mullins kirjoitti:
>
> > Sure. They're just Python modules. All you need to do is:
>
> > 1. Include the files: __init__.py and models.py
> > 2. Add the application to your settings.py, for example:  myproject.myapp.subapp
>
> > It *should* work, although I haven't personally tested it yet.
>

Jani Tiainen

unread,
Jun 1, 2012, 2:21:26 AM6/1/12
to django...@googlegroups.com
1.6.2012 9:16, Derek kirjoitti:
> And the Zen of Python?
>
> "Flat is better than nested"

But don't forget, again Zen of Python:

"Namespaces are one honking great idea -- let's do more of those!"

Benedict Verheyen

unread,
Jun 1, 2012, 9:28:01 AM6/1/12
to django...@googlegroups.com
On 1/06/2012 8:21, Jani Tiainen wrote:
> 1.6.2012 9:16, Derek kirjoitti:
>> And the Zen of Python?
>>
>> "Flat is better than nested"
>
> But don't forget, again Zen of Python:
>
> "Namespaces are one honking great idea -- let's do more of those!"
>

Hehe, I always imagined how programmers fight.
Sorry it's hot and it's friday, and I thought it was funny how the
Zen of python was used by both Derek and Jani :)

Cheers,
Benedict

Reply all
Reply to author
Forward
0 new messages