Skip to content

Commit

Permalink
Merge pull request #72 from ionescu77/develop
Browse files Browse the repository at this point in the history
Production release
  • Loading branch information
ionescu77 authored Jun 4, 2020
2 parents d73a1cd + b6b6c74 commit 778be9f
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 136 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: python

cache: pip

python:
# - "2.7.9"
- "3.6.7"
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ wheel==0.34.2

Django==1.11.28
django-appconf==1.0.4
django-axes==4.4.2
django-axes==5.3.2
django-crispy-forms==1.9.1
django-ipware==2.1.0

Expand Down
2 changes: 1 addition & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r base.txt
psycopg2-binary==2.8.4
psycopg2-binary==2.8.5
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r base.txt
psycopg2-binary==2.8.4
psycopg2-binary==2.8.5

django-jenkins==0.110.0
factory-boy==2.12.0
Expand Down
77 changes: 71 additions & 6 deletions src/ionescu77v2Project/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))


# Quick-start development settings - unsuitable for production
Expand All @@ -40,23 +40,41 @@
'django.contrib.staticfiles',
)

MIDDLEWARE_CLASSES = (
# MIDDLEWARE_CLASSES = (
# 'django.contrib.sessions.middleware.SessionMiddleware',
# 'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
# 'django.contrib.messages.middleware.MessageMiddleware',
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'django.middleware.security.SecurityMiddleware',
# )

MIDDLEWARE = [
# The following is the list of default middleware in new Django projects.
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

# AxesMiddleware should be the last middleware in the MIDDLEWARE list.
# It only formats user lockout messages and renders Axes lockout responses
# on failed user authentication attempts from login views.
# If you do not want Axes to override the authentication response
# you can skip installing the middleware and use your own views.
'axes.middleware.AxesMiddleware',
]

ROOT_URLCONF = 'ionescu77v2Project.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(BASE_DIR), 'templates')],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -98,8 +116,55 @@

USE_TZ = True

# This should go into all settings files:
#
INSTALLED_APPS += (
'landing',
'blogengine',
'accounts',
'django.contrib.sites',
'django.contrib.flatpages',
'django.contrib.syndication',
'django.contrib.sitemaps',
'crispy_forms',
'axes',
)


# This is for django axes, we'll se how it works local
#
# ///////
# ------- django-axes: CACHES enabled, 20181119
# ------- django-axes: CACHES enabled, 20200531
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
'axes_cache': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# ------- #

# ///////
# ------- django-axes: Settings for this:
AXES_CACHE = 'axes_cache'
AXES_VERBOSE = False
AXES_LOCKOUT_TEMPLATE = 'lockout.html'
AUTHENTICATION_BACKENDS = [
'axes.backends.AxesBackend',
'django.contrib.auth.backends.ModelBackend',
]

# ------- #


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'

# Added to handle static
#
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static")
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media")
29 changes: 29 additions & 0 deletions src/ionescu77v2Project/settings/local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os
from .base import *

SECRET_KEY=os.environ['SECRET_KEY_RAZ']

DEBUG = True
# TEMPLATE_DEBUG = True # Deprecated see below TEMPLATES:
DISQUS = False


ALLOWED_HOSTS = ['127.0.0.1']

SITE_ID = 2

#TEST_DATABASE_CHARSET=UTF8
#CHARSET=UTF8 # supported for PG and MySQL only


INSTALLED_APPS += ('django_jenkins',)
JENKINS_TASKS = ()

PROJECT_APPS = ['blogengine']

CRISPY_TEMPLATE_PACK = 'bootstrap3'

# ///////
# ------- django-axes: Settings for this:
AXES_VERBOSE = True
# ------- #
22 changes: 4 additions & 18 deletions src/ionescu77v2Project/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,16 @@
# TEMPLATE_DEBUG = True # Deprecated see below TEMPLATES:
DISQUS = True

ALLOWED_HOSTS = ['ionescu77.com']

INSTALLED_APPS += (
'landing',
'blogengine',
'accounts',
'django.contrib.sites',
'django.contrib.flatpages',
'django.contrib.syndication',
'django.contrib.sitemaps',
'crispy_forms',
'axes',
)
ALLOWED_HOSTS = ['ionescu77.com','www.ionescu77.com','staging.ionescu77.com']

SITE_ID = 1

#TEST_DATABASE_CHARSET=UTF8
#CHARSET=UTF8 # supported for PG and MySQL only

STATIC_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/static/'
MEDIA_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/media/'

CRISPY_TEMPLATE_PACK = 'bootstrap3'

# ///////
# ------- django-axes: Settings for this:
AXES_VERBOSE = False

AXES_LOCKOUT_TEMPLATE = 'lockout.html'
# ------- #
59 changes: 0 additions & 59 deletions src/ionescu77v2Project/settings/razvansky.py

This file was deleted.

22 changes: 4 additions & 18 deletions src/ionescu77v2Project/settings/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,14 @@

ALLOWED_HOSTS = ['ionescu77.staging.avproiect.com']

INSTALLED_APPS += (
'landing',
'blogengine',
'accounts',
'django.contrib.sites',
'django.contrib.flatpages',
'django.contrib.syndication',
'django.contrib.sitemaps',
'crispy_forms',
'axes',
)

SITE_ID = 1

#TEST_DATABASE_CHARSET=UTF8
#CHARSET=UTF8 # supported for PG and MySQL only

STATIC_ROOT = '/home/ionescu77/webapps/apollo7/ionescu77/static/'
MEDIA_ROOT = '/home/ionescu77/webapps/apollo7/ionescu77/media/'

CRISPY_TEMPLATE_PACK = 'bootstrap3'

AXES_VERBOSE = False

AXES_LOCKOUT_TEMPLATE = 'lockout.html'
# ///////
# ------- django-axes: Settings for this:
AXES_VERBOSE = True
# ------- #
33 changes: 1 addition & 32 deletions src/ionescu77v2Project/settings/travis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,11 @@

ALLOWED_HOSTS = ['127.0.0.1']

INSTALLED_APPS += (
'landing',
'blogengine',
'accounts',
'django.contrib.sites',
'django.contrib.flatpages',
'django.contrib.syndication',
'django.contrib.sitemaps',
'crispy_forms',
'axes',
)

SITE_ID = 1

#TEST_DATABASE_CHARSET=UTF8
#CHARSET=UTF8 # supported for PG and MySQL only

# ///////
# ------- django-axes: CACHES enabled, 20181119
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
'axes_cache': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# ------- #

INSTALLED_APPS += ('django_jenkins',)
JENKINS_TASKS = ()

Expand All @@ -47,12 +23,5 @@

# ///////
# ------- django-axes: Settings for this:
AXES_CACHE = 'axes_cache'
AXES_VERBOSE = True
AXES_LOCKOUT_TEMPLATE = 'lockout.html'
AUTHENTICATION_BACKENDS = [
'axes.backends.AxesModelBackend',
'django.contrib.auth.backends.ModelBackend',
]

AXES_VERBOSE = False
# ------- #

0 comments on commit 778be9f

Please sign in to comment.