Server side of an application of an Aircraft Technical Log
Project description
Atlantic
This program is the sever side of the Atlantic app. It gives you a restful api.
Installation on debian 10 (or ubuntu 20.04) for production
The recommended way to install it is to use a virtual environment.
-
Install package
apt install -y pipx apache2 libapache2-mod-wsgi-py3 mariadb-server python3-dev libmariadb-dev libmariadbclient-dev build-essential
-
Create and configure database
mysql -u root -p CREATE DATABASE atlantic CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'aristide'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON atlantic . * TO 'aristide'@'localhost'; FLUSH PRIVILEGES; quit;
-
Create a user and log it
adduser aristide su - aristide
-
Install atlantic_server
pipx install atlantic_server
-
In the user home directory, create a conf.py file
nano ~/conf.py
and paste following parameters (with adjust):
SECRET_KEY = "enter here a lot of randoms letters and numbers here" DEBUG = True DATABASES = { "default": { "ENGINE": "django.db.backends.mysql", "NAME": "aristide", "USER": "atlantic", "PASSWORD": "password", } } MEDIA_ROOT = "/home/aristide/www/media/"
-
Configure Django app
atlantic_server makemigrations com atl smd atlantic_server migrate atlantic_server collectstatic atlantic_server createsuperuser
-
Configure Apache2
- Return to root user
exit
- Create a new file
nano /etc/apache2/site-available/atlantic.conf
- Paste following parameters (with adjust):
<VirtualHost *:80> ServerName url.for.your.site ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined DocumentRoot /home/aristide/www/vue/ <Directory /home/aristide/.local/pipx/venvs/atlantic-server/lib/python3.7/site-packages/atlantic_server> <Files wsgi.py> Require all granted </Files> </Directory> WSGIPassAuthorization On WSGIDaemonProcess aristide python-home=/home/aristide/.local/pipx/venvs/atlantic-server python-path=/home/aristide WSGIProcessGroup aristide WSGIScriptAlias /admin /home/aristide/.local/pipx/venvs/atlantic-server/lib/python3.7/site-packages/atlantic_server/wsgi.py/admin WSGIScriptAlias /api /home/aristide/.local/pipx/venvs/atlantic-server/lib/python3.7/site-packages/atlantic_server/wsgi.py/api <Directory /home/aristide/www/> Require all granted </Directory> Alias /media/ /home/aristide/www/media/ Alias /static/ /home/aristide/www/static/ </VirtualHost>
The DocumentRoot directory is the place where you upload the atlantic_client side.
- Save and close file
- Return to root user
-
Enabled site for apache
a2dissite * a2ensite atlantic systemctl reload apache2
-
It is recommended to secure the access of your site with a certificate...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
atlantic_server-0.3.5.tar.gz
(15.7 kB
view hashes)
Built Distribution
Close
Hashes for atlantic_server-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10975543c04ad25e3e87126760ab805719013033064ae4973a40979e5e4236b |
|
MD5 | 904f609dcead610f823eaaf0791366cf |
|
BLAKE2b-256 | 42f3e2bcb05b2298645e74a4429a2ba092c2a924b03fdb050c36a13cf215bf31 |