summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore115
-rw-r--r--README.rst49
-rw-r--r--client/post-example/results.json24
-rw-r--r--client/post-example/upload.py6
-rw-r--r--front-end/src/component/nav-top/index.jsx4
-rw-r--r--front-end/src/page/farmerApply/index.jsx4
-rw-r--r--front-end/src/page/home/index.jsx10
-rw-r--r--front-end/src/util/util.jsx2
-rw-r--r--front-end/webpack.config.js2
-rw-r--r--readme.md63
-rw-r--r--report.md85
-rw-r--r--web/apps/test_records/serializer.py4
-rw-r--r--web/apps/test_records/views.py18
-rw-r--r--web/apps/user_operation/filters.py2
-rw-r--r--web/apps/user_operation/views.py4
-rw-r--r--web/apps/users/admin.py2
-rw-r--r--web/apps/users/jwt_handler.py2
-rw-r--r--web/db_tools/data/user_data.py16
-rw-r--r--web/db_tools/import_user_data.py2
-rw-r--r--web/pgperffarm/settings.py2
-rw-r--r--web/requirements.txt4
21 files changed, 320 insertions, 100 deletions
diff --git a/.gitignore b/.gitignore
index 37410b9..f75da5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@ migrations
*.pyc
*.swp
*.psp
-.DS_Store
tags
# front-end
@@ -14,4 +13,116 @@ tags
.idea
dist
node_modules
-*.log* \ No newline at end of file
+*.log*
+
+# added by Ila
+### macOS ###
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+### PyCharm ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+# JetBrains templates
+**___jb_tmp___
+
+### PyCharm Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+.idea/sonarlint
+
diff --git a/README.rst b/README.rst
deleted file mode 100644
index 4b42a52..0000000
--- a/README.rst
+++ /dev/null
@@ -1,49 +0,0 @@
-PostgreSQL Performance Farm
-===========================
-
-This repository contains the code for the PostgreSQL Performance Farm.
-
-web/
-----
-
-The web/ directory contains the Django application that forms the basis of the
-website. In order to run the site, you will need to setup a Python virtualenv,
-e.g::
-
- $ sudo pip install virtualenvwrapper
- $ source /usr/local/bin/virtualenvwrapper.sh
- $ mkvirtualenv pgperffarm
-
-For ease of future use, configure virtualenvs from your .bash_profile::
-
- $ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bash_profile
-
-To activate the environment in future sessions, run::
-
- $ workon pgperffarm
-
-Then, install the required modules. Note that we use Django 1.8.11 as that's
-what is currently supported on the postgresql.org infrastructure::
-
- $ PATH=$PATH:/usr/local/pgsql/bin pip install -r web/requirements.txt
-
-Next, create a settings_local.py file::
-
- $ cp web/pgperffarm/settings_local.py.in web/pgperffarm/settings_local.py
-
-Edit the file and change the database configuration and other settings to suit
-your environment. Make sure you create the required database and user account
-on your PostgreSQL server.
-
-Finally, synchronise the database::
-
- $ cd web
- $ python manage.py makemigrations
- $ python manage.py migrate
-
-That should be all. To test, run the following command and point a browser at
-the URL shown::
-
- $ python manage.py runserver
-
-You should see the index page of the application.
diff --git a/client/post-example/results.json b/client/post-example/results.json
index ba57808..ba47aaa 100644
--- a/client/post-example/results.json
+++ b/client/post-example/results.json
@@ -4,8 +4,8 @@
"10": {
"1": {
"std": 0.0,
- "metric": 30551.681364,
- "median": 30551.681364,
+ "metric": 10551.681364,
+ "median": 10551.681364,
"results": [
{
"latency": -1,
@@ -24,8 +24,8 @@
},
"2": {
"std": 0.0,
- "metric": 38238.312979,
- "median": 38238.312979,
+ "metric": 28238.312979,
+ "median": 28238.312979,
"results": [
{
"latency": -1,
@@ -44,8 +44,8 @@
},
"4": {
"std": 0.0,
- "metric": 35567.822014,
- "median": 35567.822014,
+ "metric": 25567.822014,
+ "median": 25567.822014,
"results": [
{
"latency": -1,
@@ -68,8 +68,8 @@
"10": {
"1": {
"std": 0.0,
- "metric": 116.508045,
- "median": 116.508045,
+ "metric": 216.508045,
+ "median": 216.508045,
"results": [
{
"latency": -1,
@@ -131,13 +131,13 @@
},
"postgres": {
"commit": "c6736ff76046521f56c50deb31da218bc1b29533",
- "branch": "rel_9_5_stable",
+ "branch": "master",
"settings": {
- "checkpoint_timeout": "20min",
+ "checkpoint_timeout": "15min",
"log_temp_files": "32",
"work_mem": "64MB",
"log_line_prefix": "%n %t ",
- "shared_buffers": "2GB",
+ "shared_buffers": "1GB",
"log_autovacuum_min_duration": "0",
"checkpoint_completion_target": "0.9",
"maintenance_work_mem": "128MB",
@@ -154,7 +154,7 @@
"collectd": {},
"meta": {
"date": "2018-07-17 23:02:57.000000+00",
- "uname": "Linux postgresql-gsoc1 4.9.0-6-powerpc64le #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) ppc64le GNU/Linux\n",
+ "uname": "Linux postgresql-gsoc 4.9.0-6-powerpc64le #1 SMP Centos 4.9.88-1+deb9u1 (2018-05-07) ppc64le GNU/Linux\n",
"benchmark": "pgbench",
"name": "pgbench-basic"
},
diff --git a/client/post-example/upload.py b/client/post-example/upload.py
index 467497c..b0164d4 100644
--- a/client/post-example/upload.py
+++ b/client/post-example/upload.py
@@ -14,9 +14,9 @@ def byteify(input):
return input
-token = '0ae27ecb064ff5283296b297bac77d9e'
-# BASE_URL = 'http://140.211.168.111:8080/'
-BASE_URL = 'http://127.0.0.1:8000/'
+token = '0232f37f8e1726684516434441af745'
+BASE_URL = 'http://140.211.168.111:8080/'
+# BASE_URL = 'http://127.0.0.1:8000/'
PATH_URL = 'upload/'
url = BASE_URL + PATH_URL
diff --git a/front-end/src/component/nav-top/index.jsx b/front-end/src/component/nav-top/index.jsx
index 08a4e8d..f6a9bfb 100644
--- a/front-end/src/component/nav-top/index.jsx
+++ b/front-end/src/component/nav-top/index.jsx
@@ -69,7 +69,7 @@ class NavTop extends React.Component {
} else {
button = <li className="dropdown sign-in">
<Link to="/login" aria-expanded="false">
- Sign in
+ Log in
</Link>
</li>;
}
@@ -110,7 +110,7 @@ class NavTop extends React.Component {
<li>
<a href="#">
<div>
- <i className="fa fa-tasks fa-fw"></i> Licence
+ <i className="fa fa-tasks fa-fw"></i> License
{/*<span className="pull-right text-muted small">4 min</span>*/}
</div>
</a>
diff --git a/front-end/src/page/farmerApply/index.jsx b/front-end/src/page/farmerApply/index.jsx
index 43068e3..46a9a80 100644
--- a/front-end/src/page/farmerApply/index.jsx
+++ b/front-end/src/page/farmerApply/index.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import {hashHistory} from 'React-router'
+import {hashHistory} from 'react-router'
import './index.css';
import {Link} from 'react-router-dom';
import UserInfoCard from 'component/userinfo-card/index.jsx'
@@ -97,7 +97,7 @@ class FarmerApply extends React.Component {
_user.farmerApply(machineInfo).then((res) => {
// console.dir(res)
alert('add machine success!')
- hashHistory.push('/portal')
+ //hashHistory.push('/portal')
// window.location.href = this.state.redirect;
}, (err) => {
// console.log(err)
diff --git a/front-end/src/page/home/index.jsx b/front-end/src/page/home/index.jsx
index 2bc2bd8..5022913 100644
--- a/front-end/src/page/home/index.jsx
+++ b/front-end/src/page/home/index.jsx
@@ -5,14 +5,12 @@ class Home extends React.Component{
render(){
return (
<div id="page-wrapper" className="jumbotron">
- <h1>Hello, world!</h1>
+ <h1>PostgreSQL Performance Farm</h1>
<p>
- The PostgreSQL Performance Farm project is a community project to collect performance data from tests as code changes are made to PostgreSQL. To support this effort, a database needs to be created for storing results, and a Web site developed to review results.
- This project will focus on developing the Web site on top of the database.
- The database will be using PostgreSQL in the back-end. Test results will come in the form of JSON and flat files. The Web application will be developed using the Django Web framework.
+ The PostgreSQL Performance Farm project is a community project to collect performance data from tests, as code changes are made to PostgreSQL. Test results come as JSON or flat files, and the server-side interface is deployed using the Django framework.
</p>
<p>
- As an example, the PostgreSQL Build Farm site is a central repository for the results of testing source code changes for PostgreSQL as they occur, on a wide variety of platforms.
+ This website enables registered users to upload, browse and download test results for all machines.
</p>
{/*<button className="btn btn-warning">test</button>*/}
@@ -21,4 +19,4 @@ class Home extends React.Component{
}
}
-export default Home; \ No newline at end of file
+export default Home;
diff --git a/front-end/src/util/util.jsx b/front-end/src/util/util.jsx
index 6a93479..fa4c504 100644
--- a/front-end/src/util/util.jsx
+++ b/front-end/src/util/util.jsx
@@ -11,7 +11,7 @@ class PGUtil {
$.ajax({
type: param.type || 'get',
url: param.url || '',
- dataType: param.dataType || 'json',
+ dataType: param.dataType || 'jsonp',
data: param.data || null,
// headers: {
// 'Authorization': 'Token ' + user.token
diff --git a/front-end/webpack.config.js b/front-end/webpack.config.js
index 4eeec6b..3cbe060 100644
--- a/front-end/webpack.config.js
+++ b/front-end/webpack.config.js
@@ -9,7 +9,7 @@ module.exports = {
entry: './src/app.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
- publicPath: WEBPACK_ENV === 'dev' ? '' : '//140.211.168.111/front-end-code/dist/',
+ publicPath: WEBPACK_ENV === 'dev' ? '/dist/' : '//140.211.168.111/front-end-code/dist/',
filename: 'js/app.js'
},
resolve: {
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..a6da04f
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,63 @@
+# PostgreSQL Performance Farm
+
+This repository contains the code for the PostgreSQL Performance Farm.
+
+IMPORTANT: migrating from Python2 to Python3 is in progress, hence why code might not work - for any issues feel free to contact @ila at [email protected]
+
+----
+
+#### Configuration
+
+```bash
+refs/remotes/origin/masterweb/
+```
+
+The web/ directory contains the Django application that forms the basis of the website. In order to run the site, you will need to setup a Python `virtualenv`, e.g:
+
+```bash
+$ sudo pip install virtualenvwrapper
+$ source /usr/local/bin/virtualenvwrapper.sh
+$ mkvirtualenv pgperffarm
+```
+
+For ease of future use, configure virtualenvs from your `.bash_profile`:
+
+```bash
+$ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bash_profile
+```
+
+To activate the environment in future sessions, run:
+
+```bash
+$ workon pgperffarm
+```
+
+Then, install the required modules. Note that we use Django 1.8 as that's what is currently supported on the postgresql.org infrastructure:
+
+```bash
+$ PATH=$PATH:/usr/local/pgsql/bin pip install -r web/requirements.txt
+```
+
+Next, create a `settings_local.py` file::
+
+```bash
+$ cp web/pgperffarm/settings_local.py.in web/pgperffarm/settings_local.py
+```
+
+Edit the file and change the database configuration and other settings to suit your environment. Make sure you create the required database and user account on your PostgreSQL server.
+
+Finally, synchronise the database:
+
+```bash
+$ cd web
+$ python manage.py makemigrations
+$ python manage.py migrate
+```
+
+That should be all. To test, run the following command and point a browser at the URL shown:
+
+```bash
+$ python manage.py runserver
+```
+
+You should see the index page of the application. \ No newline at end of file
diff --git a/report.md b/report.md
new file mode 100644
index 0000000..bd46813
--- /dev/null
+++ b/report.md
@@ -0,0 +1,85 @@
+# Google Summer of Code 2019 - report
+
+The 2019 Google Summer of Code project consists in working on the Develop Performance Farm Database and Website, work in progress from 2018.
+
+The system consists in an API root at the localhost address (127.0.0.1) which generates JSON performance files,
+
+The current application has been built on Python and its module Django, but is missing some features:
+
+* Client cannot upload results to the website;
+* Authentication/authorization tied into the community infrastructure;
+* Associating test systems with users to upload results to the REST API;
+* Checking if a mapping with the same name already exists (`runner.py`);
+* Testing account exit appropriately (`collectd.py`);
+* Collecting output of configure and making commands (`git.py`);
+* API root, the OPTIONS button cannot be unclicked once clicked;
+* Graphical interface improvements while viewing JSON results on the local server (i.e. adding back navigation);
+* Adding test cases of different scale sets (scale=10,20…);
+* Allowing custom tests to be added;
+* Allowing building the local application with node > 9;
+* Website and interface fixes:
+ * Improving responsivity when rescaling the window;
+ * Bug fixes (popups when clicking Status/Machine without being logged in);
+ * Improving design of the homepage and login form;
+ * PG PERF FARM and Home redirect to the same page;
+ * Contact, License and Privacy Policy pages missing;
+ * There might be an issue with URLs not redirecting properly.
+
+In the meanwhile, testing is being made with manually created accounts, although there are some server-side issues related to login.
+
+The system is being developed using Debian 9 and OSX Mojave.
+
+
+
+## Community bonding
+
+#### Migrating from Python2.7 to Python3
+
+Since Python2.7 is no longer going to be maintained in 2020, the community agrees that migrating is necessary. The latest stable version of Python is Python3.6, and Python3.7 has had some issues with older versions of Django, hence I am going to use the first if I find bugs.
+
+The major changes encountered are:
+
+* `import` syntax;
+* `print` syntax;
+* Manually compiled requirements with pip3;
+* Upgraded the Django version (see below);
+* Error while installing psycopg2:
+ * `env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2` on Mac, with Xcode developer tools and openssl;
+
+Changes have been added to `requirements.txt`.
+
+Everything works so far: migrations have no issues, yet there are a couple warnings when accessing the server from browser - I will look into that.
+
+
+
+#### Django version
+
+Using Django1.11 is recommended because the authentication module is on a Django application, so there might be incompatibilies. The version has nonetheless being updated from 1.11.10 to 1.11.17, since the older one has bugs concerning Python3.
+
+
+
+#### Code specifics
+
+*client*: contains packages with functions used to generate test results and files, with exception handling. Results are collected with Python modules which analyse hardware, system and database performance.
+
+*front-end*: contains HTML, CSS and JS code the website is built on, using the React framework.
+
+*web*: contains testing functions, role definitions in the authentication system and parsing of the JSON file, along with conversion of existent results in a downloadable format.
+
+
+
+## Coding Phase 1
+
+#### Week 1
+
+During the first week, some minor changes are made to the front-end interface, to get acquainted with the source code without risking bugs:
+
+* "Sign in" changed to "Log in" in the homepage;
+* Changed the homepage text.
+
+Locally running the website developing a React application through `yarn install` and `yarn run dev` is the best option to test changes, yet those only work with Node between 4 and 9 due to Webpack issues, concerning [email protected]: there is no available official fix aside from ignoring dependencies.
+
+The website is being tested using node8.16.0, and yarn 1.16.0.
+
+
+
diff --git a/web/apps/test_records/serializer.py b/web/apps/test_records/serializer.py
index 5decb02..99759cd 100644
--- a/web/apps/test_records/serializer.py
+++ b/web/apps/test_records/serializer.py
@@ -246,7 +246,7 @@ class TestStatusRecordListSerializer(serializers.ModelSerializer):
if (data_list_count == trend['none']):
trend['is_first'] = True
- print str(data_list_count)
+ print(str(data_list_count))
return trend
def get_machine_info(self, obj):
@@ -306,7 +306,7 @@ class TestRecordListSerializer(serializers.ModelSerializer):
if (data_list_count == trend['none']):
trend['is_first'] = True
- print str(data_list_count)
+ print(str(data_list_count))
return trend
def get_machine_info(self, obj):
diff --git a/web/apps/test_records/views.py b/web/apps/test_records/views.py
index d09484b..f681568 100644
--- a/web/apps/test_records/views.py
+++ b/web/apps/test_records/views.py
@@ -7,9 +7,9 @@ import shortuuid
from django.contrib.auth.hashers import make_password
from rest_framework.pagination import PageNumberPagination
-from exception import TestDataUploadError
-from test_records.filters import TestRecordListFilter
-from models import UserMachine, TestCategory, TestBranch
+from .exception import TestDataUploadError
+from .filters import TestRecordListFilter
+from .models import UserMachine, TestCategory, TestBranch
from pgperffarm.settings import DB_ENUM
from user_operation.views import UserMachinePermission
from .serializer import MachineHistoryRecordSerializer, TestStatusRecordListSerializer, TestBranchSerializer, \
@@ -115,7 +115,7 @@ def TestRecordCreate(request, format=None):
print(request.__str__())
data = request.data
- print type(data[0])
+ print(type(data[0]))
json_data = json.dumps(data[0], encoding="UTF-8", ensure_ascii=False)
json_data = json.loads(json_data, encoding="UTF-8")
# obj = data[0].pgbench
@@ -211,11 +211,11 @@ def TestRecordCreate(request, format=None):
if not test_cate:
continue
else:
- print test_cate.cate_name
+ print(test_cate.cate_name)
for scale, dataset_list in tag_list.iteritems():
- print "ro[%s]=" % scale, dataset_list
+ print("ro[%s]=" % scale, dataset_list)
for client_num, dataset in dataset_list.iteritems():
- print 'std is:' + str(dataset['std'])
+ print('std is:' + str(dataset['std']))
test_dataset_data = {
'test_record': testRecordRet.id,
@@ -232,7 +232,7 @@ def TestRecordCreate(request, format=None):
testDateSet = CreateTestDateSetSerializer(data=test_dataset_data)
testDateSetRet = None
if testDateSet.is_valid():
- print 'dataset valid'
+ print('dataset valid')
testDateSetRet = testDateSet.save()
else:
# print(testDateSet.errors)
@@ -248,7 +248,7 @@ def TestRecordCreate(request, format=None):
testResultRet = None
if testResult.is_valid():
- print 'testResult valid'
+ print('testResult valid')
testResultRet = testResult.save()
else:
# print(testResult.error_messages)
diff --git a/web/apps/user_operation/filters.py b/web/apps/user_operation/filters.py
index d429d96..a61ac8e 100644
--- a/web/apps/user_operation/filters.py
+++ b/web/apps/user_operation/filters.py
@@ -3,7 +3,7 @@
import django_filters
from django.db.models import Q
-from models import UserMachine
+from .models import UserMachine
from test_records.models import TestRecord
diff --git a/web/apps/user_operation/views.py b/web/apps/user_operation/views.py
index e7641cf..43696f6 100644
--- a/web/apps/user_operation/views.py
+++ b/web/apps/user_operation/views.py
@@ -8,11 +8,11 @@ from rest_framework import authentication
from rest_framework.pagination import PageNumberPagination
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
-from filters import MachineRecordListFilter, UserMachineListFilter
+from .filters import MachineRecordListFilter, UserMachineListFilter
from test_records.models import TestRecord
from users.models import UserMachine, UserProfile
from users.serializer import CreateUserProfileSerializer
-from serializer import UserMachineManageSerializer, UserPortalInfoSerializer, TestRecordListSerializer, \
+from .serializer import UserMachineManageSerializer, UserPortalInfoSerializer, TestRecordListSerializer, \
UserMachineSerializer, CreateUserMachineSerializer
from rest_framework.response import Response
from rest_framework import status
diff --git a/web/apps/users/admin.py b/web/apps/users/admin.py
index 2c31eef..c7ef0fa 100644
--- a/web/apps/users/admin.py
+++ b/web/apps/users/admin.py
@@ -5,7 +5,7 @@ from django.contrib import admin
from asynchronous_send_mail import send_mail
from django.conf import settings
# Register your models here.
-from serializer import UserMachineSerializer
+from .serializer import UserMachineSerializer
from .models import UserMachine, UserProfile
class UserProfileAdmin(admin.ModelAdmin):
diff --git a/web/apps/users/jwt_handler.py b/web/apps/users/jwt_handler.py
index 7dfdb94..ff8fdaa 100644
--- a/web/apps/users/jwt_handler.py
+++ b/web/apps/users/jwt_handler.py
@@ -1,4 +1,4 @@
-from serializer import JWTUserProfileSerializer
+from .serializer import JWTUserProfileSerializer
# user jwt handler
def jwt_response_payload_handler(token, user=None, request=None):
diff --git a/web/db_tools/data/user_data.py b/web/db_tools/data/user_data.py
index aa4f3f6..0ad938f 100644
--- a/web/db_tools/data/user_data.py
+++ b/web/db_tools/data/user_data.py
@@ -1,14 +1,26 @@
row_data = [
{
'password': '123456',
- 'is_superuser': False,
+ 'is_superuser': True,
'username': 'maleic',
'first_name': 'Maleic',
'last_name': 'Acid',
- 'date_joined': '2018-06-14 21:34:51+08',
+ 'date_joined': '2018-08-10 21:34:51+08',
'email': '[email protected]',
'is_staff': False,
'is_active': True,
'last_login': '2018-06-14 21:34:51+08',
},
+ {
+ 'password': '123456',
+ 'is_superuser': True,
+ 'username': 'mark',
+ 'first_name': 'Mark',
+ 'last_name': 'Wong',
+ 'date_joined': '2018-08-10 21:34:51+08',
+ 'email': '[email protected]',
+ 'is_staff': False,
+ 'is_active': True,
+ 'last_login': '2018-06-14 21:34:51+08',
+ },
] \ No newline at end of file
diff --git a/web/db_tools/import_user_data.py b/web/db_tools/import_user_data.py
index 799e5f9..987c095 100644
--- a/web/db_tools/import_user_data.py
+++ b/web/db_tools/import_user_data.py
@@ -1,6 +1,6 @@
import sys
import os
-from pgperffarm.settings import PORJECT_PATH
+from path import PORJECT_PATH
# Use django's model independently
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.append(pwd+ "../")
diff --git a/web/pgperffarm/settings.py b/web/pgperffarm/settings.py
index 52c1987..226a29b 100644
--- a/web/pgperffarm/settings.py
+++ b/web/pgperffarm/settings.py
@@ -4,7 +4,7 @@ import os
import sys
# Load local settings overrides
-from settings_local import *
+from pgperffarm.settings_local import *
"""
Django settings for pgperfarm project.
diff --git a/web/requirements.txt b/web/requirements.txt
index 9b8d591..1744f0e 100644
--- a/web/requirements.txt
+++ b/web/requirements.txt
@@ -6,7 +6,7 @@ coreschema==0.0.4
data==0.4
decorator==4.3.0
diff-match-patch==20121119
-Django==1.11.10
+Django==1.11.17
django-cors-headers==2.2.0
django-crispy-forms==1.7.2
django-filter==1.1.0
@@ -28,7 +28,6 @@ Markdown==2.6.11
MarkupSafe==1.0
odfpy==1.3.6
openpyxl==2.5.4
-psycopg2==2.7.4
pycrypto==2.6.1
PyJWT==1.6.4
pytz==2018.3
@@ -42,3 +41,4 @@ uritemplate==3.0.0
urllib3==1.22
xlrd==1.1.0
xlwt==1.3.0
+psycopg2==2.8.2