forked from pyscada/PyScada
-
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.
0.7.0rc10 - updated docs - fixed no data download in pyscada.js - fixed default pollingt interval in pyscada.device
- Loading branch information
1 parent
c6d7f33
commit d3a9aff
Showing
8 changed files
with
92 additions
and
75 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
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 |
---|---|---|
|
@@ -10,22 +10,22 @@ Open the urls configuration file and add the necessary rewrite rule to the djang | |
|
||
:: | ||
|
||
nano /var/www/pyscada/PyScadaServer/PyScadaServer/urls.py | ||
nano /var/www/pyscada/PyScadaServer/PyScadaServer/urls.py | ||
|
||
|
||
:: | ||
|
||
... | ||
from django.conf.urls import url, include | ||
from django.contrib import admin | ||
urlpatterns = [ | ||
url(r'^admin/', admin.site.urls), | ||
url(r'^', include('pyscada.hmi.urls')), | ||
] | ||
... | ||
... | ||
from django.conf.urls import url, include | ||
from django.contrib import admin | ||
|
||
urlpatterns = [ | ||
url(r'^admin/', admin.site.urls), | ||
url(r'^', include('pyscada.hmi.urls')), | ||
] | ||
... | ||
|
||
|
||
|
||
settings.py | ||
----------- | ||
|
@@ -35,7 +35,7 @@ Open the django settings file and make the following modifications. See also the | |
|
||
:: | ||
|
||
nano /var/www/pyscada/PyScadaServer/PyScadaServer/settings.py | ||
nano /var/www/pyscada/PyScadaServer/PyScadaServer/settings.py | ||
|
||
|
||
First deactivate the debugging, if debugging is active django will keep all SQL queries in the ram, the data-acquisition | ||
|
@@ -44,101 +44,101 @@ pysada daemons after you change the debugging state. | |
|
||
:: | ||
|
||
DEBUG = False | ||
DEBUG = False | ||
|
||
|
||
Add the host/domain of your machine, in this case every url that point to a ip of the machine is allowed. | ||
|
||
:: | ||
|
||
ALLOWED_HOSTS = ['*'] | ||
ALLOWED_HOSTS = ['*'] | ||
|
||
|
||
Add PyScada and the PyScada sub-apps to the installed apps list of Django. | ||
|
||
:: | ||
|
||
INSTALLED_APPS = [ | ||
... | ||
'pyscada', | ||
'pyscada.modbus', | ||
'pyscada.phant', | ||
'pyscada.visa', | ||
'pyscada.hmi', | ||
'pyscada.systemstat', | ||
'pyscada.export', | ||
'pyscada.onewire', | ||
INSTALLED_APPS = [ | ||
... | ||
'pyscada', | ||
'pyscada.modbus', | ||
'pyscada.phant', | ||
'pyscada.visa', | ||
'pyscada.hmi', | ||
'pyscada.systemstat', | ||
'pyscada.export', | ||
'pyscada.onewire', | ||
'pyscada.smbus', | ||
] | ||
] | ||
|
||
To use the MySQL Database, fill in the database, the user and password as selected in the *create Database section*. | ||
|
||
:: | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'PyScada_db', | ||
'USER': 'PyScada-user', | ||
'PASSWORD': 'PyScada-user-password', | ||
'OPTIONS': { | ||
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", | ||
} | ||
} | ||
} | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'PyScada_db', | ||
'USER': 'PyScada-user', | ||
'PASSWORD': 'PyScada-user-password', | ||
'OPTIONS': { | ||
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", | ||
} | ||
} | ||
} | ||
|
||
|
||
Set the static file and media dir as follows. | ||
|
||
:: | ||
|
||
... | ||
STATIC_URL = '/static/' | ||
... | ||
STATIC_URL = '/static/' | ||
|
||
STATIC_ROOT = '/var/www/pyscada/http/static/' | ||
STATIC_ROOT = '/var/www/pyscada/http/static/' | ||
|
||
MEDIA_URL = '/media/' | ||
MEDIA_URL = '/media/' | ||
|
||
MEDIA_ROOT = '/var/www/pyscada/http/media/' | ||
MEDIA_ROOT = '/var/www/pyscada/http/media/' | ||
|
||
|
||
Add all PyScada specific settings, keep in mind to set the file right file encoding in the `settings.py` file header (see also https://www.python.org/dev/peps/pep-0263/). | ||
|
||
:: | ||
|
||
#!/usr/bin/python | ||
# -*- coding: <encoding name> -*- | ||
#!/usr/bin/python | ||
# -*- coding: <encoding name> -*- | ||
|
||
|
||
Append to the end of the `settings.py`: | ||
|
||
:: | ||
|
||
# PyScada settings | ||
# https://github.com/trombastic/PyScada | ||
|
||
# email settings | ||
DEFAULT_FROM_EMAIL = '[email protected]' | ||
EMAIL_HOST = 'mail.host.com' | ||
EMAIL_PORT = 587 | ||
EMAIL_HOST_USER = '[email protected]' | ||
EMAIL_USE_TLS = True | ||
EMAIL_USE_SSL = False | ||
EMAIL_HOST_PASSWORD = 'password' | ||
EMAIL_PREFIX = 'PREFIX' # Mail subject will be "PREFIX subjecttext" | ||
# meta information's about the plant site | ||
PYSCADA_META = { | ||
'name':'A SHORT NAME', | ||
'description':'A SHORT DESCRIPTION', | ||
} | ||
|
||
# export properties | ||
# | ||
PYSCADA_EXPORT = { | ||
'file_prefix':'PREFIX_', | ||
'output_folder':'~/measurement_data_dumps', | ||
} | ||
# PyScada settings | ||
# https://github.com/trombastic/PyScada | ||
|
||
# email settings | ||
DEFAULT_FROM_EMAIL = '[email protected]' | ||
EMAIL_HOST = 'mail.host.com' | ||
EMAIL_PORT = 587 | ||
EMAIL_HOST_USER = '[email protected]' | ||
EMAIL_USE_TLS = True | ||
EMAIL_USE_SSL = False | ||
EMAIL_HOST_PASSWORD = 'password' | ||
EMAIL_PREFIX = 'PREFIX' # Mail subject will be "PREFIX subjecttext" | ||
|
||
# meta information's about the plant site | ||
PYSCADA_META = { | ||
'name':'A SHORT NAME', | ||
'description':'A SHORT DESCRIPTION', | ||
} | ||
|
||
# export properties | ||
# | ||
PYSCADA_EXPORT = { | ||
'file_prefix':'PREFIX_', | ||
'output_folder':'~/measurement_data_dumps', | ||
} | ||
LOGGING = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
|
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
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,10 @@ | ||
Installation | ||
============ | ||
|
||
add the following line to the urls.py: | ||
|
||
:: | ||
|
||
url(r'^', include('pyscada.phant.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
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
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
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