2023-02-18 22:34:49 +01:00
2023-02-18 22:34:49 +01:00
2020-06-25 12:50:11 +02:00
2021-07-05 14:57:22 +00:00
bak
2021-07-12 09:13:57 +00:00
2020-06-19 14:00:03 +02:00
2020-05-13 15:53:27 +02:00
2022-10-07 13:11:05 +02:00
2022-10-07 13:11:25 +02:00
2022-07-08 13:12:28 +02:00

Roadmap

  • Prototype
  • Milestone 1.0 Happy Birthday
  • Milestone 2.0 Nice to have
  • Add statistics #5
  • Add search function #8
  • Add undo/redo function #12
  • Add coin recognition AI
  • Fix century datetime bug before the end of 2098

Licenses

Coinc uses (besides python, javascript, HTML, CSS and more) the following open source software/data:

Deploying

Add the following settings to your django app:

./coinmanager/coinmanager/settings.py

ALLOWED_HOSTS = ['<hostname>']
DEBUG = False
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

Then collect all static files in /static: python manage.py collectstatic

Apache2

  • Install mod_wsgi: sudo apt install -y libapache2-mod-wsgi-py3
  • Enable it a2enmod wsgi
  • Own the project folder with your webserver group sudo chown -R :www-data /path/to/coinmanager
  • Add this outside of your apache2 VirtualHost config:
/etc/apache2/apache2.conf

# create wsgi daemon process named *coinc*
WSGIDaemonProcess coinc python-home=/path/to/venv python-path=/path/to/coinmanager/coinmanager
# create wsgi process group *coinc*
WSGIProcessGroup coinc
# coinmanager app
WSGIScriptAlias /coinc /path/to/coinmanager/coinmanager/wsgi.py
  • And a site specifig config:
/etc/apache2/sites-enabled/coinmanager.conf

# create alias
WSGIScriptAlias /coinc /path/to/coinmanager/coinmanager/wsgi.py
# route /static to the project folder TODO: this is not optimal
Alias /static /path/to/coinmanager/static
# apache does (not yet) serve the correct Content-Type header for .mjs files
<Files "*.mjs">
    ForceType text/javascript
</Files>
# downgrade Referrer-Policy header to make xhr-requests work
<Directory /path/to/coinmanager>
    Header always set Referrer-Policy "no-referrer-when-downgrade"
</Directory>
# grant access to static files
<Directory /path/to/coinmanager/static>
    Require all granted
</Directory>
# grant access to wsgi connector
<Directory /path/to/coinmanager/coinmanager>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>
  • Test if your config syntax ist OK apachectl configtest
  • Finally restart apache2 systemctl restart apache2

clear django cache

When things arent changing this may help you:

python manage.py shell
>>> from django.core.cache import cache; cache.clear(); exit()

run tests

python manage.py test

activate pyenv on the server

source pyenv/bin/activate

logging

import logging
logger = logging.getLogger(__name__)
logger.error('foo')
Description
No description provided
Readme 11 MiB
Languages
Python 50.3%
JavaScript 23.8%
HTML 16.2%
CSS 9.1%
Shell 0.6%