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
sudo -u www-data /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms --settings aws create_user -s -p edx -e [email protected] | |
sudo -u www-data /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms --settings aws shell | |
from django.contrib.auth.models import User | |
me = User.objects.get(username="edxapp") | |
me.is_superuser = True | |
me.is_staff = True | |
me.save() | |
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
rm /edx/var/mongo/mongodb/mongod.lock | |
mongod -repair --config /etc/mongodb.conf | |
chown -R mongodb:mongodb /edx/var/mongo/. | |
/etc/init.d/mongod start |
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
# NOTE: I (CCB) use a hosts file to create ecommerce.local and lms.local. If you choose not to do this, | |
# replace ecommerce.local with localhost and lms.local with 127.0.0.1. | |
from django.conf import settings | |
from ecommerce.settings import get_lms_url | |
from ecommerce.settings.base import JWT_AUTH | |
ECOMMERCE_URL_ROOT = 'http://ecommerce.local:8002' | |
settings.LMS_URL_ROOT = 'http://lms.local:8000' |
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 is a basic script to issue a credit via the CyberSource API. | |
Requirements: | |
suds (https://fedorahosted.org/suds/) [Install via pip] | |
References | |
* http://www.cybersource.com/developers/integration_methods/simple_order_and_soap_toolkit_api/soap_api/SOAP_toolkits.pdf | |
* http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SO_API/Credit_Cards_SO_API.pdf | |
* http://pydoc.net/Python/merchant-gateways/0.0.1/merchant_gateways.billing.gateways.cybersource/ |
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
# Get the courses from modulestore | |
from xmodule.modulestore.django import modulestore | |
courses = modulestore().get_courses() | |
# Loop through the ids and print the IDs and types | |
for course in courses: | |
print "{}, {}".format(course.id, type(course.id)) |
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
""" | |
Workflow: | |
1. User authenticates and OIDC provider returns permissions as comma-delimited list of globs. | |
2. When user access a course page, call has_access() to verify permissions. | |
If no permissions, view should raise a 403 error. This can be accomplished with a mixin added to our existing views. | |
""" | |
# models.py | |
class UserCoursePermissons(models.Model): | |
user = models.ForeignKey(User, primary_key=True) # Unsure if foreign key can also be primary key |
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 Django authentication backends. For more information visit | |
https://docs.djangoproject.com/en/dev/topics/auth/customizing/. | |
""" | |
from calendar import timegm | |
from datetime import datetime | |
from django.conf import settings | |
import jwt | |
from social.backends.oauth import BaseOAuth2 |
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
// GET /api/edx.core/courses/edX+Open_DemoX+edx_demo_course | |
{ | |
"course_id": "edX+Open_DemoX+edx_demo_course", | |
"name": "edX Demonstration Course", | |
"_links": { | |
"self": { "href": "/api/edx.core/courses/edX+Open_DemoX+edx_demo_course" }, | |
"curies": [ | |
{ "name": "edx.analytics", "href": "https://analytics-api.edx.org/docs/rels/{rel}", "templated": true }, | |
{ "name": "edx.content", "href": "https://api.edx.org/api/edx.content/docs/rels/{rel}", "templated": true }, | |
{ "name": "edx.videos", "href": "https://api.edx.org/api/edx.video/docs/rels/{rel}", "templated": true } |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# Set Salt master | |
minion: | |
master: eng-salt-master.example.com | |
providers: | |
ec2: | |
provider: ec2 | |
ssh_username: ec2-user | |
ssh_interface: private_ips |