quart-imp/docs/v1/cli_commands-quart-imp_init.html
2024-08-16 15:36:56 +01:00

398 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Initialising A Quart-Imp Project | Quart-Imp</title>
<link rel="stylesheet" href="static/water.css">
<link rel="stylesheet" href="static/pygments.emacs-dull.css">
<link rel="apple-touch-icon" sizes="180x180" href="static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/favicon-16x16.png">
<link rel="manifest" href="static/site.webmanifest">
<link rel="mask-icon" href="static/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<aside>
<img src="static/quart-Imp-Medium.png" alt="Quart-Imp Logo" style="margin-top: 20px; width: 50%">
<h1>Quart-Imp</h1>
<div><small>Version: 1.0.x</small></div>
<div><small>Last Updated:</small></div>
<div><small>Fri, 16 Aug 2024</small></div>
<h2>Menu</h2>
<ul>
<li><a href="index.html"><strong>Index</strong></a></li>
</ul>
<ul>
<li><strong>CLI Commands</strong></li>
<ul>
<li><a href="cli_commands-quart-imp_init.html">quart-imp init</a></li>
<li><a href="cli_commands-quart-imp_blueprint.html">quart-imp blueprint</a></li>
</ul>
<li><strong>Imp</strong></li>
<ul>
<li><a href="imp-introduction.html">Introduction</a></li>
<li><a href="imp-init_app-init.html">init_app, __init__</a></li>
<li><a href="imp-init_session.html">init_session</a></li>
<li><a href="imp-import_app_resources.html">import_app_resources</a></li>
<li><a href="imp-import_blueprint.html">import_blueprint</a></li>
<li><a href="imp-import_blueprints.html">import_blueprints</a></li>
</ul>
<li><strong>ImpBlueprint</strong></li>
<ul>
<li><a href="impblueprint-introduction.html">Introduction</a></li>
<li><a href="impblueprint-init.html">__init__</a></li>
<li><a href="impblueprint-import_resources.html">import_resources</a></li>
<li><a href="impblueprint-import_nested_blueprint.html">import_nested_blueprint</a></li>
<li><a href="impblueprint-import_nested_blueprints.html">import_nested_blueprints</a></li>
<li><a href="impblueprint-tmpl.html">tmpl</a></li>
</ul>
<li><strong>quart_imp.config</strong></li>
<ul>
<li><a href="quart_imp_config-quartconfig.html">QuartConfig</a></li>
<li><a href="quart_imp_config-impconfig.html">ImpConfig</a></li>
<li><a href="quart_imp_config-impblueprintconfig.html">ImpBlueprintConfig</a></li>
</ul>
<li><strong>quart_imp.security</strong></li>
<ul>
<li><a href="quart_imp_security-login_check.html">login_check</a></li>
<li><a href="quart_imp_security-permission_check.html">permission_check</a></li>
<li><a href="quart_imp_security-pass_function_check.html">pass_function_check</a></li>
<li><a href="quart_imp_security-api_login_check.html">api_login_check</a></li>
<li><a href="quart_imp_security-include_csrf.html">include_csrf</a></li>
</ul>
<li><strong>quart_imp.auth</strong></li>
<ul>
<li><a href="quart_imp_auth-encrypt_password.html">encrypt_password</a></li>
<li><a href="quart_imp_auth-authenticate_password.html">authenticate_password</a></li>
<li><a href="quart_imp_auth-generate_password.html">generate_password</a></li>
<li><a href="quart_imp_auth-generate_salt.html">generate_salt</a></li>
<li><a href="quart_imp_auth-generate_csrf_token.html">generate_csrf_token</a></li>
<li><a href="quart_imp_auth-generate_private_key.html">generate_private_key</a></li>
<li><a href="quart_imp_auth-generate_email_validator.html">generate_email_validator</a></li>
<li><a href="quart_imp_auth-generate_numeric_validator.html">generate_numeric_validator</a></li>
<li><a href="quart_imp_auth-generate_alphanumeric_validator.html">generate_alphanumeric_validator</a></li>
<li><a href="quart_imp_auth-is_email_address_valid.html">is_email_address_valid</a></li>
<li><a href="quart_imp_auth-is_username_valid.html">is_username_valid</a></li>
</ul>
</ul>
<div style="padding-top: 5px; margin-bottom: 20px;"><small>Hosted on GitHub Pages.</small></div>
</aside>
<section>
<h1 style="font-size: 2.6rem; margin: 0;">Initialising a Quart-Imp Project</h1>
<p>Quart-Imp has a cli command that deploys a new ready-to-go project.
This project is structured in a way to give you the best idea of
how to use Quart-Imp.</p>
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>--help
</pre></div>
<h2>Create a new project</h2>
<p>Make sure you are in the virtual environment, and at the root of your
project folder, then run the following command:</p>
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init
</pre></div>
<p>After running this command, you will be prompted to choose what type of
app you want to deploy:</p>
<div class="highlight"><pre><span></span>~ $ quart-imp init
What type of app would you like to create? (minimal, slim, full) [minimal]:
</pre></div>
<p>See below for the differences between the app types.</p>
<p>After this, you will be prompted to enter a name for your app:</p>
<div class="highlight"><pre><span></span>~ $ quart-imp init
...
What would you like to call your app? [app]:
</pre></div>
<p>'app' is the default name, so if you just press enter, your app will be
called 'app'. You will then see this output:</p>
<div class="highlight"><pre><span></span>~ FILES CREATED WILL LOOP OUT HERE ~
===================
Quart app deployed!
===================
Your app has the default name of &#39;app&#39;
Quart will automatically look for this!
Run: quart run --debug
</pre></div>
<p>If you called your app something other than 'app', like 'new' for example, you will see:</p>
<div class="highlight"><pre><span></span>~ FILES CREATED WILL LOOP OUT HERE ~
===================
Quart app deployed!
===================
Your app has the name of &#39;new&#39;
Run: quart --app new run --debug
</pre></div>
<p>As you can see from the output, it gives you instructions on how to start your app,
depending on the name you gave it.</p>
<p>You should see a new folder that has been given the name you specified in
the <code>quart-imp init</code> command.</p>
<h3>Additional options</h3>
<p>You can also specify a name for your app in the command itself, like so:</p>
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app
</pre></div>
<p>This will create a new app called 'my_app'.
The default will be a minimal app, this has no blueprints.</p>
<p>You can also deploy a slim app, that will have one blueprint, like so:</p>
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app<span class="w"> </span>--slim
</pre></div>
<p>You can also deploy a full app that is setup for multiple blueprints, like so:</p>
<div class="highlight"><pre><span></span>quart-imp<span class="w"> </span>init<span class="w"> </span>-n<span class="w"> </span>my_app<span class="w"> </span>--full
</pre></div>
<h2>init Folder structures</h2>
<h3>Minimal app (default)</h3>
<p><code>quart-imp init --minimal</code>:</p>
<div class="highlight"><pre><span></span>app/
├── resources
│ ├── static
│ │ ├── css
│ │ │ └── water.css
│ │ ├── img
│ │ │ └── quart-imp-logo.png
│ │ └── favicon.ico
│ ├── templates
│ │ └── index.html
│ └── routes.py
└── __init__.py
</pre></div>
<h3>Slim app</h3>
<p><code>quart-imp init --slim</code>:</p>
<div class="highlight"><pre><span></span>app/
├── extensions
│ └── __init__.py
├── resources
│ ├── cli
│ │ └── cli.py
│ ├── error_handlers
│ │ └── error_handlers.py
│ ├── static
│ │ ├── css
│ │ │ └── water.css
│ │ ├── img
│ │ │ └── quart-imp-logo.png
│ │ └── favicon.ico
│ └── templates
│ └── error.html
├── www
│ ├── __init__.py
│ ├── routes
│ │ └── index.py
│ ├── static
│ │ ├── css
│ │ │ └── water.css
│ │ ├── img
│ │ │ └── quart-imp-logo.png
│ │ └── js
│ │ └── main.js
│ └── templates
│ └── www
│ ├── extends
│ │ └── main.html
│ ├── includes
│ │ ├── footer.html
│ │ └── header.html
│ └── index.html
└── __init__.py
</pre></div>
<h3>Full app</h3>
<p><code>quart-imp init --full</code>:</p>
<div class="highlight"><pre><span></span>app/
├── blueprints
│ └── www
│ ├── __init__.py
│ ├── routes
│ │ └── index.py
│ ├── static
│ │ ├── css
│ │ │ └── water.css
│ │ ├── img
│ │ │ └── quart-imp-logo.png
│ │ └── js
│ │ └── main.js
│ └── templates
│ └── www
│ ├── extends
│ │ └── main.html
│ ├── includes
│ │ ├── footer.html
│ │ └── header.html
│ └── index.html
├── extensions
│ └── __init__.py
├── resources
│ ├── cli
│ │ └── cli.py
│ ├── context_processors
│ │ └── context_processors.py
│ ├── error_handlers
│ │ └── error_handlers.py
│ ├── filters
│ │ └── filters.py
│ ├── routes
│ │ └── routes.py
│ ├── static
│ │ └── favicon.ico
│ └── templates
│ └── error.html
└── __init__.py
</pre></div>
</section>
</body>
</html>