From 41741ab37f90d07b3418e87ffa7e700ae5b1a581 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 16 May 2020 20:06:41 +0200 Subject: [PATCH] Kumify project --- .gitignore | 6 +++--- README.md | 15 +++++---------- cal/__pycache__/__init__.cpython-36.pyc | Bin 136 -> 0 bytes cal/__pycache__/urls.cpython-36.pyc | Bin 290 -> 0 bytes cal/__pycache__/views.cpython-36.pyc | Bin 343 -> 0 bytes cal/migrations/0001_initial.py | 24 ------------------------ cal/migrations/__init__.py | 0 djangocalendar/custom_settings.dist.py | 22 ++++++++++++++++++++++ djangocalendar/settings.py | 24 ++++++++---------------- 9 files changed, 38 insertions(+), 53 deletions(-) delete mode 100644 cal/__pycache__/__init__.cpython-36.pyc delete mode 100644 cal/__pycache__/urls.cpython-36.pyc delete mode 100644 cal/__pycache__/views.cpython-36.pyc delete mode 100644 cal/migrations/0001_initial.py delete mode 100644 cal/migrations/__init__.py create mode 100644 djangocalendar/custom_settings.dist.py diff --git a/.gitignore b/.gitignore index 8c90457..7f9a765 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -db.sqlite3 -.vscode/ -env/ static/ *.pyc +__pycache__/ +migrations/ +djangocalendar/custom_settings.py \ No newline at end of file diff --git a/README.md b/README.md index fc786ce..5b8922d 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@ -# django-calendar -Full calendar built using Django. Tutorial part i [here](https://www.huiwenteo.com/normal/2018/07/24/django-calendar.html) and part ii [here](https://www.huiwenteo.com/normal/2018/07/29/django-calendar-ii.html)! :) +# django-essensplan +Full calendar built using Django. Tutorial part i [here](https://www.huiwenteo.com/normal/2018/07/24/django-calendar.html) and part ii [here](https://www.huiwenteo.com/normal/2018/07/29/django-calendar-ii.html) - customized for weekly menu scheduling! :) # Usage -Clone this repo, setup virtualenv, install Django +Clone this repo, setup venv, install Django, move djangocalendar/custom_settings.dist.py to djangocalendar/custom_settings.py and set correct values + ``` -git clone https://github.com/huiwenhw/django-calendar -cd django-calendar - -virtualenv env -source env/bin/activate -pip3 install django - +python3 manage.py makemigrations python3 manage.py migrate python3 manage.py runserver ``` diff --git a/cal/__pycache__/__init__.cpython-36.pyc b/cal/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index eae8984b4db8e3dc7d4d04f891993561fe206f97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmXr!<>k7y$1<7$2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CU#9w@#i>Qb`W~g3 z<*9l41x5K;smUe9`YBn7dFlDdi8-lxDTzh;K!$#Nd}dx|NqoFsLFFwDo80`A(wtN~ Kka5L8%m4sU#~}Rx diff --git a/cal/__pycache__/urls.cpython-36.pyc b/cal/__pycache__/urls.cpython-36.pyc deleted file mode 100644 index 41d67b4e2a74c2ff507517ba6a1b46169b8be1d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290 zcmX|5yH3O~5cDe#xI2m8ND~XFkPxDzqCqsFI9b`{lqhj5JK> zqDYLo6?yu_lOmU6iqIKAX4%U7{syRb9YG~SpCi0M{+g5K44&m*Buhl=Le*fc%O%F# zV2K&R!vN&p1uCw5pXxgTB)uA%9dx=!w}r}+Hruk>xT>^#yF|@IKQ^$VW&b>?hW$Lv z!ntr)NDO?PtK#T)ZArC5Uk#ox42*|=<(lnJMy7?yz#gPwbbiq~Gg!C`zoLX8lbQMf D1Nu#I diff --git a/cal/migrations/0001_initial.py b/cal/migrations/0001_initial.py deleted file mode 100644 index 5e655a0..0000000 --- a/cal/migrations/0001_initial.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.0.6 on 2018-07-04 18:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Event', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=200)), - ('description', models.TextField()), - ('start_time', models.DateTimeField()), - ('end_time', models.DateTimeField()), - ], - ), - ] diff --git a/cal/migrations/__init__.py b/cal/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/djangocalendar/custom_settings.dist.py b/djangocalendar/custom_settings.dist.py new file mode 100644 index 0000000..a7084b3 --- /dev/null +++ b/djangocalendar/custom_settings.dist.py @@ -0,0 +1,22 @@ +# Secret Key: Replace this by a long random string. +# You can use django.core.management.utils.get_random_secret_key to generate one. + +SECRET_KEY = "replaceme!" + +# Database settings +# This application is tested only with MariaDB/MySQL. +# You will have to edit settings.py if you want to use Postgres, SQLite, etc. + +DB_HOST = "localhost" +DB_PORT = 3306 +DB_USER = "essensplan" +DB_PASS = "secret" +DB_NAME = "essensplan" + +# Whether debug messages should be output - set to False in production (exposes sensitive data) + +DEBUG = True + +# Which hostnames may be used to access the system - by default accepts "localhost", add "*" to allow any hostname + +ALLOWED_HOSTS = [] diff --git a/djangocalendar/settings.py b/djangocalendar/settings.py index 14e8aac..eac6f97 100644 --- a/djangocalendar/settings.py +++ b/djangocalendar/settings.py @@ -12,22 +12,11 @@ https://docs.djangoproject.com/en/2.0/ref/settings/ import os +from djangocalendar.custom_settings import * + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '4y2^moidr-z*rj794*e4_*(i_yu77mr*%9l*b3+p$htz454efh' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - # Application definition INSTALLED_APPS = [ @@ -76,12 +65,15 @@ WSGI_APPLICATION = 'djangocalendar.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.mysql', + 'NAME': DB_NAME, + 'USER': DB_USER, + 'PASSWORD': DB_PASS, + 'HOST': DB_HOST, + 'PORT': str(DB_PORT), } } - # Password validation # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators