-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
373 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
*/public/ | ||
*.sqlite3 | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[[source]] | ||
|
||
url = "https://pypi.python.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
|
||
[dev-packages] | ||
|
||
ipdb = "*" | ||
|
||
|
||
[packages] | ||
|
||
django = "*" | ||
python-decouple = "*" | ||
|
||
|
||
[requires] | ||
|
||
python_version = "3.6" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
from decouple import config, Csv | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
# APPLICATION SETTINGS | ||
DEBUG = config('DEBUG', cast=bool, default=True) | ||
SECRET_KEY = config('SECRET_KEY', default='secret_key') | ||
|
||
SITE_ID = 1 | ||
ALLOWED_HOSTS = config('ALLOWED_HOSTS', | ||
cast=Csv(lambda x: x.strip().strip(',').strip()), | ||
default='*') | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.' + config('DATABASE_ENGINE', | ||
default='sqlite3'), | ||
'NAME': config('DATABASE_NAME', | ||
default=os.path.join(BASE_DIR, 'db.sqlite3')), | ||
'USER': config('DATABASE_USER', default=''), | ||
'PASSWORD': config('DATABASE_PASSWORD', default=''), | ||
'HOST': config('DATABASE_HOST', default=''), | ||
'PORT': config('DATABASE_PORT', default=''), | ||
} | ||
} | ||
|
||
ROOT_URLCONF = 'babel.urls' | ||
WSGI_APPLICATION = 'babel.wsgi.application' | ||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
] | ||
|
||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.locale.LocaleMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
|
||
] | ||
|
||
# PASSWORD VALIDATION | ||
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', | ||
}, | ||
] | ||
|
||
# AUTHENTICATION | ||
AUTHENTICATION_BACKENDS = ( | ||
'django.contrib.auth.backends.ModelBackend', | ||
) | ||
|
||
# INTERNATIONALIZATION | ||
LANGUAGE_CODE = config('LANGUAGE_CODE', default='pt-br') | ||
TIME_ZONE = config('TIME_ZONE', default='America/Sao_Paulo') | ||
USE_I18N = True | ||
USE_L10N = True | ||
USE_TZ = True | ||
|
||
LOCALE_PATHS = [ | ||
os.path.join(BASE_DIR, 'locale'), | ||
] | ||
|
||
LANGUAGES = ( | ||
('en', 'English'), | ||
('pt-br', 'Brazilian Portuguese'), | ||
) | ||
|
||
# STATICFILES SETTINGS | ||
STATIC_URL = config('STATIC_URL', default='/static/') | ||
STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'public', 'static')) | ||
|
||
STATICFILES_DIRS = [ | ||
os.path.join(BASE_DIR, 'static'), | ||
] | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [ | ||
os.path.join(BASE_DIR, 'templates'), | ||
], | ||
'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', | ||
], | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.urls import path | ||
from django.contrib import admin | ||
|
||
urlpatterns = [ | ||
path('admin/', admin.site.urls), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
WSGI config for babel project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "babel.settings") | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
application = get_wsgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "babel.settings") | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) |