This CLI is called THERMOS.
Lets start by describing What a CLI is to allow users to understand the intrigue behind this application.
A command-line interface or command language interpreter (CLI), also known as command-line user interface, console user interface and character user interface (CUI), is a means of interacting with a computer program where the user (or client) issues commands to the program in the form of successive lines of text (command lines). A program which handles the interface is called a command language interpreter or shell.
So this basically means that you will only be dealing with the terminal for a CLI as u will notice
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions.
Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries and is mostly used to build small application with simpler requirements.
Due to the extensive installations and requirements to start this cli makes it easy to:
-
Create the app.
-
Create blueprints.
-
Create template.
By starting the app it simply:
-
Creates a folder for you.
-
Initializes Empty Git Repository
-
Installs flask
-
Installs werkzeug
-
Installs click
-
Installs Jinja
-
Installs flask script
-
Installs flask-bootstrap
-
Installs gunicorn
-
Installs flask-wtf
-
Installs flask-sqalchemy
CREATED FILES
The script also helps in creating files needed in flask and this making it easy for you to code as you no longer hav to create them on your own.
It simply creates files and adds the preset standard code thats will not change in any given file structure.
You are now ready to code.
Credits
-
Collins Kariuki.
-
Mwangi Njuguna.
-
Faith Thuita.
-
Christine Karimi.
- You need to have nano text editor installed. you can find out whether you have it installed by typing nano --version in your terminal. For most linux distributions, it is installed by default.
Installing Nano Text Editor.
-However, if you don't have it installed, you can quicky do that by typing:
sudo apt-get install nano
- You need to have (python3.6) installed in your machine.
-To check if you already have python3.6 before installing type:
python3.6 -V
Installing Python3.6
To install python3.6 you can quicky do that by typing:
sudo apt-get install python3.6
To work With this cli {follow the below instructions for set up.}
-
You will need Internet connection.
-
You will also need a Webpage URL to load in URL's:
-
To get to this CLI fist you need to get to the Flask-CLI repository.
Link:-> https://github.com/zecollokaris/Flask-CLI
-
From there you can access the CLI.
-
Clone the project.
-
Once you done with cloning and project is on your device.
-
get into project folder (cd into project).
-
Install virtual environment
python3.6 -m venv virtual
-
Activate Virtual environment.
source virtual/bin/activate
-
Install the CLI
pip install -e .
-
Once you are done with installing you are good to go.
-
You can get help on using the cli thermos by typing:
thermos --help
-
You can get to knw the version by typing:
thermos --version
Both the CLI and generated project have dependencies that require python3.6.
Once your done with installing the CLI you can use the following commands to start working with Flask.
-
First ensure your virtual is activated
-
Generate A Flask Project.
thermos create app PROJECT NAME
-
Generate Template.
thermos create template TEMPLATENAME
-Get into the app you just created then from there you create your blueprints and templates
-Virtual must still be activated
-
Generate Blueprint
thermos create blueprint BLUEPRINTNAME
-
Once you are done you can move your app to another location. This is to enable you to push your work to github in your own repository as the ClI has already been initialized using git.
As an example I created a simple instance for you to see.
You can compare with your app.
Checkout ( zecollo ) within the files. It is a simple example of the flask file structure created using the CLI.
-
zecollo -This is an app example created using the CLI.
-
zecollo-template.html -This is a template example created using the CLI you will find it inside the templates folder.
-
zecollo-blueprint -This is a blueprint example created using the CLI similar to the others.
Once your done you can delete the app zecollo. - It only serves as an example
Note.
Do not delete any other files apart from zecollo. They are all needed to the CLI to work.
To improve this README.md and the CLI please give feedback or contribute so as to help others use the it much easier. Feed back will be really appreciated especially on errors you encounter.
Still under constant improvement.
-Mobile number: (+254) 798731203
-Email Address: collo.kariss@gmail.com
-github-username: zecollokaris
The app is licensed by MIT.
MIT (c) 2018
Feel FREE to contribute to make the CLI better for easier use by others.