@@ -1,23 +1,21 | |||||
1 | from django.db import models |
|
1 | from django.db import models | |
2 |
|
2 | |||
3 | from json_field import JSONField |
|
3 | from json_field import JSONField | |
4 | from django.core.validators import MinValueValidator, MaxValueValidator |
|
4 | from django.core.validators import MinValueValidator, MaxValueValidator | |
5 |
|
5 | |||
6 |
|
6 | |||
7 | from apps.main.models import Device, Experiment |
|
7 | from apps.main.models import Device, Experiment | |
8 |
|
8 | |||
9 | # Create your models here. |
|
9 | # Create your models here. | |
10 | class CGSConfiguration(models.Model): |
|
10 | class CGSConfiguration(models.Model): | |
11 |
|
11 | |||
12 | device = models.ForeignKey(Device) |
|
12 | device = models.ForeignKey(Device) | |
13 | exp = models.ForeignKey(Experiment, default = None) |
|
13 | exp = models.ForeignKey(Experiment, default = None) | |
14 |
freq0 = models.FloatField(verbose_name='Frequency 0',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
14 | freq0 = models.FloatField(verbose_name='Frequency 0',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) | |
15 |
freq1 = models.FloatField(verbose_name='Frequency 1',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
15 | freq1 = models.FloatField(verbose_name='Frequency 1',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) | |
16 | freq2 = models.FloatField(verbose_name='Frequency 2',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
16 | freq2 = models.FloatField(verbose_name='Frequency 2',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) | |
17 |
freq3 = models.PositiveIntegerField(verbose_name='Frequency 3',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
17 | freq3 = models.PositiveIntegerField(verbose_name='Frequency 3',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) | |
18 | freqs = JSONField(default={"frequencies":[{"f0":freq0,"f1":freq1,"f2":freq2,"f3":freq3}]}, blank=True) |
|
18 | freqs = JSONField(default={"frequencies":[{"f0":freq0,"f1":freq1,"f2":freq2,"f3":freq3}]}, blank=True) | |
19 | #clk_in = models.PositiveIntegerField(default=10e6) |
|
19 | #clk_in = models.PositiveIntegerField(default=10e6) | |
20 | #mult = models.PositiveIntegerField(default=40) |
|
20 | #mult = models.PositiveIntegerField(default=40) | |
21 | #div = models.PositiveIntegerField(default=1) |
|
21 | #div = models.PositiveIntegerField(default=1) | |
22 |
|
||||
23 |
|
@@ -1,121 +1,122 | |||||
1 | """ |
|
1 | """ | |
2 | Django settings for radarsys project. |
|
2 | Django settings for radarsys project. | |
3 |
|
3 | |||
4 | Generated by 'django-admin startproject' using Django 1.8.6. |
|
4 | Generated by 'django-admin startproject' using Django 1.8.6. | |
5 |
|
5 | |||
6 | For more information on this file, see |
|
6 | For more information on this file, see | |
7 | https://docs.djangoproject.com/en/1.8/topics/settings/ |
|
7 | https://docs.djangoproject.com/en/1.8/topics/settings/ | |
8 |
|
8 | |||
9 | For the full list of settings and their values, see |
|
9 | For the full list of settings and their values, see | |
10 | https://docs.djangoproject.com/en/1.8/ref/settings/ |
|
10 | https://docs.djangoproject.com/en/1.8/ref/settings/ | |
11 | """ |
|
11 | """ | |
12 |
|
12 | |||
13 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
13 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
14 | import os |
|
14 | import os | |
15 |
|
15 | |||
16 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) |
|
16 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
17 |
|
17 | |||
18 | # Quick-start development settings - unsuitable for production |
|
18 | # Quick-start development settings - unsuitable for production | |
19 | # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ |
|
19 | # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ | |
20 |
|
20 | |||
21 | # SECURITY WARNING: keep the secret key used in production secret! |
|
21 | # SECURITY WARNING: keep the secret key used in production secret! | |
22 | SECRET_KEY = 'xshb$k5fc-+j16)cvyffj&9u__0q3$l!hieh#+tbzqg)*f^km0' |
|
22 | SECRET_KEY = 'xshb$k5fc-+j16)cvyffj&9u__0q3$l!hieh#+tbzqg)*f^km0' | |
23 |
|
23 | |||
24 | # SECURITY WARNING: don't run with debug turned on in production! |
|
24 | # SECURITY WARNING: don't run with debug turned on in production! | |
25 | DEBUG = True |
|
25 | DEBUG = True | |
26 |
|
26 | |||
27 | ALLOWED_HOSTS = [] |
|
27 | ALLOWED_HOSTS = [] | |
28 |
|
28 | |||
29 | # Application definition |
|
29 | # Application definition | |
30 |
|
30 | |||
31 | INSTALLED_APPS = ( |
|
31 | INSTALLED_APPS = ( | |
32 | 'django.contrib.admin', |
|
32 | 'django.contrib.admin', | |
33 | 'django.contrib.auth', |
|
33 | 'django.contrib.auth', | |
34 | 'django.contrib.contenttypes', |
|
34 | 'django.contrib.contenttypes', | |
35 | 'django.contrib.sessions', |
|
35 | 'django.contrib.sessions', | |
36 | 'django.contrib.messages', |
|
36 | 'django.contrib.messages', | |
37 | 'django.contrib.staticfiles', |
|
37 | 'django.contrib.staticfiles', | |
38 | 'bootstrap3', |
|
38 | 'bootstrap3', | |
39 | 'apps.accounts', |
|
39 | 'apps.accounts', | |
40 | 'apps.main', |
|
40 | 'apps.main', | |
41 | 'apps.misc', |
|
41 | 'apps.misc', | |
42 | 'apps.rc', |
|
42 | 'apps.rc', | |
43 | 'apps.dds', |
|
43 | 'apps.dds', | |
44 | 'apps.cgs', |
|
44 | 'apps.cgs', | |
45 | 'apps.acq', |
|
45 | 'apps.acq', | |
46 | 'apps.abs', |
|
46 | 'apps.abs', | |
|
47 | 'json_field' | |||
47 | ) |
|
48 | ) | |
48 |
|
49 | |||
49 | MIDDLEWARE_CLASSES = ( |
|
50 | MIDDLEWARE_CLASSES = ( | |
50 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
51 | 'django.contrib.sessions.middleware.SessionMiddleware', | |
51 | 'django.middleware.common.CommonMiddleware', |
|
52 | 'django.middleware.common.CommonMiddleware', | |
52 | 'django.middleware.csrf.CsrfViewMiddleware', |
|
53 | 'django.middleware.csrf.CsrfViewMiddleware', | |
53 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
54 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
54 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
|
55 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', | |
55 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
56 | 'django.contrib.messages.middleware.MessageMiddleware', | |
56 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
57 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', | |
57 | 'django.middleware.security.SecurityMiddleware', |
|
58 | 'django.middleware.security.SecurityMiddleware', | |
58 | ) |
|
59 | ) | |
59 |
|
60 | |||
60 | ROOT_URLCONF = 'radarsys.urls' |
|
61 | ROOT_URLCONF = 'radarsys.urls' | |
61 |
|
62 | |||
62 | TEMPLATES = [ |
|
63 | TEMPLATES = [ | |
63 | { |
|
64 | { | |
64 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|
65 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
65 | 'DIRS': [os.path.join(BASE_DIR, "templates").replace('\\', '/'),], |
|
66 | 'DIRS': [os.path.join(BASE_DIR, "templates").replace('\\', '/'),], | |
66 | 'APP_DIRS': True, |
|
67 | 'APP_DIRS': True, | |
67 | 'OPTIONS': { |
|
68 | 'OPTIONS': { | |
68 | 'context_processors': [ |
|
69 | 'context_processors': [ | |
69 | 'django.template.context_processors.debug', |
|
70 | 'django.template.context_processors.debug', | |
70 | 'django.template.context_processors.request', |
|
71 | 'django.template.context_processors.request', | |
71 | 'django.contrib.auth.context_processors.auth', |
|
72 | 'django.contrib.auth.context_processors.auth', | |
72 | 'django.contrib.messages.context_processors.messages', |
|
73 | 'django.contrib.messages.context_processors.messages', | |
73 | ], |
|
74 | ], | |
74 | }, |
|
75 | }, | |
75 | }, |
|
76 | }, | |
76 | ] |
|
77 | ] | |
77 |
|
78 | |||
78 | WSGI_APPLICATION = 'radarsys.wsgi.application' |
|
79 | WSGI_APPLICATION = 'radarsys.wsgi.application' | |
79 |
|
80 | |||
80 |
|
81 | |||
81 | # Database |
|
82 | # Database | |
82 | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
|
83 | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases | |
83 |
|
84 | |||
84 | DATABASES = { |
|
85 | DATABASES = { | |
85 | 'default': { |
|
86 | 'default': { | |
86 | 'ENGINE': 'django.db.backends.mysql', |
|
87 | 'ENGINE': 'django.db.backends.mysql', | |
87 | 'NAME': 'radarsys', |
|
88 | 'NAME': 'radarsys', | |
88 | 'USER': 'developer', |
|
89 | 'USER': 'developer', | |
89 | 'PASSWORD': 'idi2015', |
|
90 | 'PASSWORD': 'idi2015', | |
90 | } |
|
91 | } | |
91 | } |
|
92 | } | |
92 |
|
93 | |||
93 |
|
94 | |||
94 | # Internationalization |
|
95 | # Internationalization | |
95 | # https://docs.djangoproject.com/en/1.8/topics/i18n/ |
|
96 | # https://docs.djangoproject.com/en/1.8/topics/i18n/ | |
96 |
|
97 | |||
97 | LANGUAGE_CODE = 'en-us' |
|
98 | LANGUAGE_CODE = 'en-us' | |
98 |
|
99 | |||
99 | TIME_ZONE = 'UTC' |
|
100 | TIME_ZONE = 'UTC' | |
100 |
|
101 | |||
101 | USE_I18N = True |
|
102 | USE_I18N = True | |
102 |
|
103 | |||
103 | USE_L10N = True |
|
104 | USE_L10N = True | |
104 |
|
105 | |||
105 | USE_TZ = True |
|
106 | USE_TZ = True | |
106 |
|
107 | |||
107 | # Static files (CSS, JavaScript, Images) |
|
108 | # Static files (CSS, JavaScript, Images) | |
108 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ |
|
109 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ | |
109 |
|
110 | |||
110 | STATIC_URL = '/static/' |
|
111 | STATIC_URL = '/static/' | |
111 | STATIC_ROOT = '/var/www/html/static/' |
|
112 | STATIC_ROOT = '/var/www/html/static/' | |
112 |
|
113 | |||
113 | STATICFILES_DIRS = ( |
|
114 | STATICFILES_DIRS = ( | |
114 | os.path.join(BASE_DIR, 'apps', 'main', 'static'), |
|
115 | os.path.join(BASE_DIR, 'apps', 'main', 'static'), | |
115 |
|
116 | |||
116 | ) |
|
117 | ) | |
117 |
|
118 | |||
118 |
STATICFILES_FINDERS = ( |
|
119 | STATICFILES_FINDERS = ( | |
119 | 'django.contrib.staticfiles.finders.FileSystemFinder', |
|
120 | 'django.contrib.staticfiles.finders.FileSystemFinder', | |
120 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
121 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', | |
121 | ) |
|
122 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now