{"id":22157871,"url":"https://github.com/mkbeh/site-nordic-walking-","last_synced_at":"2026-03-19T22:00:56.658Z","repository":{"id":41911181,"uuid":"231288913","full_name":"mkbeh/Site-Nordic-Walking-","owner":"mkbeh","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-08T06:23:54.000Z","size":482,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T19:48:48.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkbeh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-02T01:54:29.000Z","updated_at":"2021-08-03T12:02:58.000Z","dependencies_parsed_at":"2023-01-24T16:30:42.980Z","dependency_job_id":null,"html_url":"https://github.com/mkbeh/Site-Nordic-Walking-","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkbeh%2FSite-Nordic-Walking-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkbeh%2FSite-Nordic-Walking-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkbeh%2FSite-Nordic-Walking-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkbeh%2FSite-Nordic-Walking-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkbeh","download_url":"https://codeload.github.com/mkbeh/Site-Nordic-Walking-/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294764,"owners_count":20591899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T03:16:07.577Z","updated_at":"2026-01-05T10:41:54.341Z","avatar_url":"https://github.com/mkbeh.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Website \"Nordic walking\"\nThe following actions were performed on ubuntu 19.04 and python 3.6.\n\n\u003e HTML/CSS and part of JS made another person, not me.\n\n\n### **Getting started**\n* [Initial actions](#initial-actions)\n* [MYSQL](#mysql)\n    * [Installing MYSQL](#installing-mysql)\n    * [Creating DB](#creating-db-for-django-application)\n* [NGINX + UWSGI](#nginx--uwsgi)\n    * [Setting domen name](#setting-domen-name)\n    * [NGINX](#nginx)\n    * [Adding SSL](#adding-ssl)\n    * [UWSGI](#uwsgi)\n* [Security settings](#security-settings)\n    * [Fail2Ban](#fail2ban)\n    \n\n## Initial actions\n```bash\n# - Installing require packages -\napt-get update\nsudo apt-get install build-essential zlib1g-dev python3-dev virtualenv libssl-dev libffi-dev python3-dev python3-venv \\\n    libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev \\\n    mysql-server libmysqlclient-dev nginx unzip\n\nadduser django\nusermod -aG sudo django\nsu django\ncd\n\n# - Installing python -\nwget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz\ntar -xvf Python-3.6.8.tar.xz \u0026\u0026 rm Python-3.6.8.tar.xz\ncd Python-3.6.8/\n./configure \u0026\u0026 make \u0026\u0026 sudo make altinstall\ncd ..\n\n# --- Setting up Django app ---\n# - For test -\ngit clone --single-branch --branch devel https://github.com/mkbeh/website_nordic_walking\n\n# - For production -\ngit clone https://github.com/mkbeh/website_nordic_walking\n\ncd website_nordic_walking/\npython3.6 -m venv venv\nsource venv/bin/activate\npython3.6 -m pip install -r requirements.txt\n\n# - Setting the lifetime of the sss session -\n# - Uncomment next lines in /etc/ssh/sshd_config -\nTCPKeepAlive yes\nClientAliveInterval 300\nClientAliveCountMax 300\n\n# - Restart ssh service -\nsudo systemctl restart ssh\n```\n\n## MYSQL\n\n### Installing MYSQL\n```bash\nsudo mysql_secure_installation      # Press Y anywhere\n```\n\n### Creating DB for Django application\n```bash\n# - Go to shell mysql client -\nsudo mysql -u root -p\n\n# - Change \u003csomeapp\u003e to your Django app name -\nCREATE DATABASE \u003csomeapp\u003e DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;\n\n# - Change \u003cpassword\u003e on yours -\nCREATE USER 'django'@'localhost' IDENTIFIED BY '\u003cpassword\u003e';\n\n# - Change \u003cdb_name\u003e , \u003cuser\u003e and  \u003cpwd\u003e on yours -\ngrant all on \u003cdb_name\u003e.* to \u003cuser\u003e@localhost identified by '\u003cpwd\u003e' with grant option;\n\nFLUSH PRIVILEGES;\n\n# - Fill in mysql client config -\nvi website_nordic_walking/server_configs/mysql_django.cnf\n\n# - Content of mysql_django.conf (change data on yours) -\n[client]\ndatabase = \u003cdb_name\u003e\nuser = \u003cuser_name\u003e\npassword = \u003cpassword\u003e\nhost = 127.0.0.1\nport = 3306\ndefault-character-set = utf8\n\n# - Generating django secret key -\npython3.6 website_nordic_walking/key_gen.py\n\n# - Setting Django ALLOWED_HOSTS\nvi /path/to/project/settings/production.py\n\n# - Setting env variables to ~/.bashrc -\n# - Example -\nexport PYTHONPATH=/abs/path/to/project/dir\nexport DJANGO_SETTINGS_MODULE=\u003csite\u003e.settings.production\nexport SECRET_KEY='\u003csecret_key\u003e'\nexport MYSQL_CONF='/abs/path/to/server_configs/mysql_django.cnf'\n\n. ~/.bashrc\nsource venv/bin/activate\n\n# - Migrations -\npython3.6 manage.py makemigrations blog events_calendar gallery static_pages\npython3.6 manage.py migrate\n\n# - Deploying static files - \npython3.6 manage.py collectstatic --link\n\n# - Installing require plugins for `ckeditor`\ncd /path/to/static/ckeditor/ckeditor/plugins\nwget https://download.ckeditor.com/youtube/releases/youtube_2.1.13.zip\nunzip youtube_2.1.13.zip\nrm youtube_*\n\n# - Creating superuser -\npython3.6 manage.py createsuperuser\n\n# # # --- Extra note ---\n\n# - dump data from old DB -\npython3.6 manage.py dumpdata --exclude auth.permission --exclude contenttypes \u003e db.json\n\n# - load data into new db by dump from old db -\npython3.6 manage.py db.json\n```\n\n## NGINX + UWSGI\n\n### Setting domen name\n```\nNOTE: add CNAME (with www) and A (with @) \nrecords into your hosting panel.\n```\n\n### NGINX\n```bash\ndeactivate\nsudo systemctl enable nginx\nsudo vi /etc/sysctl.conf\n\n# - Add next line in the end of the file -\nfs.file-max = 40000\n\nsudo sysctl -p\nsudo cp website_nordic_walking/server_configs/nginx.conf /etc/nginx/\n\n# - Fill in the nginx.conf -\n# - return 301 $sheme://\u003cdomain.com\u003e; Change domain on yours in this line -\nsudo vi /etc/nginx/nginx.conf\n\n# - Fill in the config file custom_nginx.conf - \nvi website_nordic_walking/server_configs/custom_nginx.conf\n\nsudo cp /path/to/mysite/custom_nginx.conf /etc/nginx/sites-enabled/\nsudo nginx -t\n```\n\n### Adding SSL\n```bash\nsudo apt-get update\nsudo apt-get install software-properties-common\nsudo add-apt-repository universe\nsudo add-apt-repository ppa:certbot/certbot\nsudo apt-get update\nsudo apt-get install certbot python-certbot-nginx \n\nsudo certbot --nginx -d \u003cdomain.com\u003e certonly\nsudo rm /etc/letsencrypt/options-ssl-nginx.conf\n\ncrontab -e\n# - Add next line for auto updating cert -\n@daily certbot renew\n\n# - Uncomment ssl supporting in custom_nginx.conf\n```\n\n#### **NOTE**\n```\nIf something was wrong -\u003e reboot your system and try again , in 99 percent of the happenings it helps :D\n\n---\u003e Next fill in the custom_nginx.conf\n```\n\n### UWSGI\n```bash\nsudo python3.6 -m pip install uwsgi\n\n# - Fill in the config file custom_uwsgi.ini -\nvi /path/to/custom_uwsgi.ini\n\n# - Copy configs to /etc/...\nsudo mkdir -p /etc/uwsgi/vassals\nsudo cp /path/to/server_configs/emperor.ini /etc/uwsgi/\nsudo ln -s /abs/path/to/server_configs/custom_uwsgi.ini /etc/uwsgi/vassals\n\nsudo systemctl restart nginx.service\n\n# - Running the Django application with uwsgi and nginx -\n# - Need for debug , another use systemd -\nuwsgi --emperor /etc/uwsgi/emperor.ini\n\n# - UWSGI production -\nsudo cp /path/to/server_configs/emperor.uwsgi.service /etc/systemd/system/\n\nsudo systemctl daemon-reload\nsudo systemctl start emperor.uwsgi.service\nsudo systemctl enable emperor.uwsgi.service\n```\n\n\n## Security settings\n\n### Fail2Ban\n```bash\nsudo apt-get install fail2ban\nsudo vi /etc/fail2ban/jail.local\n\n# - Config example -\n[ssh]\nfindtime    = 3600\nmaxretry    = 6\nbantime     = 86400\n\nsudo service fail2ban restart\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkbeh%2Fsite-nordic-walking-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkbeh%2Fsite-nordic-walking-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkbeh%2Fsite-nordic-walking-/lists"}