Thursday, August 5, 2010

Another working day in IT

Another day in IT.

[100805 11:47]
PyCharm/Django...created index html file '/templates/index.html'.
...not found but nice error message from Django (I think) about regexes
tested. added line in file:

(r'.*', include(,

after dimissing a PyCharm internal error, /index.html shows; stacktrace at (configged to auto-open in browser, nice):

File "/Library/Python/2.5/site-packages/django/db/backends/dummy/", line 15, in complain
raise ImproperlyConfigured("You haven't set the database ENGINE setting yet.")

so it accesses DB even tho the index.html has _nothing_ django-specific? or
does it simply check config always?

[100805 12:18]
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'ppmondj', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

[100805 12:28]
well..., G->

calling easy_install -Z mysql_python from the command prompt, finds the
egg on the net and installs it.

[100805 12:30]
$ easy_install -Z mysql_python
Searching for mysql-python
Best match: MySQL-python 1.2.3
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3/ -q bdist_egg --dist-dir /var/folders/yS/ySwzLqWTFJiTPleKRiIU7U+++TI/-Tmp-/easy_install-oUgb6M/MySQL-python-1.2.3/egg-dist-tmp-KpbQZ0
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
zip_safe flag not set; analyzing archive contents...
Adding MySQL-python 1.2.3 to easy-install.pth file

Installed /Library/Python/2.5/site-packages/MySQL_python-1.2.3-py2.5-macosx-10.5-i386.egg
Processing dependencies for mysql-python
Finished processing dependencies for mysql-python

[100805 12:31]
still no go in PyCharm. wt*. console:

ImportError: dlopen(/Library/Python/2.5/site-packages/MySQL_python-1.2.3-py2.5-macosx-10.5-i386.egg/, 2): no suitable image found. Did find:
/Library/Python/2.5/site-packages/MySQL_python-1.2.3-py2.5-macosx-10.5-i386.egg/ mach-o, but wrong architecture

[100805 12:34]
G " mach-o, but wrong architecture" ->

"In all of Mac-dom, there are few experiences more painful than trying
to get Python tools to talk to a MySQL database" ... "But try to get up
and running with Django, TurboGears, or any other Python package where
MySQL database access could be useful (or needed), and you’re in for a
world of hurt."


-- EDIT --
Trying the '/opt/local/bin/port install py25-mysql' route. Takes forever, so blog-time, or lunch time perhaps. "Ironically", I didn't really want to use a DB right now, just get a site for some test/monitoring up quickly. 
On Mac OS X 10.5, zlib 1.2.5 requires Xcode 3.1 or later but you have Xcode 3.0. Error: Target org.macports.extract returned: incompatible Xcode version Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/main.log Error: Problem while installing zlib Error: Unable to execute port: upgrade python25 failed 

-- Somewhat Later Still --

Re: Xcode 3.0 -> 3.1 or 3.1.1 upgrade

Posted: Nov 6, 2008 5:51 PM in response to: spiderpig


Nope. You have to download the whole thing all over again. Maybe someday Apple will actually implement updates for XCode. Then again, how many years have we been begging for that feature?

-- even later that day --

Used the sqlite3 (built in to Django, it seems). Lesson I never seem to really learn: do the simplest thing possible when trying a new product. Use the default project, don't change one letter. Don't be tempted for a second to think like "I'll just try this instead, I've already got mysql, so I'll just try that, and just run the thing". I've heard Django being touted for it's very mature, high-quality docs, so that should have been the starting point. In my defence, the file did not have the sqlite3 DB name filled in, so you actually had to change the letter. The again, doc says: "If you're new to databases, we recommend simply using SQLite (by setting ENGINE to 'django.db.backends.sqlite3')." They could've said "If you've new to Django"...

[100805 16:35]


python startapp monitor

nice, created what I suppose is a site folder.

not-so-nice: '' shows error. Seems it didn't

add anything to the file; that could be the problem.

--- quarter-to-sixish ---

Perhaps best to wrap up this thing a little...

I didn't intend it to be an all-day thing -- but why not; just intended to give a little glimpse of the fun-funnery involved in computer work.

It's not all bad, especially in such a nice office space and office people that I have the luck to be working in.

And you learn eventually. For instance how to set up a Django project. to go, more later.

No comments:

Post a Comment