Different urls.py file for different apps

1,299 views
Skip to first unread message

siddharth56660

unread,
May 22, 2012, 6:49:58 AM5/22/12
to Django users
Hi,
I am developing an ERP system which is vast and covers many modules.
After developing each module i create another app for second module
by
" django-admin.py startapp myapp2 "
This is perfectly working fine.
But my urls.py is growing very fast and has crossed more than 5000
lines with lot more to come.

Is there any other way in which i can make different urls.py as per my
apps.
I tried googling around but i dint find any way to give multiple apps
in setting.py file in ROOT_URLCONF entry.

Please help me around.

Alexandr Aibulatov

unread,
May 22, 2012, 7:07:13 AM5/22/12
to django...@googlegroups.com
you could include urls of app into your_app/urls.py

urlpatterns = patterns('',
(r'your_app/', include('your_apps.urls'))
(r'your_app2/', include('your_apps2.urls'))
)

2012/5/22 siddharth56660 <siddharth...@gmail.com>:
> --
> 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.
>

Andy McKay

unread,
May 22, 2012, 7:07:38 AM5/22/12
to django...@googlegroups.com
Use include to pull in values from other apps inside your urls.py

https://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs
Reply all
Reply to author
Forward
0 new messages