<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8079526900440233210</id><updated>2011-09-28T16:16:43.440-07:00</updated><category term='Python'/><category term='jQuery'/><category term='Ruby on Rails'/><category term='MySQL'/><category term='CSS'/><category term='Ruby'/><category term='MySqldb'/><category term='Pylons'/><title type='text'>The Pylons["Development"] = Blog</title><subtitle type='html'>A blog covering Pylons web development, advanced CSS, jQuery, Thrift, the Tornado WebServer, and Load Balancing</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-3063194670328454140</id><published>2010-07-31T14:38:00.000-07:00</published><updated>2010-07-31T14:40:21.513-07:00</updated><title type='text'>How to validate an email address using JavaScript?</title><content type='html'>Quick and easy:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; function isValidEmail(str) {&lt;br /&gt;   return (str.indexOf(".") &gt; 2) &amp;&amp; (str.indexOf("@") &gt; 0);&lt;br /&gt; }&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-3063194670328454140?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/3063194670328454140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/how-to-validate-email-address-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/3063194670328454140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/3063194670328454140'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/how-to-validate-email-address-using.html' title='How to validate an email address using JavaScript?'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-6900982325602216714</id><published>2010-07-27T14:25:00.001-07:00</published><updated>2010-07-27T14:26:54.363-07:00</updated><title type='text'>A Support Vector Machine (SVM)  is a Neural Network</title><content type='html'>&lt;blockquote&gt;"A SVM model using a sigmoid kernel function is equivalent to a two-layer, perceptron neural network"&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;- &lt;a href="http://www.dtreg.com/svm.htm"&gt;www.DTREG.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-6900982325602216714?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/6900982325602216714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/support-vector-machine-svm-is-neural.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6900982325602216714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6900982325602216714'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/support-vector-machine-svm-is-neural.html' title='A Support Vector Machine (SVM)  is a Neural Network'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-5391651544183584728</id><published>2010-07-18T17:31:00.000-07:00</published><updated>2010-07-18T17:33:15.342-07:00</updated><title type='text'>AttributeError: 'thread._local' object has no attribute 'mapper'</title><content type='html'>If you are seen this error when trying to use routes.url_for, its because as of Pylons 1.0, routes.url_for as been depreciated. You should now be using pylons.url() instead.&lt;br /&gt;&lt;br /&gt;To fix this problem in a controller or template, do the following&lt;br /&gt;&lt;br /&gt;1) in ./lib/helpers.py:&lt;br /&gt;&lt;br /&gt;from pylons import url&lt;br /&gt;&lt;br /&gt;2) replace all h.url_for() with h.url()&lt;br /&gt;&lt;br /&gt;Your problem should go away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-5391651544183584728?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/5391651544183584728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/attributeerror-threadlocal-object-has.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5391651544183584728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5391651544183584728'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/attributeerror-threadlocal-object-has.html' title='AttributeError: &apos;thread._local&apos; object has no attribute &apos;mapper&apos;'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-5700529762997460812</id><published>2010-07-18T16:18:00.001-07:00</published><updated>2010-07-18T17:31:02.028-07:00</updated><title type='text'>Forms In Pylon</title><content type='html'>Should you use a GET or POST in your form?&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"As you can see, the request method (in the first line of both figures) is different in each. You’ll also see that the POST request has the e-mail address sent as extra content in the body rather than as part of the URL. It is possible to send very large amounts of data in the request body, but most browsers and servers can cope only with URLs that are less than 1,024 characters in length. This is why if you are using a file upload field, you should use the POST method, because the data is then sent in the body of the request."&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"If you are writing forms that contain password fields, you should usually use POST to prevent the password from being visible to anyone who might be looking at the user’s screen. If you are ever in any doubt as to which method to use in a particular circumstance, it is normally safer to use POST."&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"When writing form-based applications, you will occasionally find that users will press Refresh immediately after submitting a form. This has the effect of repeating whatever actions were performed the first time the form was submitted, but this might not always be the behavior your users expect.&lt;br /&gt;&lt;br /&gt;If your form was submitted with a POST, most browsers will display a message to the user asking them whether they want to resubmit the data (see Figure 6-3). This will not happen with a GET, so POST is preferable to GET in those circumstances."&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-5700529762997460812?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/5700529762997460812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/forms-in-pylon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5700529762997460812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5700529762997460812'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/forms-in-pylon.html' title='Forms In Pylon'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-298619349756035675</id><published>2010-07-17T11:57:00.000-07:00</published><updated>2010-07-17T12:11:32.982-07:00</updated><title type='text'>Setting Up The Pylons Virtual Environment</title><content type='html'>The standard way to install Pylons is via the virtual environment. From the Pylons book:&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;blockquote&gt;&lt;em&gt;The virtual Python environment&lt;/em&gt; is an isolated Python installation  set up in such a way that the libraries it contains do not affect  programs outside it, making it a good choice for experimenting with new  packages or deploying different programs with conflicting library  requirements. You can also create a virtual Python environment and  install software to it without requiring root or administrator  privileges, making it a very useful technique for installing Pylons in a  shared environment. &lt;em&gt;It is highly recommended you  install Pylons  this way if it’s your first time using it.&lt;/em&gt;&lt;/blockquote&gt;&lt;em&gt;&lt;/em&gt;Here are the steps to setting up a virtual environment:&lt;br /&gt;&lt;br /&gt;1)  Download the &lt;a href="http://pylonsbook.com/virtualenv.py"&gt;virtualenv.py&lt;/a&gt; script.&lt;br /&gt;&lt;br /&gt;2) Run the command 'python virtualenv.py --no-site-packages [ENV_NAME]'.&lt;br /&gt;&lt;br /&gt;3) cd into  [ENV_NAME]/bin and execute easy_install pylons&lt;br /&gt;&lt;br /&gt;4) cd ../&lt;br /&gt;&lt;br /&gt;5) paster create -t pylons MyFirstProject&lt;br /&gt;&lt;br /&gt;if this command produces an error like the following:&lt;br /&gt;&lt;br /&gt;pkg_resources.DistributionNotFound: nose&gt;=0.10.4&lt;br /&gt;&lt;br /&gt;then you need to use easy_install to install the nose module as follows&lt;br /&gt;&lt;br /&gt;python ./bin/easy_install nose&lt;br /&gt;&lt;br /&gt;6) finally activate your virtual environment:&lt;br /&gt;&lt;br /&gt;source ./bin/activate&lt;br /&gt;&lt;br /&gt;Now, lets see if we can stand up the paste server&lt;br /&gt;&lt;br /&gt;7) cd MyFirstProject&lt;br /&gt;&lt;br /&gt;8) setup your development environment via 'python setup.py develop'&lt;br /&gt;&lt;br /&gt;9) paster serve --reload development.ini&lt;br /&gt;&lt;br /&gt;Done ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-298619349756035675?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/298619349756035675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/setting-up-pylons-virtual-environment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/298619349756035675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/298619349756035675'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/setting-up-pylons-virtual-environment.html' title='Setting Up The Pylons Virtual Environment'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-6430204328735912752</id><published>2010-07-13T20:11:00.001-07:00</published><updated>2010-07-13T20:34:03.463-07:00</updated><title type='text'>Connecting to a MySQL database using SQLAlchemy</title><content type='html'>Pylons uses &lt;a href="http://www.sqlalchemy.org/"&gt;SQLAlchemy&lt;/a&gt; by default, but before we start building models in a Pylons project, lets see if we can connect to  MYSQL database from a regular python script....&lt;br /&gt;&lt;br /&gt;First step, lets make sure you have a MYSQL server running on your machine. I am developing on a MAC, so go look for the mysqld process in your Activity Monitor:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XsHxjvWkGZI/TD0sQbDbiaI/AAAAAAAAArc/qf4r_4ZLjeE/s1600/Picture+6.png"&gt;&lt;img style="cursor: pointer; width: 387px; height: 174px;" src="http://4.bp.blogspot.com/_XsHxjvWkGZI/TD0sQbDbiaI/AAAAAAAAArc/qf4r_4ZLjeE/s400/Picture+6.png" alt="" id="BLOGGER_PHOTO_ID_5493595781113547170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If you have the mysqld process, your good to go because you have a server up and running. I believe OSX starts this server at boot by default. If, for some reason, you do not have the server running, please following these instructions to get it up and running before moving on:&lt;br /&gt;&lt;br /&gt;http://developer.apple.com/internet/opensource/osdb.html&lt;br /&gt;&lt;br /&gt;Next, lets connect to the database using the open-source tool &lt;a href="http://www.sequelpro.com/"&gt;Sequel Pro&lt;/a&gt;. Connect via the standard tab, and set your host to the local ip address 127.0.0.1, your username to root, and keep the password blank. Use the default port setting of 3306 also. Unless you have explicitly set the root password for your SQL server, your password is blank by default.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XsHxjvWkGZI/TD0sUtUvGRI/AAAAAAAAArk/3m2amjJSXrw/s1600/Picture+5.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 264px;" src="http://1.bp.blogspot.com/_XsHxjvWkGZI/TD0sUtUvGRI/AAAAAAAAArk/3m2amjJSXrw/s400/Picture+5.png" alt="" id="BLOGGER_PHOTO_ID_5493595854737447186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After you connect to the server successfully, create a new database called "mydatabase". In the database, create a single table called "mytable" and add one column to the table of type varchar(50). The column (attribute) should be called "name". Add three names to the table. You should have something like this when you are finished?&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XsHxjvWkGZI/TD0uTcMeesI/AAAAAAAAArs/YtPp6NamnaY/s1600/Picture+7.png"&gt;&lt;img style="cursor: pointer; width: 287px; height: 223px;" src="http://3.bp.blogspot.com/_XsHxjvWkGZI/TD0uTcMeesI/AAAAAAAAArs/YtPp6NamnaY/s400/Picture+7.png" alt="" id="BLOGGER_PHOTO_ID_5493598031982787266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now everything is setup, lets create the python script to connect to your database, execute a simple query, and then display the results of that query to the terminal. First things first, you need to import the SQLAlchemy package into your namespace so you can use the module:&lt;br /&gt;&lt;br /&gt;from sqlalchemy import *&lt;br /&gt;&lt;br /&gt;Next, use the create_engine function to connect to your new database. SQLAlchemy using the following format for connect to MYSQL databases:&lt;br /&gt;&lt;br /&gt;'mysql://username:password@serverlocation/mysqldb_databasename?charset=utf8&amp;amp;'&lt;br /&gt;use_unicode=0'&lt;br /&gt;&lt;br /&gt;Following this format, our connection call will look something like this:&lt;br /&gt;&lt;br /&gt;engine = create_engine('mysql://root@localhost/mydatabase?charset=utf8&amp;amp;use_unicode=0', pool_recycle=3600)&lt;br /&gt;connection = engine.connect()&lt;br /&gt;&lt;br /&gt;Notice I am leaving off the password section of the string because our password is blank. I had to try a few different methods before I figure out this is how you get the connection to work successfully.&lt;br /&gt;&lt;br /&gt;If your current script executes without an error, you are successfully connecting to your database. The final step is to execute a query and display the results. Lets just display all of the names in the mytable table using a SQL SELECT statement:&lt;br /&gt;&lt;br /&gt;result = engine.execute("select name from mytable")&lt;br /&gt;for row in result:&lt;br /&gt;  print "name:", row['name']&lt;br /&gt;result.close()&lt;br /&gt;&lt;br /&gt;Execute the script one last time and you should see the contents of your name column printed to your terminal. Note: I have no clue how to do this on Windows, and if your serious about building a website, you should be using a MAC anyways.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XsHxjvWkGZI/TD0wG0nz-sI/AAAAAAAAAr0/JJ2k9nx-E2k/s1600/Picture+8.png"&gt;&lt;img style="cursor: pointer; width: 157px; height: 73px;" src="http://2.bp.blogspot.com/_XsHxjvWkGZI/TD0wG0nz-sI/AAAAAAAAAr0/JJ2k9nx-E2k/s400/Picture+8.png" alt="" id="BLOGGER_PHOTO_ID_5493600014224849602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-6430204328735912752?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/6430204328735912752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/connecting-to-mysql-database-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6430204328735912752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6430204328735912752'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/connecting-to-mysql-database-using.html' title='Connecting to a MySQL database using SQLAlchemy'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XsHxjvWkGZI/TD0sQbDbiaI/AAAAAAAAArc/qf4r_4ZLjeE/s72-c/Picture+6.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-6926650141544505166</id><published>2010-07-13T18:59:00.000-07:00</published><updated>2010-07-13T19:15:35.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MySqldb'/><title type='text'>Error Trying To Import MySQLdb</title><content type='html'>Well, I didn't take long to hit an error. I was going through the QuickWiki [as of today 7.13.10 this tutorial is so our of date its not worth attempting] tutorial on the Pylons site to try to get some basic database functionality working as a proof-of-concept for myself when I see the following error:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;   load_environment(conf.global_conf, conf.local_conf)&lt;br /&gt; File "/Users/josephmisiti/Downloads/mydevenv/MyBlog/myblog/config/environment.py", line 48, in load_environment&lt;br /&gt;   engine = engine_from_config(config, 'sqlalchemy.')&lt;br /&gt; File "/Users/josephmisiti/Downloads/mydevenv/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/__init__.py", line 241, in engine_from_config&lt;br /&gt;   return create_engine(url, **opts)&lt;br /&gt; File "/Users/josephmisiti/Downloads/mydevenv/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/__init__.py", line 223, in create_engine&lt;br /&gt;   return strategy.create(*args, **kwargs)&lt;br /&gt; File "/Users/josephmisiti/Downloads/mydevenv/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/strategies.py", line 62, in create&lt;br /&gt;   dbapi = dialect_cls.dbapi(**dbapi_args)&lt;br /&gt; File "/Users/josephmisiti/Downloads/mydevenv/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/databases/mysql.py", line 1456, in dbapi&lt;br /&gt;   import MySQLdb as mysql&lt;br /&gt; File "build/bdist.macosx-10.5-i386/egg/MySQLdb/__init__.py", line 19, in &lt;module&gt;&lt;br /&gt; File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in &lt;module&gt;&lt;br /&gt; File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in __bootstrap__&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ImportError: dynamic module does not define init function (init_mysql)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/module&gt;&lt;/module&gt;&lt;/em&gt;To make sure this not an isolated problem in your Pylons framework, open up the terminal and type the following&lt;br /&gt;&lt;br /&gt;python&lt;br /&gt;&gt;&gt;&gt;import MySQLdb&lt;br /&gt;&lt;br /&gt;If you see the following error, continue reading, else I recommend installing the python module in your Pylon's virtual environment via 'easy_install.py MySQLdb'.&lt;br /&gt;&lt;br /&gt;I am currently running OSX Leaport 10.5.8, and it appears that I had somehow accidently installed MySQL 5 for version 10.6 with 64-bit libraries. This is a problem because the MySQLdb is looking for 32-bit libraries and it seems to be causing this import error. For more information on the problem, please read the following comments in this link:&lt;br /&gt;&lt;br /&gt;http://www.davidcramer.net/code/57/mysqldb-on-leopard.html&lt;br /&gt;&lt;br /&gt;To fix the problem, I first uninstalled the MySQL on my MAC using the following procedure:&lt;br /&gt;&lt;br /&gt;http://tomkeur.net/39/how-to-remove-mysql-completely-mac-os-x-leopard.html&lt;br /&gt;&lt;br /&gt;For some reason, the mysql on my machine was no located in /usr/local/bin so I did a&lt;br /&gt;&lt;br /&gt;find / -name "mysql5" -print 2&gt; /dev/null&lt;br /&gt;&lt;br /&gt;and deleted every single mysql search path that was returned from this query.&lt;br /&gt;&lt;br /&gt;After I successfully uninstalled MySQL, I went to the mysql site and downloaded the correct package: MySQL 5.* 10.5.8 x86 and reinstalled the package via these instructions:&lt;br /&gt;&lt;br /&gt;http://developer.apple.com/internet/opensource/osdb.html&lt;br /&gt;&lt;br /&gt;After confirming that the installation was successful, I downloaded a new version of MySQLdb, unpacked it, and did a cd into the directory and executed the following commands&lt;br /&gt;&lt;br /&gt;sudo python setup.py clean - remove all the current versions&lt;br /&gt;sudo python setup.py install&lt;br /&gt;&lt;br /&gt;Everything build and installed correctly, and I confirmed everything was working via the:&lt;br /&gt;&lt;br /&gt;python&lt;br /&gt;&gt;&gt;&gt;import MySQLdb&lt;br /&gt;&lt;br /&gt;command.&lt;br /&gt;&lt;br /&gt;Good luck with this issue, and I hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-6926650141544505166?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/6926650141544505166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/error-trying-to-import-mysqldb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6926650141544505166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/6926650141544505166'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/error-trying-to-import-mysqldb.html' title='Error Trying To Import MySQLdb'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8079526900440233210.post-5828627040222082661</id><published>2010-07-13T18:52:00.000-07:00</published><updated>2010-07-13T18:58:33.613-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby on Rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Pylons'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Welcome To The Pylons Development Blog</title><content type='html'>Hello,&lt;br /&gt;&lt;br /&gt;Welcome to my Pylons development blog. I just starting a huge project which is going to be developed using mostly the Pylons web framework. I am going to blog all of the problems that I encounter, the solutions I found I used, and general information regarding the framework, the modules, or Python in general.&lt;br /&gt;&lt;br /&gt;A little background. I have a BS in Electrical Engineering and an MS in Applied Mathematics. My expertise in machine learning, computer vision, and data mining. I am have recently begun development on a new web service which I plan on turning into a company. When the idea is finished I plan on providing a link.&lt;br /&gt;&lt;br /&gt;I attempted to use Ruby on Rails for three months before moving to Pylons. I choose to switch because:&lt;br /&gt;&lt;br /&gt;1) I absolutely hate ruby&lt;br /&gt;2) I thought the rails framework was confusing and weird&lt;br /&gt;3) I love python, and Pylons is using MVC&lt;br /&gt;&lt;br /&gt;I was having a tough time deciding between Pylons &amp;amp; Django, but in the end I chose Pylons because it seemed like the framework was more dynamic, and I could add/remove pieces I no longer need.&lt;br /&gt;&lt;br /&gt;I also plan on posting solutions to jQuery and CSS, because I am doing front-end development also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8079526900440233210-5828627040222082661?l=pylonsdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pylonsdevelopment.blogspot.com/feeds/5828627040222082661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/welcome-to-pylons-development-blog.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5828627040222082661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8079526900440233210/posts/default/5828627040222082661'/><link rel='alternate' type='text/html' href='http://pylonsdevelopment.blogspot.com/2010/07/welcome-to-pylons-development-blog.html' title='Welcome To The Pylons Development Blog'/><author><name>Francis Begbie</name><uri>http://www.blogger.com/profile/02326727319124409831</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
