|
|
@ -24,7 +24,6 @@ fi |
|
|
|
|
|
|
|
PROJECT_FOLDER=$PROJECT_ROOT/$PROJECT_NAME |
|
|
|
|
|
|
|
echo ""; |
|
|
|
echo ""; |
|
|
|
echo "[FlaskCreate] Creating directory $PROJECT_FOLDER..."; |
|
|
|
mkdir $PROJECT_FOLDER; |
|
|
@ -142,34 +141,34 @@ echo " <!doctype html> |
|
|
|
<html> |
|
|
|
<head> |
|
|
|
<title>{% block title %}{% endblock %} - $PROJECT_NAME</title> |
|
|
|
<meta charset="utf-8"> |
|
|
|
<meta name="viewport" contents="width=device-width, initial-scale=1"> |
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.2.0/css/uikit.min.css" integrity="sha256-5YtK9j+Nl/245lAkSjrIs600d6edKTevi+3JYdjuHhY=" crossorigin="anonymous" /> |
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.2.0/js/uikit.min.js" integrity="sha256-rhLALrRmAQVu/OxzVDpQaiHAEMxiRSN8h8RDydUEh2g=" crossorigin="anonymous"></script> |
|
|
|
<meta charset=\"utf-8\"> |
|
|
|
<meta name=\"viewport\" contents=\"width=device-width, initial-scale=1\"> |
|
|
|
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.2.0/css/uikit.min.css\" integrity=\"sha256-5YtK9j+Nl/245lAkSjrIs600d6edKTevi+3JYdjuHhY=\" crossorigin=\"anonymous\" /> |
|
|
|
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.2.0/js/uikit.min.js\" integrity=\"sha256-rhLALrRmAQVu/OxzVDpQaiHAEMxiRSN8h8RDydUEh2g=\" crossorigin=\"anonymous\"></script> |
|
|
|
{% block head %} {% endblock %} |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<nav class="uk-navbar-container" uk-navbar> |
|
|
|
<div class="uk-navbar-left"> |
|
|
|
<a href="" class="uk-navbar-item uk-logo">$PROJECT_NAME</a> |
|
|
|
<nav class=\"uk-navbar-container\" uk-navbar> |
|
|
|
<div class=\"uk-navbar-left\"> |
|
|
|
<a href=\"\" class=\"uk-navbar-item uk-logo\">$PROJECT_NAME</a> |
|
|
|
</div> |
|
|
|
<div class="uk-navbar-center"> |
|
|
|
<ul class="uk-navbar-nav"> |
|
|
|
<li class="uk-active"><a href="">Nav Item 1</a></li> |
|
|
|
<li><a href="">Nav Item 2</a></li> |
|
|
|
<li><a href="">Nav Item 3</a></li> |
|
|
|
<li><a href="">Nav Item 4</a></li> |
|
|
|
<div class=\"uk-navbar-center\"> |
|
|
|
<ul class=\"uk-navbar-nav\"> |
|
|
|
<li class=\"uk-active\"><a href=\"\">Nav Item 1</a></li> |
|
|
|
<li><a href=\"\">Nav Item 2</a></li> |
|
|
|
<li><a href=\"\">Nav Item 3</a></li> |
|
|
|
<li><a href=\"\">Nav Item 4</a></li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</nav> |
|
|
|
<div class="uk-container"> |
|
|
|
<div class=\"uk-container\"> |
|
|
|
{% block content %}{% endblock %} |
|
|
|
</div> |
|
|
|
</body> |
|
|
|
</html> |
|
|
|
" > $TEMPLATE_DIR/base.html; |
|
|
|
|
|
|
|
echo "{% extends "base.html" %} |
|
|
|
echo "{% extends \"base.html\" %} |
|
|
|
{% block title %}$PROJECT_NAME Home{% endblock %} |
|
|
|
{% block content %} |
|
|
|
<div> |
|
|
@ -185,7 +184,7 @@ echo "{% extends "base.html" %} |
|
|
|
echo "[FlaskCreate] Creating default_settings config file..."; |
|
|
|
touch $PROJECT_FOLDER/$PROJECT_NAME/default_settings.py; |
|
|
|
echo "# Default Configuration |
|
|
|
SECRET_KEY = "" |
|
|
|
SECRET_KEY = 'asecretkeyshouldchange' |
|
|
|
|
|
|
|
# Flask-SQLAlchemy |
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False |
|
|
@ -193,7 +192,7 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False |
|
|
|
|
|
|
|
echo "[FlaskCreate] Creating environment config files..."; |
|
|
|
mkdir $PROJECT_FOLDER/config; |
|
|
|
touch $PROJECT_FOLDER/config/prod.cfg; touch $PROJECT_FOLDER/config/dev.py |
|
|
|
touch $PROJECT_FOLDER/config/prod.cfg; touch $PROJECT_FOLDER/config/dev.cfg |
|
|
|
|
|
|
|
PROD_KEY=$(echo $(od -vN 20 -An -tx1 /dev/urandom | tr -d " \n")) |
|
|
|
DEV_KEY=$(echo $(od -vN 20 -An -tx1 /dev/urandom | tr -d " \n")) |
|
|
@ -225,10 +224,10 @@ bin/activate: requirements.txt |
|
|
|
\t touch bin/activate |
|
|
|
|
|
|
|
run: bin/activate |
|
|
|
\t . bin/activate; FLASK_SETTINGS_FILE=config/prod.cfg FLASK_ENV=production FLASK_APP=start.py flask run --host=0.0.0.0 |
|
|
|
\t . bin/activate; FLASK_SETTINGS_FILE=../config/prod.cfg FLASK_ENV=production FLASK_APP=start.py flask run --host=0.0.0.0 |
|
|
|
|
|
|
|
debug: bin/activate |
|
|
|
\t . bin/activate; FLASK_SETTINGS_FILE=config/dev.cfg FLASK_ENV=development FLASK_APP=start.py flask run --host=0.0.0.0 |
|
|
|
\t . bin/activate; FLASK_SETTINGS_FILE=../config/dev.cfg FLASK_ENV=development FLASK_APP=start.py flask run --host=0.0.0.0 |
|
|
|
|
|
|
|
clean: |
|
|
|
\t rm -rf bin/ include/ lib/ lib64/ __pycache__/ share/; rm pyvenv.cfg |
|
|
|