Combining django apps

63 views
Skip to first unread message

Jun Tanaka

unread,
Oct 18, 2022, 6:01:15 AM10/18/22
to Django users


mysite/

    manage.py

    config/

        __init__.py

        settings.py

        urls.py

        wsgi.py

    app1/

        app1a/

      app1b/

    app2/

    app3/


I would like to know how to combine  apps together just like above.  Each app itself  works fine when runserver. I followed some websites talking about this but I always get some error like ‘app1a' is not a registered namespace. I'm not very familiar with combining apps. I hope someone can tell me the simplest way to do that.

Thank you.

subin

unread,
Oct 18, 2022, 1:09:07 PM10/18/22
to django...@googlegroups.com
Hi ! Thanks for making an appointment with us. We’re located at . We look forward to seeing you then!

--
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/f4a91be8-c4a3-4fa1-9a73-bd202f1f6716n%40googlegroups.com.

Paulo Andrade

unread,
Oct 19, 2022, 12:49:41 AM10/19/22
to Django users
First of all, you need to add all your apps in INSTALED APPS into the project > setings.py. I have 3 apps, core, members, and home. 

INSTALLED_APPS = [
  (..)
  'core',
  'members',
  'home',
 ]

Secondly, you need to create a route to each app in your project > urls.py

urlpatterns = [
  path(' ', include('home.urls')),
  path('udemy/', include('core.urls')),
  path('w3schools/', include('members.urls')),
  path('c-panel/', admin.site.urls),
 ]


After that, each app will be self-independent I  mean with your own models, templates, statics, etc. 

* Of course, you will need to run state collect and migrations commands on the terminal 
** make sure -->  ROOT_URLCONF = 'YOURPROJECT.urls' <-- project > setings.py

Let me show you an example 




subin

unread,
Oct 19, 2022, 1:58:08 AM10/19/22
to django...@googlegroups.com
Please let me know if you need an extension.

--
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.

Jun Tanaka

unread,
Oct 19, 2022, 3:04:25 AM10/19/22
to Django users

Thank you for your answer. I can not see below "Let me show you an example". Probably, some of last sentences got cutoff. And I want to see an example. 


2022年10月19日水曜日 13:49:41 UTC+9 eupaulo...@gmail.com:

Jun Tanaka

unread,
Oct 19, 2022, 3:10:05 AM10/19/22
to Django users

Also, some website says something like

INSTALLED_APPS = [ 'todo.apps.TodoConfig', 

 

You say,

INSTALLED_APPS = [ 'todo', 

I am confused. Which is proper? And the difference?  


2022年10月19日水曜日 13:49:41 UTC+9 eupaulo...@gmail.com:
First of all, you need to add all your apps in INSTALED APPS into the project > setings.py. I have 3 apps, core, members, and home. 

ASAMOAH EMMANUEL

unread,
Oct 20, 2022, 10:43:41 AM10/20/22
to django...@googlegroups.com
Register all your apps in the settings.py file and ensure the namespace is set to the app name in the urls.py in the project directory

--
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.

Aziz Mek

unread,
Oct 20, 2022, 12:10:53 PM10/20/22
to Django users
Hi,

Both are correct and lead to the same thing, however Django documentation seems to prefer  odo.apps.TodoConfig

I hope that helps

Kind regards
Aziz

Mohammed Mohamed

unread,
Oct 21, 2022, 1:59:41 PM10/21/22
to Django users
Hello there, can we arrange Google meetings so that I can be able to learn from you? I'm a Python Beginner.

Dev Hs

unread,
Oct 25, 2022, 1:30:27 PM10/25/22
to django...@googlegroups.com
When register app in config right all path to the app like 
“app1.app1a”
--
Reply all
Reply to author
Forward
0 new messages