This file contains hidden or 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
| mysql> select * from mentoring_answer ORDER BY id DESC LIMIT 1; | |
| +-----+------+----------------------------------+---------------+---------------------+---------------------+---------------------------+ | |
| | id | name | student_id | student_input | created_on | modified_on | course_id | | |
| +-----+------+----------------------------------+---------------+---------------------+---------------------+---------------------------+ | |
| | 285 | goal | 949b5f1c92d026420c75a83a8021a78a | fdsgsdg | 2014-10-14 19:06:41 | 2014-10-14 19:06:44 | slashes:Asses+A10+2014_A1 | | |
| +-----+------+----------------------------------+---------------+---------------------+---------------------+---------------------------+ | |
| 1 row in set (0.00 sec) | |
| mysql> Bye |
This file contains hidden or 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
| "FEATURES": { | |
| "USE_MICROSITES": true | |
| }, | |
| "MICROSITE_CONFIGURATION": { | |
| "mineduc": { | |
| "domain_prefix": "mineduc", | |
| "university": "mineduc-forma", | |
| "platform_name": "FormaX", | |
| "logo_image_url": "mineduc/images/header-logo.png", | |
| "email_from_address": "info@formax.edu.ec", |
This file contains hidden or 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
| edxapp@edx:~/edx-platform$ ./manage.py lms shell --settings=devstack | |
| Python 2.7.3 (default, Sep 26 2013, 20:03:06) | |
| Type "copyright", "credits" or "license" for more information. | |
| IPython 0.13.1 -- An enhanced Interactive Python. | |
| ? -> Introduction and overview of IPython's features. | |
| %quickref -> Quick reference. | |
| help -> Python's own help system. | |
| object? -> Details about 'object', use 'object??' for extra details. |
This file contains hidden or 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
| from django.contrib.auth.models import User | |
| from student.models import UserProfile | |
| profileless = [user for user in User.objects.all() if not UserProfile.objects.filter(user=user).count()] |
This file contains hidden or 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
| def login(email, password, base_url='https://courses.edx.org'): | |
| """Login via HTTP and parse sessionid from the cookie.""" | |
| r = requests.get('{}/login'.format(base_url)) | |
| csrf = r.cookies['csrftoken'] | |
| payload = {'email': email, 'password': password} | |
| cookies = {'csrftoken': csrf} | |
| headers = {'referer': '{}/login'.format(base_url), 'X-CSRFToken': csrf} | |
| r = requests.post('{}/user_api/v1/account/login_session/'.format(base_url), | |
| data=payload, cookies=cookies, headers=headers) | |
| try: |
This file contains hidden or 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
| #coding:utf-8 | |
| #django test 中模拟登录的request | |
| from django.contrib.sessions.middleware import SessionMiddleware | |
| from django.test.client import RequestFactory | |
| def add_session_to_request(request): | |
| """Annotate a request object with a session""" | |
| middleware = SessionMiddleware() |
NewerOlder