Is my Django structure correct?


I have some difficulties to understand and make working my first Django app, and thew problems started when I tried to configure the urlpartterns.

I wonder if I created my project, my application at the right level.

First I created a folder.
Into that folder, I create an virtual environementvirtualenv env-console
I went to my environemnt
sourve env-console/bin/activate and I installed django.
Ithen created a project django-admin startproject pjtconsole and I created an application name appconsole

I wonder why appconsole is at the same level than pjtconsole
An application “belong” to a project. Appconsole should not be a child of pjtconsole?
The tree below, seems to be coherent?

If yes, how can I configure url


and if the urlpattern does not exist, which URL can show the view page?


(env-console) pierrot@ubuntu1:~/ecosensors$ tree -L 2
├── appconsole
│   ├──
│   ├──
│   ├──
│   ├── migrations
│   ├──
│   ├──
│   ├── views
│   └──
├── db.sqlite3
├── env-console
│   ├── bin
│   ├── lib
│   └── pyvenv.cfg
├── pjtconsole
│   ├──
│   ├──
│   ├── __pycache__
│   ├──
│   ├──
│   └──

i guess its subjective for each developer to structure the folder.
but i see you created a Views folder inside your app appconsole, there is already file to write your views inside, why you add more layers you can use what framework provide specially in the beginning.

its normal, and folder structure is subjective into developer opinion and how the developer implement the project.

Project url will have an include path to the App and inside project you will refer to each view. as example:


path('appconsole/', include('appconsole.urls')),


path('page', views.get_page, name='get_page'),

this question is not clear please describe it more.