Skip to content

Commit

Permalink
pep8 first step
Browse files Browse the repository at this point in the history
  • Loading branch information
ihptru committed Mar 24, 2016
1 parent 4971394 commit 054a9cf
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 84 deletions.
6 changes: 3 additions & 3 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openra.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openra.settings")

from django.core.management import execute_from_command_line
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
execute_from_command_line(sys.argv)
154 changes: 75 additions & 79 deletions openra/settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,72 +30,72 @@ ALLOWED_HOSTS = ['*']
SITE_ID = 1
ACCOUNT_EMAIL_REQUIRED = True

SESSION_COOKIE_AGE = 7776000 # 90 days for active user session
SESSION_COOKIE_AGE = 7776000 # 90 days for active user session

AUTHENTICATION_BACKENDS = (
# Needed to login by username in Django admin, regardless of `allauth`
"django.contrib.auth.backends.ModelBackend",
# `allauth` specific authentication methods, such as login by e-mail
"allauth.account.auth_backends.AuthenticationBackend",
# Needed to login by username in Django admin, regardless of `allauth`
"django.contrib.auth.backends.ModelBackend",
# `allauth` specific authentication methods, such as login by e-mail
"allauth.account.auth_backends.AuthenticationBackend",
)
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'openra',
'registration',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.google',
'corsheaders',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'openra',
'registration',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.google',
'corsheaders',
]

MIDDLEWARE_CLASSES = [
'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',
'corsheaders.middleware.CorsMiddleware',
'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',
'corsheaders.middleware.CorsMiddleware',
]

CORS_ORIGIN_ALLOW_ALL = True

CORS_ALLOW_METHODS = (
'GET',
'POST',
'GET',
'POST',
)

ROOT_URLCONF = 'openra.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',

'django.contrib.auth.context_processors.auth',
],
},
},
{
'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',

'django.contrib.auth.context_processors.auth',
],
},
},
]

WSGI_APPLICATION = 'openra.wsgi.application'
Expand All @@ -105,32 +105,32 @@ WSGI_APPLICATION = 'openra.wsgi.application'
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
}
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
{
'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',
},
]


Expand All @@ -157,20 +157,20 @@ STATIC_URL = '/static/'
ACCOUNT_ACTIVATION_DAYS = 7


###########################
##### CUSTOM SETTINGS #####
###########################
###################
# CUSTOM SETTINGS #
###################


# Path to directory where OpenRA versions are stored
OPENRA_ROOT_PATH = ''

# OpenRA Versions matching their directory names
OPENRA_VERSIONS = {
3: 'release-20151224',
2: 'release-20150919',
1: 'release-20150614',
0: 'bleed', # just a name, see OPENRA_BLEED_PARSER setting
3: 'release-20151224',
2: 'release-20150919',
1: 'release-20150614',
0: 'bleed', # just a name, see OPENRA_BLEED_PARSER setting
}

# Path to file which stores HASH of the latest `bleed` version
Expand All @@ -186,7 +186,6 @@ OPENRA_BLEED_PARSER = ''
RSYNC_MAP_PATH = ''



# Email address (FROM) in our custom mail methods
ADMIN_EMAIL_FROM = ''

Expand All @@ -197,16 +196,13 @@ ADMIN_EMAIL_TO = ''
DEFAULT_FROM_EMAIL = ''



# Determining amount of reports for item, required to forbid in-game downloading, synchronization with servers, etc.
REPORTS_PENALTY_AMOUNT = 3



# Is site under maintenance
SITE_MAINTENANCE = False
SITE_MAINTENANCE_OVER = '00:00 GMT' # when we finish technical works

SITE_MAINTENANCE = False
SITE_MAINTENANCE_OVER = '00:00 GMT' # when we finish technical works


# Time limit for some execution processes
Expand Down
7 changes: 5 additions & 2 deletions openra/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
"""

import os
import logging, sys
import logging
import sys
from django.core.wsgi import get_wsgi_application


logging.basicConfig(stream=sys.stderr)

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


sys.path.append(BASE_DIR)
os.chdir(BASE_DIR)

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openra.settings")

Expand Down

0 comments on commit 054a9cf

Please sign in to comment.