Skip to content
View output.sh
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
in update view
serializer not valid
{'title': ['This field may not be blank.']}
View Vagrantfile.rb
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/ubuntu1604"
config.vm.hostname = "dev-#{ENV['USER']}"
config.vm.network "private_network", ip: "10.1.99.100"
config.vm.provider "virtualbox" do |vbox|
vbox.name = "dev-#{ENV['USER']}"
end
config.vm.synced_folder "./", "/srv/salt/"
config.vm.provision :salt do |salt|
View output.txt
manage.py test --keepdb course_builder.multiple_choice_question.tests2
Using existing test database for alias 'default'...
<class 'dict'>
200
{'correct_answer': {'answer_text': '1', 'correct_answer': '/course_materials/course0/multiple_choice_answers/90/'},
'student_answer': {'is_answer_correct': True, 'answer': '/course_materials/course0/multiple_choice_answers/90/'}}
.
----------------------------------------------------------------------
Ran 1 test in 0.417s
View output.txt
.
----------------------------------------------------------------------
Ran 1 test in 0.412s
OK
BUT if I change from force_authentication to the login line,
403
{'detail': 'CSRF Failed: CSRF cookie not set.'}
View background_image.rb
require 'RMagick'
class BackgroundImage < ActiveRecord::Base
attr_accessible :parent_id, :uploaded_data, :filename
has_one :child, :class_name => "BackgroundImage", :foreign_key => :parent_id
# You may want to pass other options to has_attachment.
# See the attachment_fu README.
has_attachment :content_type => :image,
View test.py
seen = StudentMaterialIndividualization.objects.filter(student=student_id,
material__knowledge_goal=knowledge_goal) \
.order_by('started_at')
for item in seen:
material = MaterialVersion.objects.filter(material_key=item.material_key, version=item.version)
# I am trying to end up with a list of materials so would like to query MaterialVersion but based on restrictions from StudentMaterialIndividualization
View shell_output.sh
$ chef-client --once --local-mode --config /\
Users/cnk/Code/sandbox/customizing_chef/part3_examples/solo.rb --override-runlist testcookbook::default
Starting Chef Client, version 12.3.0
[2015-07-09T17:08:42-07:00] WARN: Run List override has been provided.
[2015-07-09T17:08:42-07:00] WARN: Original Run List: []
[2015-07-09T17:08:42-07:00] WARN: Overridden Run List: [recipe[testcookbook::default]]
resolving cookbooks for run list: ["testcookbook::default"]
Synchronizing Cookbooks:
- testcookbook
Compiling Cookbooks...
View import_experts.rake
cat import_experts.rake
#
#use FasterCSV for importing from our file
require 'fastercsv'
# We are working from an FMP export that should contain the following fields:
#
# Person id
# Caltech UID
# First name (with middle initial)
View gist:3e7934c5e9982a1bb89f
In the parent cookbook's attributes/default.rb:
default['dev-django-skeleton']['database']['host'] = "127.0.0.1"
In my wrapper cookbook's attributes/default.rb:
normal['dev-django-skeleton']['database']['host'] = "an RDS name"
In my kitchen.yml for the local Vagrant:
attributes: { dev-django-skeleton: { database: { host: "127.0.0.1" } } }
When I run 'kitchen converge'', this if statement is consistently evaluating to the RDS name:
View app-controllers-application_controller.rb
class ApplicationController < ActionController::Base
# omitted stuff
private
# Used to correct content type for files uploaded with bulkupload or from PicMonkey
def correct_content_type_for_octet_stream(filedata)
return nil if filedata.blank?
# see what the unix file command thinks this is
if filedata.content_type == 'application/octet-stream'
filedata.content_type = type_from_file_command(filedata.path)
end
Something went wrong with that request. Please try again.