Skip to content

Instantly share code, notes, and snippets.

View muhammad-ammar's full-sized avatar

Muhammad Ammar muhammad-ammar

View GitHub Profile
@muhammad-ammar
muhammad-ammar / Vagrantfile
Created November 17, 2015 14:01
Vagrantfile for Django 1.8 devstack
Vagrant.require_version ">= 1.6.5"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
VAGRANTFILE_API_VERSION = "2"
MEMORY = 4096
CPU_COUNT = 2
==> default: TASK: [edxapp | migrate] ******************************************************
==> default: failed: [localhost] => (item=lms) => {"changed": true, "cmd": ["/edx/bin/edxapp-migrate-lms"], "delta": "0:01:28.479549", "end": "2015-11-16 12:43:18.548688", "item": "lms", "rc": 1, "start": "2015-11-16 12:41:50.069139", "warnings": []}
==> default: stderr: warning: unable to access '/root/.config/git/attributes': Permission denied
==> default: 2015-11-16 07:41:58,716 INFO 15852 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125
==> default: System check identified some issues:
==> default:
==> default: WARNINGS:
==> default: wiki.ArticleRevision.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
==> default: HINT: Use GenericIPAddressField instead.
==> default: Traceback (most recent call last):
@muhammad-ammar
muhammad-ammar / get_model.py
Created September 3, 2015 09:14
load get_model when needed
get_model_func = None
def get_model(app, model):
if get_model_func is None:
if django is None:
raise import_failure
elif django.VERSION[:2] < (1, 7):
from django.db.models import loading
get_model_func = loading.get_model()
@muhammad-ammar
muhammad-ammar / fb_dsm_issue.txt
Created September 3, 2015 09:12
DJANGO_SETTINGS_MODULE undefined error
Traceback (most recent call last):
/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nose/loader.py line 418 in loadTestsFromName
addr.filename, addr.module)
/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nose/importer.py line 47 in importFromPath
return self.importFromDir(dir_path, fqname)
/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/nose/importer.py line 94 in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py line 12 in <module>
from xmodule.modulestore.tests.test_assetstore import AssetStoreTestData
common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py line 16 in <module>
@muhammad-ammar
muhammad-ammar / pedantically_commented_playbook.yml
Last active August 29, 2015 14:25 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
edxapp@precise64:~/edx-platform$ paver run_quality
---> pavelib.quality.run_quality
---> pavelib.prereqs.install_python_prereqs
Python prereqs unchanged, skipping...
pep8 . | tee /edx/app/edxapp/edx-platform/reports/pep8/pep8.report -a
-------------
Quality Report: pep8
-------------
-------------
Violations: 0
# -*- coding: utf-8 -*-
import os
import StringIO
import hashlib
try:
from boto.s3.connection import S3Connection
from boto.s3.key import Key
except ImportError:
raise ImproperlyConfigured, "Could not load Boto's S3 bindings."
<div class="settings-sections">
<div class="section-header">
<%- gettext("Account Settings") %>
<small class="subtitle"><%- gettext("A collection of all your account settings, including basic personalization controls, demographic information, and linked social accounts.") %></small>
</div>
<ol>
<li class="list-section">
<div class="list-section-header">
<h3> Basic Account Information </h3>
======================================================================
ERROR: test_page (acceptance_tests.test_course_engagement.CourseEngagementTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ammar/edx/edx-analytics-dashboard/acceptance_tests/test_course_engagement.py", line 28, in test_page
super(CourseEngagementTests, self).test_page()
File "/home/ammar/edx/edx-analytics-dashboard/acceptance_tests/mixins.py", line 207, in test_page
self.login()
File "/home/ammar/edx/edx-analytics-dashboard/acceptance_tests/mixins.py", line 101, in login
self.login_with_lms()
import sys
import unittest
from nose.plugins.attrib import attr
@attr('shard_1')
class FirstTest(unittest.TestCase):
def test_f11(self):
print >> sys.stderr, 'test_f11'