Kumify project

This commit is contained in:
Kumi 2020-05-16 20:06:41 +02:00
parent db0306a4f0
commit 41741ab37f
9 changed files with 38 additions and 53 deletions

6
.gitignore vendored
View file

@ -1,5 +1,5 @@
db.sqlite3
.vscode/
env/
static/
*.pyc
__pycache__/
migrations/
djangocalendar/custom_settings.py

View file

@ -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
```

Binary file not shown.

Binary file not shown.

View file

@ -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()),
],
),
]

View file

@ -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 = []

View file

@ -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