Skip to content

Instantly share code, notes, and snippets.

@ChillarAnand
Last active August 29, 2015 14:05
Show Gist options
  • Save ChillarAnand/b837ae66d89b46e6306d to your computer and use it in GitHub Desktop.
Save ChillarAnand/b837ae66d89b46e6306d to your computer and use it in GitHub Desktop.
Pear_App_Django.ipynb
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "",
"signature": "sha256:74e8e3da2fae9783411e673ec41bb1bcb3cb3c69ca1377abedc4da688e6a2d66"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#a = NewProject.objects.filter(name__icontains='a')[:3]\n",
"# print a \n",
"results = MeshTissues.objects.filter(descriptornamestring__icontains='body')[:10]\n",
"data = [r.descriptornamestring for r in results]\n",
"print data\n",
"import json\n",
"json.dumps(data)\n",
"\n",
"#n = [x*2 for x in range(10)]\n",
"#print n\n",
"#import json\n",
"#json.dumps(t)\n",
"\n",
"#reverse('project:project_new')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[u'Body Regions', u'Carotid Body', u'Ciliary Body', u'Vitreous Body', u'Body Fluid Compartments', u'Antibody-Producing Cells', u'Giant Cells, Foreign-Body', u'Body Fluids', u'Body Water', u'Fat Body']\n"
]
},
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 18,
"text": [
"'[\"Body Regions\", \"Carotid Body\", \"Ciliary Body\", \"Vitreous Body\", \"Body Fluid Compartments\", \"Antibody-Producing Cells\", \"Giant Cells, Foreign-Body\", \"Body Fluids\", \"Body Water\", \"Fat Body\"]'"
]
}
],
"prompt_number": 18
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from django.test.utils import setup_test_environment\n",
"from django.test.client import Client\n",
"from django.core.urlresolvers import reverse\n",
"\n",
"setup_test_environment()\n",
"client = Client()\n",
"\n",
"response = client.get(reverse('project:data_api', args=('tissues', 'elbow')))\n",
"#response = client.get('http://127.0.0.1:8000/project/api/tissues/bo')\n",
"\n",
"print response.status_code\n",
"print response.content\n",
"if \"Body\" in response.content:\n",
" print \"asdf\"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"200\n",
"[{\"label\": \"Elbow\"}, {\"label\": \"Elbow Joint\"}]\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.project.models import MeshTissues\n",
"m = MeshTissues.objects.get(pk=10)\n",
"vars(m)\n",
"m2 = MeshTissues.objects.filter(descriptornamestring__icontains = 'body')\n",
"for item in m2:\n",
" print item.descriptornamestring"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) SELECT `project_meshtissues`.`id`, `project_meshtissues`.`descriptorui`, `project_meshtissues`.`descriptornamestring`, `project_meshtissues`.`treenumber` FROM `project_meshtissues` WHERE `project_meshtissues`.`id` = 10 ; args=(10,)\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.002) SELECT `project_meshtissues`.`id`, `project_meshtissues`.`descriptorui`, `project_meshtissues`.`descriptornamestring`, `project_meshtissues`.`treenumber` FROM `project_meshtissues` WHERE `project_meshtissues`.`descriptornamestring` LIKE '%body%' ; args=(u'%body%',)\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Body Regions\n",
"Carotid Body\n",
"Ciliary Body\n",
"Vitreous Body\n",
"Body Fluid Compartments\n",
"Antibody-Producing Cells\n",
"Giant Cells, Foreign-Body\n",
"Body Fluids\n",
"Body Water\n",
"Fat Body\n",
"Ultimobranchial Body\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#model mummy\n",
"from model_mommy import mommy\n",
"from apps.project.models import NewProject, MeshTissues\n",
"n = mommy.make('NewProject')\n",
"vars(n)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) INSERT INTO `project_newproject` (`customer_id`, `name`, `description`, `file_type`, `vcf_file1`, `total_fastq_files`, `fastq_file1`, `fastq_file2`, `file_list`, `paired_end_distance`, `tissue`, `disease`, `status`, `start_processing`, `created_at`, `updated_at`) VALUES (75, 'jNdNwMRNhCYzDeHXxuwSfKHqEZyGWgjPZqxFoYAhNSvlJfnCGLUDwaSnydKDtHFJtufgBBxzRDcFbmHkEEAyzJSucSrLGclVMtjV', '', 'TDcFSbClPz', '', 0, '', '', '', NULL, '', '', 0, 0, '2014-08-14 06:33:39', '2014-08-14 06:33:39'); args=[75, u'jNdNwMRNhCYzDeHXxuwSfKHqEZyGWgjPZqxFoYAhNSvlJfnCGLUDwaSnydKDtHFJtufgBBxzRDcFbmHkEEAyzJSucSrLGclVMtjV', u'', u'TDcFSbClPz', u'', 0, u'', u'', u'', None, u'', u'', 0, False, u'2014-08-14 06:33:39', u'2014-08-14 06:33:39']\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:amqp:Start from server, version: 0.9, properties: {u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2013 GoPivotal, Inc.', u'capabilities': {u'exchange_exchange_bindings': True, u'connection.blocked': True, u'authentication_failure_close': True, u'basic.nack': True, u'consumer_priorities': True, u'consumer_cancel_notify': True, u'publisher_confirms': True}, u'platform': u'Erlang/OTP', u'version': u'3.2.4'}, mechanisms: [u'AMQPLAIN', u'PLAIN'], locales: [u'en_US']\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:amqp:Open OK!\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:amqp:using channel_id: 1\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:amqp:Channel open\n"
]
},
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 1,
"text": [
"{'_customer_cache': <User: CTbaqbLxXenZqWvEeZEFHYVBMXCzZt>,\n",
" '_state': <django.db.models.base.ModelState at 0x7f2b5c304cd0>,\n",
" 'created_at': datetime.datetime(2014, 8, 14, 6, 33, 39, 439814, tzinfo=<UTC>),\n",
" 'customer_id': 75L,\n",
" 'description': u'',\n",
" 'disease': u'',\n",
" 'fastq_file1': u'',\n",
" 'fastq_file2': u'',\n",
" 'file_list': u'',\n",
" 'file_type': u'TDcFSbClPz',\n",
" 'id': 259L,\n",
" 'name': u'jNdNwMRNhCYzDeHXxuwSfKHqEZyGWgjPZqxFoYAhNSvlJfnCGLUDwaSnydKDtHFJtufgBBxzRDcFbmHkEEAyzJSucSrLGclVMtjV',\n",
" 'paired_end_distance': None,\n",
" 'start_processing': False,\n",
" 'status': 0,\n",
" 'tissue': u'',\n",
" 'total_fastq_files': 0,\n",
" 'updated_at': datetime.datetime(2014, 8, 14, 6, 33, 39, 439847, tzinfo=<UTC>),\n",
" 'vcf_file1': u''}"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.project.models import NewProject\n",
"from apps.project.tests import test_functions as t\n",
"n = t.NewProjectFactory()\n",
"vars(n)\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"text": [
"{'_state': <django.db.models.base.ModelState at 0x7f7a97335f10>,\n",
" 'created_at': None,\n",
" 'customer_id': 64,\n",
" 'description': u'',\n",
" 'disease': u'',\n",
" 'fastq_file1': 'ftp://pearl:pearl@localhost/fastq_files/sample.fastq.gz',\n",
" 'fastq_file2': u'',\n",
" 'file_list': u'',\n",
" 'file_type': 'fastq',\n",
" 'id': 200,\n",
" 'name': 'test project',\n",
" 'paired_end_distance': None,\n",
" 'start_processing': False,\n",
" 'status': 0,\n",
" 'tissue': u'',\n",
" 'total_fastq_files': 2,\n",
" 'updated_at': None,\n",
" 'vcf_file1': u''}"
]
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.accounts.models import Customer\n",
"customer_id = 66\n",
"customer = Customer.objects.get(user_id=customer_id)\n",
"print customer\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.001) SELECT `accounts_customer`.`id`, `accounts_customer`.`user_id`, `accounts_customer`.`name`, `accounts_customer`.`company`, `accounts_customer`.`phone_number`, `accounts_customer`.`timezone` FROM `accounts_customer` WHERE `accounts_customer`.`user_id` = 66 ; args=(66,)\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.001) SELECT `auth_user`.`id`, `auth_user`.`password`, `auth_user`.`last_login`, `auth_user`.`is_superuser`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`date_joined` FROM `auth_user` WHERE `auth_user`.`id` = 66 ; args=(66,)\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"testpearl\n"
]
}
],
"prompt_number": 66
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from django.core.urlresolvers import reverse\n",
"reverse('project:project_dashboard')\n",
"reverse('project:project_qcreport', args={55})"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "ImproperlyConfigured",
"evalue": "The included urlconf pearl.urls doesn't have any patterns in it",
"output_type": "pyerr",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImproperlyConfigured\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-1-25e305f1e92e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdjango\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murlresolvers\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mreverse\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mreverse\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'project:project_dashboard'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mreverse\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'project:project_qcreport'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m{\u001b[0m\u001b[1;36m55\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36mreverse\u001b[1;34m(viewname, urlconf, args, kwargs, prefix, current_app)\u001b[0m\n\u001b[0;32m 501\u001b[0m \u001b[1;31m# Lookup the name to see if it could be an app identifier\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 502\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 503\u001b[1;33m \u001b[0mapp_list\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mresolver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapp_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mns\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 504\u001b[0m \u001b[1;31m# Yes! Path part matches an app in the current Resolver\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 505\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mcurrent_app\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mcurrent_app\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mapp_list\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36mapp_dict\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 327\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_language\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 328\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_app_dict\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 329\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_populate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 330\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_app_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlanguage_code\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 331\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36m_populate\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 265\u001b[0m \u001b[0mapps\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 266\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_language\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 267\u001b[1;33m \u001b[1;32mfor\u001b[0m \u001b[0mpattern\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mreversed\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murl_patterns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 268\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'_callback_str'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 269\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_callback_strs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_callback_str\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36murl_patterns\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 363\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 364\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0murl_patterns\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 365\u001b[1;33m \u001b[0mpatterns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murlconf_module\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"urlpatterns\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murlconf_module\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 366\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 367\u001b[0m \u001b[0miter\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpatterns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36murlconf_module\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 358\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_urlconf_module\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 359\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 360\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_urlconf_module\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mimport_module\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murlconf_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 361\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_urlconf_module\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 362\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/utils/importlib.pyc\u001b[0m in \u001b[0;36mimport_module\u001b[1;34m(name, package)\u001b[0m\n\u001b[0;32m 38\u001b[0m \u001b[0mlevel\u001b[0m \u001b[1;33m+=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 39\u001b[0m \u001b[0mname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0m_resolve_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlevel\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpackage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 40\u001b[1;33m \u001b[0m__import__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 41\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodules\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/pearl/pearl/pearl/urls.pyc\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdjango\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconf\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msettings\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mregistration\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbackends\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdefault\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mviews\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mRegistrationView\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mapps\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mhome\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mviews\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mHomeView\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/registration/backends/default/views.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mregistration\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msignals\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mregistration\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodels\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mRegistrationProfile\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mregistration\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mviews\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mActivationView\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mBaseActivationView\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mregistration\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mviews\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mRegistrationView\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mBaseRegistrationView\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/registration/models.pyc\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 14\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdjango\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcontrib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mauth\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mget_user_model\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 15\u001b[1;33m \u001b[0mUser\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_user_model\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 16\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mImportError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 17\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdjango\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcontrib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mauth\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodels\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mUser\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/contrib/auth/__init__.pyc\u001b[0m in \u001b[0;36mget_user_model\u001b[1;34m()\u001b[0m\n\u001b[0;32m 125\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 126\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mImproperlyConfigured\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"AUTH_USER_MODEL must be of the form 'app_label.model_name'\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 127\u001b[1;33m \u001b[0muser_model\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_model\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mapp_label\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmodel_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 128\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0muser_model\u001b[0m \u001b[1;32mis\u001b[0m \u001b[0mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 129\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mImproperlyConfigured\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"AUTH_USER_MODEL refers to model '%s' that has not been installed\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0msettings\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mAUTH_USER_MODEL\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/db/models/loading.pyc\u001b[0m in \u001b[0;36mget_model\u001b[1;34m(self, app_label, model_name, seed_cache, only_installed)\u001b[0m\n\u001b[0;32m 269\u001b[0m \"\"\"\n\u001b[0;32m 270\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mseed_cache\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 271\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_populate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 272\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0monly_installed\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mapp_label\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapp_labels\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 273\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/db/models/loading.pyc\u001b[0m in \u001b[0;36m_populate\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 73\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mapp_name\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mhandled\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 74\u001b[0m \u001b[1;32mcontinue\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 75\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mload_app\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mapp_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 76\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnesting_level\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 77\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mapp_name\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpostponed\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/db/models/loading.pyc\u001b[0m in \u001b[0;36mload_app\u001b[1;34m(self, app_name, can_postpone)\u001b[0m\n\u001b[0;32m 97\u001b[0m \u001b[0mapp_module\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mimport_module\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mapp_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 98\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 99\u001b[1;33m \u001b[0mmodels\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mimport_module\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'%s.models'\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mapp_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 100\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mImportError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 101\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnesting_level\u001b[0m \u001b[1;33m-=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/utils/importlib.pyc\u001b[0m in \u001b[0;36mimport_module\u001b[1;34m(name, package)\u001b[0m\n\u001b[0;32m 38\u001b[0m \u001b[0mlevel\u001b[0m \u001b[1;33m+=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 39\u001b[0m \u001b[0mname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0m_resolve_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlevel\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpackage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 40\u001b[1;33m \u001b[0m__import__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 41\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodules\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/debug_toolbar/models.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mdt_settings\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPATCH_SETTINGS\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mdjango\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mVERSION\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m<\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m7\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mdt_settings\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpatch_all\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/debug_toolbar/settings.pyc\u001b[0m in \u001b[0;36mpatch_all\u001b[1;34m()\u001b[0m\n\u001b[0;32m 213\u001b[0m \u001b[0mpatch_internal_ips\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 214\u001b[0m \u001b[0mpatch_middleware_classes\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 215\u001b[1;33m \u001b[0mpatch_root_urlconf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/debug_toolbar/settings.pyc\u001b[0m in \u001b[0;36mpatch_root_urlconf\u001b[1;34m()\u001b[0m\n\u001b[0;32m 201\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdebug_toolbar\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 202\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 203\u001b[1;33m \u001b[0mreverse\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'djdt:render_panel'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 204\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mNoReverseMatch\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 205\u001b[0m \u001b[0murlconf_module\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mimport_module\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msettings\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mROOT_URLCONF\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36mreverse\u001b[1;34m(viewname, urlconf, args, kwargs, prefix, current_app)\u001b[0m\n\u001b[0;32m 501\u001b[0m \u001b[1;31m# Lookup the name to see if it could be an app identifier\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 502\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 503\u001b[1;33m \u001b[0mapp_list\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mresolver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapp_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mns\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 504\u001b[0m \u001b[1;31m# Yes! Path part matches an app in the current Resolver\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 505\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mcurrent_app\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mcurrent_app\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mapp_list\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36mapp_dict\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 327\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_language\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 328\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_app_dict\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 329\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_populate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 330\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_app_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlanguage_code\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 331\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36m_populate\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 265\u001b[0m \u001b[0mapps\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 266\u001b[0m \u001b[0mlanguage_code\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_language\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 267\u001b[1;33m \u001b[1;32mfor\u001b[0m \u001b[0mpattern\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mreversed\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murl_patterns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 268\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'_callback_str'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 269\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_callback_strs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_callback_str\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/home/k3/work/p/local/lib/python2.7/site-packages/django/core/urlresolvers.pyc\u001b[0m in \u001b[0;36murl_patterns\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 367\u001b[0m \u001b[0miter\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpatterns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 368\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 369\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mImproperlyConfigured\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"The included urlconf %s doesn't have any patterns in it\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0murlconf_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 370\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mpatterns\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 371\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mImproperlyConfigured\u001b[0m: The included urlconf pearl.urls doesn't have any patterns in it"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from django.conf import settings\n",
"from pearl import settings as s\n",
"print s, settings\n",
"if s == settings:\n",
" print 'same'\n",
"if hasattr(settings, 'PUBLIC_URLS'):\n",
" print settings.PUBLIC_URLS\n",
"from apps.accounts.middleware import EnforceLoginMiddleware\n",
"e = EnforceLoginMiddleware()\n",
"e.login_url\n",
"import re\n",
"[re.compile(url) for url in settings.PUBLIC_URLS]\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"<module 'pearl.settings' from 'pearl/settings.pyc'> <django.conf.LazySettings object at 0x7f1c64c45050>\n",
"('/', '/home/', '/home/faq/', '/accounts/register/', '/accounts/login/')\n"
]
},
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 6,
"text": [
"[re.compile(r'/'),\n",
" re.compile(r'/home/'),\n",
" re.compile(r'/home/faq/'),\n",
" re.compile(r'/accounts/register/'),\n",
" re.compile(r'/accounts/login/')]"
]
}
],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from pytz import all_timezones\n",
"#print all_timezones\n",
"from pytz import common_timezones\n",
"#print common_timezones\n",
"from pytz import common_timezones_set\n",
"#print common_timezones_set\n",
"from pytz import country_timezones\n",
"#print country_timezones\n",
"\n",
"import datetime\n",
"now = datetime.datetime.now()\n",
"print now\n",
"\n",
"from django.utils.timezone import utc\n",
"new_now = datetime.datetime.utcnow().replace(tzinfo=utc)\n",
"print new_now\n",
"\n",
"from django.utils import timezone\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"2014-07-26 07:21:15.118220\n",
"2014-07-26 07:21:15.118456+00:00\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.project.functions import json_data\n",
"json_data()\n",
"from apps.project.models import NewProject\n",
"n = NewProject.objects.all()\n",
"n0 = n[0]\n",
"\n",
"if n0.start_pocessing:\n",
" print 'start'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "json_data() takes exactly 1 argument (0 given)",
"output_type": "pyerr",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-10-6a05ba339ab3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mapps\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mproject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfunctions\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mjson_data\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mjson_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m: json_data() takes exactly 1 argument (0 given)"
]
}
],
"prompt_number": 10
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.project.models import NewProject\n",
"n = NewProject.objects.all()\n",
"n.delete()\n",
"print 'deleted all files'\n",
"\n",
"from apps.project.models import NewProject\n",
"NewProject.objects.create(\n",
" customer_id = 64,\n",
" name = 'test project',\n",
" description = 'asdf asdfjlas dflas dflas df',\n",
" file_type = 'fastq',\n",
" total_fastq_files = 2,\n",
" fastq_file1 = 'ftp://localhost/fastq_files/sample1.fastq.gz',\n",
" #fastq_file2 = 'ftp://localhost/fastq_files/sample2.fastq.bz2',\n",
")"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) DELETE FROM `project_newproject`; args=()\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) INSERT INTO `project_newproject` (`customer_id`, `name`, `description`, `file_type`, `vcf_file1`, `total_fastq_files`, `fastq_file1`, `fastq_file2`, `file_list`, `paired_end_distance`, `tissue`, `disease`, `status`, `start_processing`, `created_at`, `updated_at`) VALUES (64, 'test project', 'asdf asdfjlas dflas dflas df', 'fastq', '', 2, 'ftp://localhost/fastq_files/sample1.fastq.gz', '', '', NULL, '', '', 0, 0, '2014-07-29 12:04:19', '2014-07-29 12:04:19'); args=[64, 'test project', 'asdf asdfjlas dflas dflas df', 'fastq', u'', 2, 'ftp://localhost/fastq_files/sample1.fastq.gz', u'', u'', None, u'', u'', 0, False, u'2014-07-29 12:04:19', u'2014-07-29 12:04:19']\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"deleted all files\n"
]
},
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 9,
"text": [
"<NewProject: test project>"
]
}
],
"prompt_number": 9
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from apps.project.models import NewProject\n",
"n = NewProject.objects.all()\n",
"n.delete()\n",
"print 'deleted all files'"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) SELECT `project_newproject`.`id`, `project_newproject`.`customer_id`, `project_newproject`.`name`, `project_newproject`.`description`, `project_newproject`.`file_type`, `project_newproject`.`vcf_file1`, `project_newproject`.`total_fastq_files`, `project_newproject`.`fastq_file1`, `project_newproject`.`fastq_file2`, `project_newproject`.`file_list`, `project_newproject`.`paired_end_distance`, `project_newproject`.`tissue`, `project_newproject`.`disease`, `project_newproject`.`status`, `project_newproject`.`start_processing`, `project_newproject`.`created_at`, `project_newproject`.`updated_at` FROM `project_newproject`; args=()\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) DELETE FROM `project_projectreport` WHERE `project_projectreport`.`project_id` IN (23); args=(23,)\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"DEBUG:django.db.backends:(0.000) DELETE FROM `project_newproject` WHERE `id` IN (23); args=(23,)\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"deleted all files\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from urlparse import urlsplit\n",
"url = 'ftp://localhost/fastq_files/adf/asdf/sample1.fastq.gz'\n",
"urlsplit(url) \n",
"filename = url.split('/')[-1]\n",
"file_root = filename.split('.fastq')[0]\n",
"print file_root\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"sample1\n"
]
}
],
"prompt_number": 40
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from django.template import loader \n"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from os.path import relpath\n",
"relpath('asd12f','asdf/asdlf')\n",
"\n",
"from django.db import models\n",
"m = models.FileField()\n",
"\n",
"from pearl.settings import *\n",
"from pearl.settings import REPORT_DIR\n",
"print REPORT_DIR\n",
"print MEDIA_URL\n",
"print MEDIA_ROOT\n",
"\n",
"a =['asd','asd']\n",
"b = ['as','asd']\n",
"for i, j in a, b:\n",
" print i, j"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"media/Report/\n",
"media/\n",
"media\n",
"asd asd\n",
"as asd\n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"s = \"my string\"\n",
"print s\n",
"print s.zfill(70)\n",
"print s.ljust(70)\n",
"print s.rjust(70)\n",
"space = \"\"\n",
"a = 70 - len(s)\n",
"while a:\n",
" space += ' ' \n",
" a -= 1\n",
"print space + s\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"my string\n",
"0000000000000000000000000000000000000000000000000000000000000my string\n",
"my string \n",
" my string\n",
" my string\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def do_twice(f, name):\n",
" f(name)\n",
" f(name)\n",
"\n",
"def print_spam(name):\n",
" print name\n",
"\n",
"do_twice(print_spam, 'asdf')\n",
"\n",
"def do_four(f,v):\n",
" do_twice(f,v)\n",
" do_twice(f,v)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"asdf\n",
"asdf\n"
]
}
],
"prompt_number": 5
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment