Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Backend
Commits
79511ed6
Commit
79511ed6
authored
Feb 25, 2021
by
Agnes Handoko
Browse files
migrate to server cs
parent
2503156d
Pipeline
#62749
passed with stages
in 6 minutes and 17 seconds
Changes
329
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
79511ed6
...
...
@@ -138,4 +138,4 @@ pip-selfcheck.json
.sonar/
.scannerwork/
# End of https://www.gitignore.io/api/django,virtualenv
\ No newline at end of file
# End of https://www.gitignore.io/api/django,virtualenv
project/settings.py
View file @
79511ed6
"""
Django settings for app project.
...
...
@@ -87,9 +88,9 @@ if USE_POSTGRE:
DATABASES
=
{
"default"
:
{
"ENGINE"
:
"django.db.backends.postgresql_psycopg2"
,
"NAME"
:
os
.
environ
.
get
(
"
DATABASE_NAME
"
),
"USER"
:
os
.
environ
.
get
(
"
DATABASE_USER
"
),
"PASSWORD"
:
os
.
environ
.
get
(
"
DATABASE_PASSWORD
"
),
"NAME"
:
os
.
environ
.
get
(
"
tbcare
"
),
"USER"
:
os
.
environ
.
get
(
"
tbcare
"
),
"PASSWORD"
:
os
.
environ
.
get
(
"
Mu2k8iraoNdtDE
"
),
"HOST"
:
os
.
environ
.
get
(
"DATABASE_HOST"
),
"PORT"
:
os
.
environ
.
get
(
"DATABASE_PORT"
),
}
...
...
@@ -139,6 +140,6 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
"static
files
"
)
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
"static
/
"
)
STATIC_URL
=
"/static/"
project/settings.py.save
0 → 100644
View file @
79511ed6
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Get all local env variables
from dotenv import load_dotenv
load_dotenv()
# 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/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "e6cve$0dh*pzse)e2w%!kim^&a17*fgle@b4y!yvk@eih+r_4("
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"apps.accounts",
"apps.cases",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
ROOT_URLCONF = "project.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]
WSGI_APPLICATION = "project.wsgi.application"
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
USE_POSTGRE = os.environ.get("DATABASE_IS_PSQL", False)
if USE_POSTGRE:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("tbcare"),
"USER": os.environ.get("tbcare"),
"PASSWORD": os.environ.get("DATABASE_PASSWORD"),
"HOST": os.environ.get("DATABA"),
"PORT": os.environ.get("DATABASE_PORT"),
}
}
else:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
]
# Pagination
REST_FRAMEWORK = {
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
"PAGE_SIZE": 10,
}
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = "en-us"
TIME_ZONE = "Asia/Jakarta"
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
STATIC_URL = "/static/"
static/admin/css/autocomplete.css
0 → 100644
View file @
79511ed6
select
.admin-autocomplete
{
width
:
20em
;
}
.select2-container--admin-autocomplete.select2-container
{
min-height
:
30px
;
}
.select2-container--admin-autocomplete
.select2-selection--single
,
.select2-container--admin-autocomplete
.select2-selection--multiple
{
min-height
:
30px
;
padding
:
0
;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection
,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection
{
border-color
:
#999
;
min-height
:
30px
;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection.select2-selection--single
,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection.select2-selection--single
{
padding
:
0
;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection.select2-selection--multiple
,
.select2-container--admin-autocomplete.select2-container--open
.select2-selection.select2-selection--multiple
{
padding
:
0
;
}
.select2-container--admin-autocomplete
.select2-selection--single
{
background-color
:
#fff
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__rendered
{
color
:
#444
;
line-height
:
30px
;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__clear
{
cursor
:
pointer
;
float
:
right
;
font-weight
:
bold
;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__placeholder
{
color
:
#999
;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__arrow
{
height
:
26px
;
position
:
absolute
;
top
:
1px
;
right
:
1px
;
width
:
20px
;
}
.select2-container--admin-autocomplete
.select2-selection--single
.select2-selection__arrow
b
{
border-color
:
#888
transparent
transparent
transparent
;
border-style
:
solid
;
border-width
:
5px
4px
0
4px
;
height
:
0
;
left
:
50%
;
margin-left
:
-4px
;
margin-top
:
-2px
;
position
:
absolute
;
top
:
50%
;
width
:
0
;
}
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--single
.select2-selection__clear
{
float
:
left
;
}
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--single
.select2-selection__arrow
{
left
:
1px
;
right
:
auto
;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--single
{
background-color
:
#eee
;
cursor
:
default
;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--single
.select2-selection__clear
{
display
:
none
;
}
.select2-container--admin-autocomplete.select2-container--open
.select2-selection--single
.select2-selection__arrow
b
{
border-color
:
transparent
transparent
#888
transparent
;
border-width
:
0
4px
5px
4px
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
{
background-color
:
white
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
cursor
:
text
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__rendered
{
box-sizing
:
border-box
;
list-style
:
none
;
margin
:
0
;
padding
:
0
5px
;
width
:
100%
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__rendered
li
{
list-style
:
none
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__placeholder
{
color
:
#999
;
margin-top
:
5px
;
float
:
left
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__clear
{
cursor
:
pointer
;
float
:
right
;
font-weight
:
bold
;
margin
:
5px
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice
{
background-color
:
#e4e4e4
;
border
:
1px
solid
#ccc
;
border-radius
:
4px
;
cursor
:
default
;
float
:
left
;
margin-right
:
5px
;
margin-top
:
5px
;
padding
:
0
5px
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice__remove
{
color
:
#999
;
cursor
:
pointer
;
display
:
inline-block
;
font-weight
:
bold
;
margin-right
:
2px
;
}
.select2-container--admin-autocomplete
.select2-selection--multiple
.select2-selection__choice__remove
:hover
{
color
:
#333
;
}
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--multiple
.select2-selection__choice
,
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--multiple
.select2-selection__placeholder
,
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--multiple
.select2-search--inline
{
float
:
right
;
}
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--multiple
.select2-selection__choice
{
margin-left
:
5px
;
margin-right
:
auto
;
}
.select2-container--admin-autocomplete
[
dir
=
"rtl"
]
.select2-selection--multiple
.select2-selection__choice__remove
{
margin-left
:
2px
;
margin-right
:
auto
;
}
.select2-container--admin-autocomplete.select2-container--focus
.select2-selection--multiple
{
border
:
solid
#999
1px
;
outline
:
0
;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection--multiple
{
background-color
:
#eee
;
cursor
:
default
;
}
.select2-container--admin-autocomplete.select2-container--disabled
.select2-selection__choice__remove
{
display
:
none
;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--above
.select2-selection--single
,
.select2-container--admin-autocomplete.select2-container--open.select2-container--above
.select2-selection--multiple
{
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--below
.select2-selection--single
,
.select2-container--admin-autocomplete.select2-container--open.select2-container--below
.select2-selection--multiple
{
border-bottom-left-radius
:
0
;
border-bottom-right-radius
:
0
;
}
.select2-container--admin-autocomplete
.select2-search--dropdown
.select2-search__field
{
border
:
1px
solid
#ccc
;
}
.select2-container--admin-autocomplete
.select2-search--inline
.select2-search__field
{
background
:
transparent
;
border
:
none
;
outline
:
0
;
box-shadow
:
none
;
-webkit-appearance
:
textfield
;
}
.select2-container--admin-autocomplete
.select2-results
>
.select2-results__options
{
max-height
:
200px
;
overflow-y
:
auto
;
}
.select2-container--admin-autocomplete
.select2-results__option
[
role
=
group
]
{
padding
:
0
;
}
.select2-container--admin-autocomplete
.select2-results__option
[
aria-disabled
=
true
]
{
color
:
#999
;
}
.select2-container--admin-autocomplete
.select2-results__option
[
aria-selected
=
true
]
{
background-color
:
#ddd
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
{
padding-left
:
1em
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__group
{
padding-left
:
0
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
{
margin-left
:
-1em
;
padding-left
:
2em
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
{
margin-left
:
-2em
;
padding-left
:
3em
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
{
margin-left
:
-3em
;
padding-left
:
4em
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
{
margin-left
:
-4em
;
padding-left
:
5em
;
}
.select2-container--admin-autocomplete
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
.select2-results__option
{
margin-left
:
-5em
;
padding-left
:
6em
;
}
.select2-container--admin-autocomplete
.select2-results__option--highlighted
[
aria-selected
]
{
background-color
:
#79aec8
;
color
:
white
;
}
.select2-container--admin-autocomplete
.select2-results__group
{
cursor
:
default
;
display
:
block
;
padding
:
6px
;
}
static/admin/css/base.css
0 → 100644
View file @
79511ed6
/*
DJANGO Admin styles
*/
@import
url(fonts.css)
;
body
{
margin
:
0
;
padding
:
0
;
font-size
:
14px
;
font-family
:
"Roboto"
,
"Lucida Grande"
,
"DejaVu Sans"
,
"Bitstream Vera Sans"
,
Verdana
,
Arial
,
sans-serif
;
color
:
#333
;
background
:
#fff
;
}
/* LINKS */
a
:link
,
a
:visited
{
color
:
#447e9b
;
text-decoration
:
none
;
}
a
:focus
,
a
:hover
{
color
:
#036
;
}
a
:focus
{
text-decoration
:
underline
;
}
a
img
{
border
:
none
;
}
a
.section
:link
,
a
.section
:visited
{
color
:
#fff
;
text-decoration
:
none
;
}
a
.section
:focus
,
a
.section
:hover
{
text-decoration
:
underline
;
}
/* GLOBAL DEFAULTS */
p
,
ol
,
ul
,
dl
{
margin
:
.2em
0
.8em
0
;
}
p
{
padding
:
0
;
line-height
:
140%
;
}
h1
,
h2
,
h3
,
h4
,
h5
{
font-weight
:
bold
;
}
h1
{
margin
:
0
0
20px
;
font-weight
:
300
;
font-size
:
20px
;
color
:
#666
;
}
h2
{
font-size
:
16px
;
margin
:
1em
0
.5em
0
;
}
h2
.subhead
{
font-weight
:
normal
;
margin-top
:
0
;
}
h3
{
font-size
:
14px
;
margin
:
.8em
0
.3em
0
;
color
:
#666
;
font-weight
:
bold
;
}
h4
{
font-size
:
12px
;
margin
:
1em
0
.8em
0
;
padding-bottom
:
3px
;
}
h5
{
font-size
:
10px
;
margin
:
1.5em
0
.5em
0
;
color
:
#666
;
text-transform
:
uppercase
;
letter-spacing
:
1px
;
}
ul
li
{
list-style-type
:
square
;
padding
:
1px
0
;
}
li
ul
{
margin-bottom
:
0
;
}
li
,
dt
,
dd
{
font-size
:
13px
;
line-height
:
20px
;
}
dt
{
font-weight
:
bold
;
margin-top
:
4px
;
}
dd
{
margin-left
:
0
;
}
form
{
margin
:
0
;
padding
:
0
;
}
fieldset
{
margin
:
0
;
padding
:
0
;
border
:
none
;
border-top
:
1px
solid
#eee
;
}
blockquote
{
font-size
:
11px
;
color
:
#777
;
margin-left
:
2px
;
padding-left
:
10px
;
border-left
:
5px
solid
#ddd
;
}
code
,
pre
{
font-family
:
"Bitstream Vera Sans Mono"
,
Monaco
,
"Courier New"
,
Courier
,
monospace
;
color
:
#666
;
font-size
:
12px
;
}
pre
.literal-block
{
margin
:
10px
;
background
:
#eee
;
padding
:
6px
8px
;
}
code
strong
{
color
:
#930
;
}
hr
{
clear
:
both
;
color
:
#eee
;
background-color
:
#eee
;
height
:
1px
;
border
:
none
;
margin
:
0
;
padding
:
0
;
font-size
:
1px
;
line-height
:
1px
;
}
/* TEXT STYLES & MODIFIERS */
.small
{
font-size
:
11px
;
}
.tiny
{
font-size
:
10px
;
}
p
.tiny
{
margin-top
:
-2px
;
}