Django Folder Boostrapping

72 views
Skip to first unread message

LokotamaTheMastermind

unread,
Sep 28, 2020, 1:08:19 PM9/28/20
to Django developers (Contributions to Django itself)
I think Django should add the urls.py file when bootstrapping the project with command django-admin startapp app

The information inside could be 

```
from django.urls import path
# Use this to define apps routes
urlpatterns = []
```

It will really help, thank you

Adam Johnson

unread,
Sep 28, 2020, 2:06:37 PM9/28/20
to django-d...@googlegroups.com
Hi

startapp is customizable with templates: https://docs.djangoproject.com/en/3.0/ref/django-admin/#cmdoption-startapp-template . You can base such a template on the built-in template and customize it how you like - for example adding a urls.py file: https://github.com/django/django/tree/master/django/conf/app_template

If you want to change the default template, it would require more than opinion. For example, can you show what % of apps need their own urls.py files? How common is this practice across the community? For example, recently I've mostly worked with projects using a single urls.py file for the whole site, rather than implement them per-app, since it makes them more comprehensible.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1c03eb0d-fac0-49cd-9733-05463fa404a6n%40googlegroups.com.


--
Adam

Amit Gautam

unread,
Sep 28, 2020, 3:22:28 PM9/28/20
to Django developers (Contributions to Django itself)
Hey! can you please help me in my django related taks 

Mariusz Felisiak

unread,
Sep 29, 2020, 3:30:32 AM9/29/20
to Django developers (Contributions to Django itself)
Hi,

    It was discussed in the past, see https://code.djangoproject.com/ticket/25943. Please bump the old conversation instead of creating a new one.

Best,
Mariusz

Reply all
Reply to author
Forward
0 new messages