In Django project how to create app in subapp in apps folder.

103 views
Skip to first unread message

Salima Begum

unread,
May 18, 2021, 11:20:41 AM5/18/21
to django...@googlegroups.com
Hi all,

We initially developed our project with the following folder structure;

old_folder_structure.PNG

As shown in the above image we have developed and integrated everything into a few files. Since the functionality is growing we are planning to separate each functional module as an individual app folder structure within the old app folder. I am thinking of creating an apps folder and within the apps folder I want to create individual apps folder( just like what is seen in the above image). So the new folder structure is created as shown in the image below.

within_app.PNG
When I have run migrations after creating I am getting an error.
```
AttributeError: module 'oldapp.apps' has no attribute 'categories'
```

```
django.core.exceptions.ImproperlyConfigured: ' oldapp .apps' does not contain a class 'categories'. Choices are: ' OldappConfig'.
```

Ayser shuhaib

unread,
May 18, 2021, 11:28:25 AM5/18/21
to django...@googlegroups.com
I think you should add __init__.py file inside your apps folder for Django to see it

--
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 django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6bnOSptHtzeSBK_2BfRE%2BxzLpD8LAAnkYecHTK25_nz1aA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages