But instead has to be created by the user.
project
|
+-- settings.py
+-- mysite
|
+-- views.py
+-- apps.py
+-- models.py
+-- * user created urls.py file *
When we start a new project, we are provided with a urls.py file. However, when we create apps within our project, Django doesn't provide the urls.py file for us and we are expected to create it manually.
The startapp command in Django is used to create a new app with our project. Now, we can use this command multiple times within our project to create multiple apps. By executing this command, Django automatically creates the application directory in the project directory.
This file contains site deployment data such as server names and ports. It contains a site map of Django-approved URLs. You run this file when you get obscure 404 Not Found errors in your server logs.
The admin.py file is used to display your models in the Django admin panel. You can also customize your admin panel. Hope this helps you.
An app doesn't need to have urls, views, or anything at all. It can also just be a collection of templates or be a middleware. Therefore these files have to be created by the user when needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With