diff options
author | Nikolay Zamotaev <nzamotaev@luxoft.com> | 2019-05-15 20:20:43 +0300 |
---|---|---|
committer | Nikolay Zamotaev <nzamotaev@luxoft.com> | 2019-05-21 13:01:54 +0000 |
commit | 674dae2b5518c959b7a37d3d4c9c989704818c56 (patch) | |
tree | e7351b2206dcaafaebd15c32f6c5e86e157d4edd | |
parent | 75a0b2cfd442c5499bb520eee6131263763e8687 (diff) |
Cleanup of documentation issues
Task-number: AUTOSUITE-933
Change-Id: I492d7abbf5462b6d922b8ae319902375d23041ee
Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
-rw-r--r-- | doc/src/deployment-server.qdoc | 27 | ||||
-rwxr-xr-x[-rw-r--r--] | manage.py | 1 | ||||
-rw-r--r-- | store/utilities.py | 10 |
3 files changed, 32 insertions, 6 deletions
diff --git a/doc/src/deployment-server.qdoc b/doc/src/deployment-server.qdoc index c6b2c45..3c5000d 100644 --- a/doc/src/deployment-server.qdoc +++ b/doc/src/deployment-server.qdoc @@ -102,7 +102,7 @@ \c{libffi-dev} package. Next, prepare the virtual environment: \code - virtualenv ./venv + virtualenv -p python2.7 ./venv ./venv/bin/pip install -r requirements.txt \endcode @@ -117,6 +117,31 @@ ./manage.py expire-downloads \endcode + \section2 Activate the Python Virtual Environment + + Before you run \c manage.py, source the activation script on the console where you will be using it. + + \code + . ./venv/bin/activate + \endcode + + This activation is done once per session only: + + + \section2 Prepare Your Databases on the Server + + Before you run the server, first, you must prepare the databases. Also, you need to create an administrative user. + + \code + ./manage.py makemigrations + ./manage.py migrate + ./manage.py createsuperuser + \endcode + + Make sure that the server has a user added for Neptune 3 UI's Downloads App. Currently the username and + password are hardcoded in \c apps/com.pelagicore.downloads/stores/ServerConfig.qml:78. + + \section2 Start the Server To start the server, run the following command in your terminal: diff --git a/manage.py b/manage.py index ad7604e..af588f4 100644..100755 --- a/manage.py +++ b/manage.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2.7 ############################################################################# ## ## Copyright (C) 2019 Luxoft Sweden AB diff --git a/store/utilities.py b/store/utilities.py index 8a72661..611579c 100644 --- a/store/utilities.py +++ b/store/utilities.py @@ -91,7 +91,7 @@ def downloadPath(): return settings.MEDIA_ROOT + 'downloads/' -def isValidDnsName(dnsName, errorString): +def isValidDnsName(dnsName, errorList): # see also in AM: src/common-lib/utilities.cpp / isValidDnsName() try: @@ -106,7 +106,7 @@ def isValidDnsName(dnsName, errorString): labels = dnsName.split('.') if len(labels) < 3: - raise Exception('wrong format - needs to consist of at least three parts separated by .') + raise Exception('wrong format - needs to be in reverse-DNS notation and consist of at least three parts separated by .') # standard domain name requirements from the RFCs 1035 and 1123 @@ -125,7 +125,7 @@ def isValidDnsName(dnsName, errorString): return True except Exception as error: - errorString = str(error) + errorList[0] = str(error) return False @@ -353,9 +353,9 @@ def parseAndValidatePackageMetadata(packageFile, certificates = []): if pkgdata['header']['applicationId'] != pkgdata['info']['id']: raise Exception('the id fields in --PACKAGE-HEADER-- and info.yaml are different: %s vs. %s' % (pkgdata['header']['applicationId'], pkgdata['info']['id'])) - error = '' + error = [''] if not isValidDnsName(pkgdata['info']['id'], error): - raise Exception('invalid id: %s' % error) + raise Exception('invalid id: %s' % error[0]) if pkgdata['header']['diskSpaceUsed'] <= 0: raise Exception('the diskSpaceUsed field in --PACKAGE-HEADER-- is not > 0, but %d' % pkgdata['header']['diskSpaceUsed']) |