Skip to content

Commit 274d3ee

Browse files
committed
Initial commit
0 parents  commit 274d3ee

File tree

10 files changed

+217
-0
lines changed

10 files changed

+217
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/env
2+
/var
3+
.env
4+
*.log
5+
*.pot
6+
*.pyc
7+
__pycache__/
8+
local_settings.py

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2+
Version 2, December 2004
3+
4+
Copyright (C) 2004 Sam Hocevar <[email protected]>
5+
6+
Everyone is permitted to copy and distribute verbatim or modified
7+
copies of this license document, and changing it is allowed as long
8+
as the name is changed.
9+
10+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12+
13+
0. You just DO WHAT THE FUCK YOU WANT TO.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
beer-analytics 🍺
2+
=================
3+
4+
Web application written in Django to analyze beers recipes and visualize results .
5+
6+
License
7+
-------
8+
9+
This software is available under the [WTFPL License](LICENSE).

beer_analytics/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SECRET_KEY="verysecretkey"
2+
DEBUG=True

beer_analytics/asgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for beer_analytics project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'beer_analytics.settings')
15+
16+
application = get_asgi_application()

beer_analytics/settings.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
"""
2+
Django settings for beer_analytics project.
3+
4+
Generated by 'django-admin startproject' using Django 3.1.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/3.1/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
15+
import environ
16+
17+
env = environ.Env(
18+
# set casting, default value
19+
DEBUG=(bool, False)
20+
)
21+
22+
# reading .env file
23+
environ.Env.read_env()
24+
25+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
26+
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
27+
28+
29+
# Quick-start development settings - unsuitable for production
30+
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
31+
32+
# SECURITY WARNING: keep the secret key used in production secret!
33+
SECRET_KEY = env('SECRET_KEY')
34+
35+
# SECURITY WARNING: don't run with debug turned on in production!
36+
DEBUG = env('DEBUG')
37+
38+
ALLOWED_HOSTS = []
39+
40+
41+
# Application definition
42+
43+
44+
INSTALLED_APPS = [
45+
'django.contrib.contenttypes',
46+
'django.contrib.staticfiles',
47+
]
48+
49+
MIDDLEWARE = [
50+
'django.middleware.security.SecurityMiddleware',
51+
'django.middleware.common.CommonMiddleware',
52+
'django.middleware.csrf.CsrfViewMiddleware',
53+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
54+
]
55+
56+
ROOT_URLCONF = 'beer_analytics.urls'
57+
58+
TEMPLATES = [
59+
{
60+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
61+
'DIRS': [],
62+
'APP_DIRS': True,
63+
'OPTIONS': {
64+
'context_processors': [
65+
'django.template.context_processors.debug',
66+
'django.template.context_processors.request',
67+
'django.contrib.auth.context_processors.auth',
68+
'django.contrib.messages.context_processors.messages',
69+
],
70+
},
71+
},
72+
]
73+
74+
WSGI_APPLICATION = 'beer_analytics.wsgi.application'
75+
76+
77+
# Database
78+
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
79+
80+
DATABASES = {
81+
'default': {
82+
'ENGINE': 'django.db.backends.sqlite3',
83+
'NAME': BASE_DIR / 'var/data.sqlite3',
84+
}
85+
}
86+
87+
88+
# Internationalization
89+
# https://docs.djangoproject.com/en/3.1/topics/i18n/
90+
91+
LANGUAGE_CODE = 'en-us'
92+
TIME_ZONE = 'UTC'
93+
USE_I18N = True
94+
USE_L10N = True
95+
USE_TZ = True
96+
97+
98+
# Static files (CSS, JavaScript, Images)
99+
# https://docs.djangoproject.com/en/3.1/howto/static-files/
100+
101+
STATIC_URL = '/static/'

beer_analytics/urls.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""beer_analytics URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/3.1/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
17+
urlpatterns = [
18+
]

beer_analytics/wsgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for beer_analytics project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'beer_analytics.settings')
15+
16+
application = get_wsgi_application()

manage.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'beer_analytics.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

0 commit comments

Comments
 (0)