You will find below a basic documentation on how to achieve some common tasks in gae-init.
Before you even begin you have to make sure that you have all the requirements installed to their latest versions.
Once this is done, clone the project and run it locally:
$ git clone https://github.com/gae-init/gae-init.git foo $ cd foo $ npm install $ gulp
gulp command to start the local server and all the watchers. If everything went OK, visit http://localhost:3000.
All the custom styles are located under
main/static/src/style/ directory and you can update them if needed. Most of the time though it is much better to create more files for better structure of the project. Here is how:
@import "foo";at the end.
From now on, you can simply start adding new rules in the
foo.less file and your web app will automatically refresh to reflect the changes.
gulp command to start the local server and all the watchers. If everything went OK, visit http://localhost:8080.
All the custom scripts are located under
main/static/src/script/ directory and you can update them if needed. Most of the time though it is much better to create more files for better structure of the project.
Create new files (
main/static/src/script/ and your web app should automatically refresh to load the updated files.
The easiest way to add a frontend library is:
bower.json, or try from console
bower install --save dependency-name
bower.json, if necessary.
config.coffee. Note that if your front-end library has dependencies on other libraries being loaded, you will need to add them in here, too.
gulpcommand if it's not already running (or restart it if it is).
By following these steps you will not need to add the third party libraries into your repository and everything will be minified before deployment.
If you are not able to include it as a bower dependency, simply create a new folder under the
main/static/ directory and include them as described in the steps 3—5 above.
Since gae-init is running on Google App Engine, the Python library have to be compatible with App Engine.
The easiest way to add a new library is:
gulp, if it's not already running.
Check out the example on how to include Markdown.
You might need to delete
main/lib.zip file before deploying the new library into GAE.
A bunch of configuration variables are already being stored in our datastore and they are available globally across the app. If you want to get the
brand_name in Python you can access it with
config.CONFIG_DB.brand_name and from HTML files via Jinja2
If you want to add something new, start by adding a property in our
Config model that is located in
foo = ndb.IntegerProperty(default=0)
..afterwards find the
ConfigUpdateForm in the
main/control/admin.py and something like:
foo = wtforms.IntegerField(model.Config.foo._verbose_name)
..finally add the following to template
By visiting the localhost:3000/admin/config/ you will be able to edit the new property.
To deploy your application execute the following command from the root directory:
$ gulp deploy
If you wish to deploy it to a different application or a version then execute:
$ gulp deploy --project=foo --version=bar