A Yeoman generator for AngularJS + Flask
Want to see pretty graphs? Log in now!
npm install generator-angular-flask
|2||downloads in the last day|
|16||downloads in the last week|
|95||downloads in the last month|
|Last Published By|
|Version||0.1.8 last updated 2 months ago|
|Keywords||yeoman-generator, Python, Flask, SQLAlchemy, AngularJS, Bootstrap|
|Dependencies (6)||yeoman-generator, URIjs, lodash, underscore.string, pluralize, asciify|
The Angular-Flask generator
Flask is a Python-based micro-framework. For AngularJS integration with other micro-frameworks, see https://github.com/rayokota/MicroFrameworkRosettaStone.
npm install -g yo
Install the Angular-Flask generator:
npm install -g generator-angular-flask
Creating a Flask service
In a new directory, generate the service:
Install a virtual environment in new
flask directory using
install.bat for Windows):
Run the service:
Your service will run at http://localhost:5000.
Creating a persistent entity
Generate the entity:
yo angular-flask:entity [myentity]
You will be asked to specify attributes for the entity, where each attribute has the following:
- a name
- a type (String, Integer, Float, Boolean, Date, Enum)
- for a String attribute, an optional minimum and maximum length
- for a numeric attribute, an optional minimum and maximum value
- for a Date attribute, an optional constraint to either past values or future values
- for an Enum attribute, a list of enumerated values
- whether the attribute is required
Files that are regenerated will appear as conflicts. Allow the generator to overwrite these files as long as no custom changes have been made.
Create the database as described in this blog.
Run the service:
A client-side AngularJS application will now be available by running
At this point you should be able to navigate to a page to manage your persistent entities.