The Genropy Sandbox¶
In the resources in the documentation, reference will often be made to the Sandbox instance, created specifically for educational purposes. We therefore suggest downloading it and trying to launch it by following the instructions below.
It is also possible to use an online instance of the sandbox application at https://sandbox.genropy.org by authenticating with your credentials
username: sandbox
password: sandbox
git clone¶
So move to your custom projects directory (defined in your environment.xml ), and download the sandbox project:
cd ~/.../genropy_projects/
git clone https://bitbucket.org/genropy/sandbox.git
Or:
git clone https://github.com/genropy/sandbox
Run Sandbox locally¶
First of all it is necessary to issue the dbsetup
command followed by the name of the sandbox instance to generate the database with all the necessary tables. In the basic configuration a sqlite database is created.
gnr app dbsetup sandbox
Remember that before starting the Sandbox application, and any other Genropy webserver, you must first launch the daemon
instruction from a terminal:
gnr web daemon
And then from another terminal window you execute the wsgiserve sandbox
instruction as explained in the installation testing’ page
gnr web wsgiserve sandbox
If everything is successful from the terminal we will have confirmation that our application is served locally on port 8080:
serving on 0.0.0.0:8080 view at http://127.0.0.1:8080
Remote edit¶
Genropy offers a way to edit code from pages directly from the browser. If you want to experiment and use this mode, you need to start the application with the remote_edit
option:
gnr web wsgiserve sandbox --remote_edit
The output of the previous command indicates the address to enter in the browser to access the project site pages. Generally it is http://127.0.0.1:8080/ (in the case of the sandbox the access user is admin and the [tr -off]password the one you decided during the genropy installation).
If you want to impose a different port, you can use the following command (for example, if you want to impose port 8085, instead of 8080):
gnr web wsgiserve -p 8085 sandbox
To restore any modified file:
git checkout <Name of modified file>
To get the name of the file to restore:
git status
Modified files are indicated with modified at the top, for example:
modified: packages/tutor/webpages/lessons/2_la_pagina/02_hello_world.py
git checkout packages/tutor/webpages/lessons/2_la_pagina/02_hello_world.py