| | 1 | = Developer Guidelines - Basics = |
| | 2 | |
| | 3 | == Running Sahana Eden == |
| | 4 | {{{ |
| | 5 | cd .. # the web2py main directory |
| | 6 | python web2py.py |
| | 7 | }}} |
| | 8 | Or if you don't want to have to enter a password (or have issues launching the Web2Py GUI). |
| | 9 | {{{ |
| | 10 | python web2py.py -a 1234 |
| | 11 | }}} |
| | 12 | |
| | 13 | == Wiping the Database == |
| | 14 | Out of the box Sahana Eden is set to use the SQLite database. If you want to wipe all the data, simply delete the {{{databases/}}} directory, along with the {{{sessions/}}} directory (this contains details about your login - which will be invalid as you'll be deleting the user account). The next time you run Sahana Eden, it will recreate the database tables. |
| | 15 | |
| | 16 | == Pre-Populating Data == |
| | 17 | Sahana Eden is able to "[DeveloperGuidelines/PrePopulate Pre-Populate]" data so you can explore/test/develop the application with different types of data. Pre-Populate options are associated with the [DeveloperGuidelines/Templates Templates], but they can be set in {{{models/000_config.py}}}. |
| | 18 | |
| | 19 | {{{IFRC_Train}}} is a good set of pre-populate to use (See: https://github.com/flavour/eden/tree/master/private/templates/IFRC_Train). It also has an admin user account: admin@example.com password: testing. To use it edit {{{models/000_config.py}}}: |
| | 20 | |
| | 21 | After: |
| | 22 | {{{ |
| | 23 | # ============================================================================= |
| | 24 | # Over-rides to the Template may be done here |
| | 25 | }}} |
| | 26 | Add (or un-comment): |
| | 27 | {{{ |
| | 28 | settings.base.prepopulate = ["IFRC_Train"] |
| | 29 | }}} |
| | 30 | |
| | 31 | Pre-populate data will only be created if the database is empty, so you may need to wipe the database first. It may take a few minutes to load the data. |
| | 32 | |
| | 33 | == Debug Mode == |
| | 34 | In {{{models/000_config.py}}} uncomment this line: |
| | 35 | {{{ |
| | 36 | settings.base.debug = True |
| | 37 | }}} |
| | 38 | to: |
| | 39 | * Use the non-minified CSS & JS |
| | 40 | * See changes in {{{modules/eden}} files without restarting Web2Py |
| | 41 | |
| | 42 | == Running a Sahana Eden Python Shell == |
| | 43 | To open a Python Shell in the Sahana Eden Environment, where you can inspect Sahana Eden variable as well as access the data: |
| | 44 | {{{ |
| | 45 | cd .. # the web2py main directory |
| | 46 | python web2py.py -S eden -M |
| | 47 | }}} |
| | 48 | To create data you will need to use the {{{db.commit()}}} command. |