Check the lastest version at kicoma-tri.herokuapp.com.
All source code in the KiCoMa is available under the GNU GPL v3 License. See LICENSE.md for details.
./reset-db.sh
./reset-db-heroku.sh
./manage.py check --deploy --settings=config.settings.production
Using https://django-extensions.readthedocs.io/en/latest/graph_models.html
python3 manage.py graph_models -a -g -o datamodel.png
orpython3 manage.py graph_models kitchen -g -o datamodel.png
and copy the file to statics/images
./manage.py makemessages -l en -l cs
./manage.py compilemessages
heroku login
git push kicoma-tri master
git push heroku master
heroku git:remote -a kicoma-tri
heroku apps:info -a kicoma-tri
heroku apps:stacks -a kicoma-tri
heroku buildpacks -a kicoma-tri
./manage.py shell
from django.contrib.auth.hashers import make_password
make_password('password')
- Python
- Django
- Postgresql
To get started with the app, clone the repo and then install Python 3:
$ cd ~/tmp
$ git clone https://github.com/valasek/kicoma
$ cd kicoma
Install docker and docker compose and run
docker-compose up
DEPRECATED - local dev server
Create python virtual environment, tested is python 3.10.2
https://towardsdatascience.com/python-environment-101-1d68bda3094d
python3 -m venv <virtual env path>
Switch to the virtual environment:
source ./env/bin/activate
Install dependenciec
pip install -r requirements/local.txt
Install PostgreSql, I use Postgres.app and PgAdmin as a client
Create DB with a name kicoma
migrate the database:
$ ./manage.py makemigrations
$ ./manage.py migrate
Finally, run the test suite to verify that everything is working correctly:
$ ./manage.py test
If the test suite passes, you'll be ready to run the app in a local server:
$ ./manage.py runserver
Getting up and running locally: https://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html
./reset-db.sh
Moved to settings_.
.. _settings: http://cookiecutter-django.readthedocs.io/en/latest/settings.html
Setting Up Your Users ^^^^^^^^^^^^^^^^^^^^^
-
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
-
To create an superuser account, use this command::
$ python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Type checks ^^^^^^^^^^^
Running type checks with mypy:
::
$ mypy kicoma
Test coverage ^^^^^^^^^^^^^
To run the tests, check your test coverage, and generate an HTML coverage report::
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
Running tests
./manage.py test kitchen
::
$ pytest
Live reloading and Sass CSS compilation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Moved to `Live reloading and SASS compilation`_.
.. _`Live reloading and SASS compilation`: http://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html
Deployment
----------
The following details how to deploy this application.
Heroku
^^^^^^
## Initial set-up
https://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html
Managing Multiple Environments for an App - https://devcenter.heroku.com/articles/multiple-environments
Do not forget to add the following argument at the end of every command:
` --app <app-name>`
``--app kicoma-tri`
## Set email domain
`heroku config:set MAILGUN_DOMAIN=hospic-cercany.cz`
## Initialize DB
`./reset-db-heroku.sh`