Kumify project
This commit is contained in:
parent
db0306a4f0
commit
41741ab37f
9 changed files with 38 additions and 53 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
||||||
db.sqlite3
|
|
||||||
.vscode/
|
|
||||||
env/
|
|
||||||
static/
|
static/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
__pycache__/
|
||||||
|
migrations/
|
||||||
|
djangocalendar/custom_settings.py
|
15
README.md
15
README.md
|
@ -1,16 +1,11 @@
|
||||||
# django-calendar
|
# 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)! :)
|
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
|
# 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
|
python3 manage.py makemigrations
|
||||||
cd django-calendar
|
|
||||||
|
|
||||||
virtualenv env
|
|
||||||
source env/bin/activate
|
|
||||||
pip3 install django
|
|
||||||
|
|
||||||
python3 manage.py migrate
|
python3 manage.py migrate
|
||||||
python3 manage.py runserver
|
python3 manage.py runserver
|
||||||
```
|
```
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]
|
|
22
djangocalendar/custom_settings.dist.py
Normal file
22
djangocalendar/custom_settings.dist.py
Normal 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 = []
|
|
@ -12,22 +12,11 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from djangocalendar.custom_settings import *
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
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
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
@ -76,12 +65,15 @@ WSGI_APPLICATION = 'djangocalendar.wsgi.application'
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
'NAME': DB_NAME,
|
||||||
|
'USER': DB_USER,
|
||||||
|
'PASSWORD': DB_PASS,
|
||||||
|
'HOST': DB_HOST,
|
||||||
|
'PORT': str(DB_PORT),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue