Www folder created during app development customization

I was trying to do some customizations in developer mode. I was surprised to see a 'www ’ folder got created

root@csa:/home/frappe/frappe-bench/apps/fpo_mgmt/fpo_mgmt# ls -lrt
total 40
drwxr-xr-x 4 frappe frappe 4096 Feb 23 11:01 public
-rw-r–r-- 1 frappe frappe 0 Feb 23 11:01 patches.txt
-rw-r–r-- 1 frappe frappe 14 Feb 23 11:01 modules.txt
-rw-r–r-- 1 frappe frappe 88 Feb 23 11:01 init.py
-rw-r–r-- 1 frappe frappe 2834 Feb 23 11:01 hooks.py
-rw-r–r-- 1 frappe frappe 248 Feb 23 11:03 init.pyc
-rw-r–r-- 1 frappe frappe 652 Feb 23 11:09 hooks.pyc
drwxr-xr-x 4 frappe frappe 4096 Feb 23 11:10 templates
drwxr-xr-x 2 frappe frappe 4096 Feb 23 11:10 config
drwxr-xr-x 3 frappe frappe 4096 Mar 7 09:09 fpo_management
drwxr-xr-x 2 frappe frappe 4096 Mar 17 02:15 www

All this www folder has is a init.py file which is empty.

Actually it was not created when i originally created the app. After i was updating some of the new docTypes i had created, this www folder got created. So i was wondering what change in a docType did i do, for it to create this www folder.

Do i need to add it as a git file, and push this folder to the remote as part of my app.

Pls help out.

The www folder is created when you create an app. It is strange that it was not there in the first place.

The purpose of www folder is to create web Templates. For example, if you create a HTML folder and name it html_test.html , execute command bench clear-website-cache && bench restart && bench build && bench migrate and then navigate localhost:8080/html_test.html , you will se your html content there.

1 Like

Thanks @aldoblack
After looking at it further, i found that there is another folder called ‘public’ which is present in my local buy not on remote. Since public has only folders and no files, git did not add it as a git element.
So same could have happened with www folder. May be the folder would have been created when the app was created. But the init.py was just created for some reason. So git started to show this www folder now.
Since there is no way to know when a folder was created in unix (we can find when it was updated or accessed) its hard to say when www was created. But i see public folder was created when i created the app.

You can see the contents of the virtual machine by connecting with Filezilla.

Host: sftp://localhost
Username: frappe
Password: frappe
Port: 3022

These are configs for ERPNext downloaded from here and installed on your Virtual Box.

So anytime you create a new app bench new-app , you can see if www folder was created . Or any other.