├── wsgi.py
+ Execução do projeto em modo wsgi. +
+ + +templates
index.html
{% extends "layout.html" %}
- {% block maincontent %}
- <div class='entry'>
- {% for entry, text in data %}
- <a href="{{ url_for('show_entry', entry_name=entry) }}">{{ entry }}</a>
- {{ text|safe }}
- {% endfor %}
- </div>
- {% endblock %}
-
-
- templates
entry.html
{% extends "layout.html" %}
- {% block maincontent %}
- <div class="entry">
- <div class="title">{{ entry }}</div>
- {{ output|safe }}
- </div>
- {% endblock %}
-
-
- templates
page_not_found.html
{% extends "layout.html" %}
- {% block maincontent %}
- <h2>Page not found</h2>
- {% endblock %}
-
-
- templates
entry_not_found.html
{% extends "layout.html" %}
- {% block maincontent %}
- <h2>Entry not found</h2>
- {% endblock %}
-
-
- setup.py
from setuptools import setup
+
+
templates
index.html
{% extends "layout.html" %}
+ {% block maincontent %}
+ <div class='entry'>
+ {% for entry, text in data %}
+ <a href="{{ url_for('show_entry', entry_name=entry) }}">{{ entry }}</a>
+ {{ text|safe }}
+ {% endfor %}
+ </div>
+ {% endblock %}
+
+
+ templates
entry.html
{% extends "layout.html" %}
+ {% block maincontent %}
+ <div class="entry">
+ <div class="title">{{ entry }}</div>
+ {{ output|safe }}
+ </div>
+ {% endblock %}
+
+
+ templates
page_not_found.html
{% extends "layout.html" %}
+ {% block maincontent %}
+ <h2>Page not found</h2>
+ {% endblock %}
+
+
+ templates
entry_not_found.html
{% extends "layout.html" %}
+ {% block maincontent %}
+ <h2>Entry not found</h2>
+ {% endblock %}
+
+
+ setup.py
from setuptools import setup
with open('requirements.txt') as origin:
requirements = origin.readlines()
-setup(name='Ata',
+setup(name='ata',
version='0.1',
long_description='A Flask app',
packages=['ata'],
zip_safe=False,
include_package_data=True,
install_requires=requirements)
- wsgi.py
from ata.main import app as application
+
+
+ MANIFEST.in
recursive-include ata/templates *
-recursive-include ata/static *
+recursive-include ata/static *
+include requirements.txt
+
+
+
FLASK_APP=ata/main.py flask run
-
+
-
-export FLASK_RUN=ata/main
+
+export FLASK_APP=ata/main
flask run
-
-
sudo dnf install nginx uwsgi
+ sudo dnf install nginx uwsgi uwsgi-plugin-python3
- sudo yum install nginx uwsgi
+ sudo yum install nginx uwsgi uwsgi-plugin-python3
- sudo apt-get install nginx uwsgi
- mkdir -p /usr/local/venv
+mkdir -p /usr/local/apps
+python -m venv /usr/local/venv/ata
+
+
+ tar xzf Ata-0.1.tar.gz --one-top-level=/usr/local/apps/
+ln -sf /usr/local/apps/Ata-0.1 /usr/local/apps/ata
+source /usr/local/venv/ata/bin/activate
+python3 -m pip install -U -r /usrlocal/apps/ata/requirements.txt
+
+
+ /etc/uwsgi.d/ata.ini
[uwsgi]
+chdir=/usr/local/apps/ata
+module=wsgi
+plugins=python3
+virtualenv=/usr/local/venv/ata
+uid=uwsgi
+gid=uwsgi
+processes=4
+socket=/var/run/uwsgi/ata.sock
+