Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-notes-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-notes-api
Commits
4226868b
Commit
4226868b
authored
Nov 25, 2014
by
Oleg Marshev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Overwrite default annotator-store settings.
parent
97bc56cf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
notesapi/__init__.py
+3
-0
notesapi/v1/tests/test_views.py
+5
-0
notesserver/client.py
+6
-2
notesserver/settings/common.py
+2
-0
No files found.
notesapi/__init__.py
View file @
4226868b
from
notesserver
import
client
client
.
set_es_settings
()
notesapi/v1/tests/test_views.py
View file @
4226868b
...
@@ -2,6 +2,8 @@ import unittest
...
@@ -2,6 +2,8 @@ import unittest
from
mock
import
patch
from
mock
import
patch
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
rest_framework
import
status
from
rest_framework
import
status
from
rest_framework.test
import
APITestCase
from
rest_framework.test
import
APITestCase
...
@@ -15,6 +17,9 @@ class AnnotationViewTests(APITestCase):
...
@@ -15,6 +17,9 @@ class AnnotationViewTests(APITestCase):
Tests for annotation views.
Tests for annotation views.
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
assert
Annotation
.
es
.
host
==
settings
.
ELASTICSEARCH_URL
assert
Annotation
.
es
.
index
==
settings
.
ELASTICSEARCH_INDEX
annotation
.
Annotation
.
create_all
()
annotation
.
Annotation
.
create_all
()
es
.
conn
.
cluster
.
health
(
wait_for_status
=
'yellow'
)
es
.
conn
.
cluster
.
health
(
wait_for_status
=
'yellow'
)
...
...
notesserver/client.py
View file @
4226868b
...
@@ -2,5 +2,9 @@ from django.conf import settings
...
@@ -2,5 +2,9 @@ from django.conf import settings
from
annotator
import
es
from
annotator
import
es
es
.
host
=
getattr
(
settings
,
'ELASTICSEARCH_URL'
,
'http://localhost:9200'
)
def
set_es_settings
():
es
.
index
=
getattr
(
settings
,
'ELASTICSEARCH_INDEX'
,
'edx-notes'
)
"""
Overwrite default annotator-store elasticsearch settings.
"""
es
.
host
=
getattr
(
settings
,
'ELASTICSEARCH_URL'
,
'http://localhost:9200'
)
es
.
index
=
getattr
(
settings
,
'ELASTICSEARCH_INDEX'
,
'edx-notes-dev'
)
notesserver/settings/common.py
View file @
4226868b
...
@@ -21,6 +21,8 @@ INSTALLED_APPS = (
...
@@ -21,6 +21,8 @@ INSTALLED_APPS = (
'rest_framework'
,
'rest_framework'
,
'rest_framework_swagger'
,
'rest_framework_swagger'
,
'corsheaders'
,
'corsheaders'
,
'notesapi'
,
'notesapi.v1'
,
)
)
STATIC_URL
=
'/static/'
STATIC_URL
=
'/static/'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment