Commit 75d45516 by Őry Máté

django: use settings api

parent 88998966
......@@ -239,7 +239,7 @@ CACHES = {
}
store_settings = {
STORE_SETTINGS = {
"basic_auth": "True",
"verify_ssl": "False",
"ssl_auth": "False",
......@@ -251,7 +251,7 @@ store_settings = {
"store_public": "store.ik.bme.hu",
}
firewall_settings = {
FIREWALL_SETTINGS = {
"default_vlangroup": "publikus",
"reload_sleep": "10",
"dns_hostname": "dns1.ik.bme.hu",
......
from django.contrib import auth
from firewall import models
import os
from django.conf.settings import firewall_settings as settings
import django.conf
import subprocess
import re
......@@ -10,6 +11,7 @@ from datetime import datetime, timedelta
from django.db.models import Q
settings = django.conf.settings.FIREWALL_SETTINGS
class Firewall:
IPV6=False
RULES = None
......
......@@ -7,11 +7,12 @@ from django.utils.translation import ugettext_lazy as _
from firewall.fields import *
from south.modelsinspector import add_introspection_rules
from django.core.validators import MinValueValidator, MaxValueValidator
from django.conf.settings import firewall_settings as settings
import django.conf
from django.db.models.signals import post_save
import re
import random
settings = django.conf.settings.FIREWALL_SETTINGS
class Rule(models.Model):
CHOICES_type = (('host', 'host'), ('firewall', 'firewall'),
('vlan', 'vlan'))
......
......@@ -4,7 +4,9 @@ from django.core.cache import cache
import os
import time
from firewall.fw import *
from django.conf.settings import firewall_settings as settings
import django.conf
settings = django.conf.settings.FIREWALL_SETTINGS
@celery.task
def reload_dns_task(data):
......
......@@ -18,7 +18,9 @@ from firewall.models import Host, Rule, Vlan, Record
from school.models import Person, Group
from store.api import StoreApi
from .util import keygen
from django.conf.settings import CLOUD_URL
import django.conf
CLOUD_URL = django.conf.settings.CLOUD_URL
logger = logging.getLogger(__name__)
pwgen = User.objects.make_random_password
......
......@@ -20,7 +20,6 @@ from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import *
from django.views.generic import *
from firewall.tasks import *
from django.conf.settings import store_settings
from one.models import *
from school.models import *
import django.contrib.auth as auth
......@@ -28,6 +27,7 @@ import json
import logging
import subprocess
store_settings = settings.STORE_SETTINGS
logger = logging.getLogger(__name__)
def _list_instances(request):
......
from django.db import models
from django.http import Http404
import json, requests, time
from django.conf.settings import store_settings as settings
import django.conf
settings = django.conf.settings.STORE_SETTINGS
# Create your models here.
#TODO Handle exceptions locally
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment