User:Pedro Sá Couto/Prototyping 5th/Flask App/Raspberry Pi into a Flask App Server: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "=Installing Flask in a Raspberry Pi= <pre style="color: silver; background: black;"> cd /var/www/ </pre>")
 
No edit summary
Line 1: Line 1:
=Installing Flask in a Raspberry Pi=
=Installing Flask in a Raspberry Pi=


Install virtual environment
<pre style="color: silver; background: black;">
sudo apt install python3-venv
</pre>
Go to www folder
<pre style="color: silver; background: black;">
<pre style="color: silver; background: black;">
cd /var/www/
cd /var/www/
</pre>
Create a flask app server here
<pre style="color: silver; background: black;">
sudo mkdir TacticalApp
</pre>
Go into the folder
<pre style="color: silver; background: black;">
cd TacticalApp
</pre>
Create a virtual environment in this folder
<pre style="color: silver; background: black;">
sudo python3 -m venv venv
</pre>
Check who owns the venv
<pre style="color: silver; background: black;">
stat venv/
</pre>
Change the owner to your user (mine is mrb)
<pre style="color: silver; background: black;">
sudo chown -R mrb:mrb venv
</pre>
Activate de virtual environment
<pre style="color: silver; background: black;">
. venv/bin/activate
</pre>
Deactivate de virtual environment
<pre style="color: silver; background: black;">
deactivate
</pre>
Install Flask
<pre style="color: silver; background: black;">
pip3 install flask
</pre>
</pre>

Revision as of 01:37, 24 March 2020

Installing Flask in a Raspberry Pi

Install virtual environment

sudo apt install python3-venv

Go to www folder

cd /var/www/

Create a flask app server here

sudo mkdir TacticalApp

Go into the folder

cd TacticalApp

Create a virtual environment in this folder

sudo python3 -m venv venv

Check who owns the venv

stat venv/

Change the owner to your user (mine is mrb)

sudo chown -R mrb:mrb venv

Activate de virtual environment

. venv/bin/activate

Deactivate de virtual environment

deactivate

Install Flask

pip3 install flask