First Try...

My first attempt at blogging...

more on python code organization...

In the last entry, i had started looking into how to better orgazine the code into files/classes so it was easier to navigate.

While doing this and following one of the links i found on a google search, i could see that not all was simple or correct and it was more around the import of the new modules/packages/classes.

After a few tests and tries, and by moving the views.py to a folder and split it into separate files for each view, we also needed to create on the folder the file __init__.py to import the classes/views/packages into the project, i had a few issues with the import:

from .views import home

And the issue was to understand the need of the "." before the "views".

To understand it a bit better, i had a look into the python documentation and found this reference to:

Package Relative Imports

Where it states the "." is a relative import to the current directory/folder.
It is still a bit of a strange way of doing things, but of course, it is probably also the way i look at these type of things from others languages perspectives and also for the fact that i have fully learned python. It has been more a trial and error learning and tryng as i go along.