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:
- Django web framework, License: three-clause BSD
- jQuery JS helper, License: MIT License
- jQuery-ui JS widgets, License: Mixed
- Bootstrap CSS backend, License: MIT License
- Bootswatch CSS theme, License: MIT License
- Flagpedia flag symbols, License: public domain
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
Languages
Python
50.3%
JavaScript
23.8%
HTML
16.2%
CSS
9.1%
Shell
0.6%