-
Notifications
You must be signed in to change notification settings - Fork 12
Description of the folder architecture
liori edited this page Oct 25, 2012
·
7 revisions
Once you've created a new project and initialized it using the init.py, several folders will appear in your project directory. To understand the terms used in the following text, it may be useful to firstly take a look at the logical organization of the code.
Note: the following list contains only folders that are present in every project. For the description of files and folders which will be created later, please check the dedicated section for each folder.
- tools : contains all the scripts that will generate code for you. You can see a description of each one here.
- locale : where the .po/.mo files (localization) for your website are stored
- data : where the data files (e.g. sqlite database file) are stored
- conf : where the configuration files (e.g. for coupling with apache/nginx or using with sphinx search engine) are stored
- tests : where to put unit tests
- src : where you will find the source code of the application itself
-
contents: Where the contents-based classes are stored (used to controller<->views data transfer)
- forms: The structure representing a form displayed on the website, the information filled in that form when submitted, and the code to "validate" it are stored there.
-
controllers: Where controllers classes are stored
- generics: Parent version of controllers, containing code sharing between both "webs" and "apis" versions
- webs : Classes containing the controllers related to the website version of the application
- apis : Classes containing the controllers related to the API version of the application
- models: Classes dealing with database manipulation, storing/retrieving information from data sources.
-
views: All the html/json/xml output code is stored there
- apis: All the code to "display" the information in a way suitable for an api (JSON/XML)
-
webs: All the code to display the information into an html page
- layouts: the cppcms template code for the layout (i.e the html code present in every pages) is stored here
- generics: All the classes for generic purpose (e.g singleton class, class to represent the configuration file, etc.) are there
- results: stored the structures used to do models->controllers data retrieving