tech stuff and scratch pad
Thursday, February 24. 2011
Python 2.4 2.5 2.6 and 2.7 Windows MySQLdb python installation
Let us save time on this very annoying mysqldb install for python. Its not working for me on Windows, Centos or anywhere. I need to get work done and googling around isn't helping much. I would rather just install it however and as long as it works we can get along..
So reminder to me for next time:
You can't install eggs and sources for any library from Python packages GO HERE
http://www.lfd.uci.edu/~gohlke/pythonlibs/ Installer.
Because googling will not help you find this link thanks to spam and "SEO" < < This is the place with other libraries as well so might come in handy if I get stuck again. There are some sites who copied from here and started to promote it etc. talk about a-holes.
back to practicals: In the link above simply search the page for MySQL-Python which is the official package name. Then find the right file by looking for python version (only difference is for amd64 but since thats a dead thing we can ignore those). I have used the mysqldb-python win32 for python 2.6 and python 2.7 on Vista and Windows 7 respectively without issues. for example the package name MySQL-python-1.2.3.win32-py2.6.exe means its MySQL-Python version 1.2.3 for ANY windows platform with python 2.6. Look for similar package.
I thank the maintainer and I hope he/she continues the good work.
p.s. I hate those [specially american] blogs that talk so much story and cock-a-dooodle instead of getting to the point. As soon as I read "I was eating my ... " when searching for mysqldb compile errors I know its a f*gg*ts blog.
So reminder to me for next time:
You can't install eggs and sources for any library from Python packages GO HERE
http://www.lfd.uci.edu/~gohlke/pythonlibs/ Installer.
Because googling will not help you find this link thanks to spam and "SEO" < < This is the place with other libraries as well so might come in handy if I get stuck again. There are some sites who copied from here and started to promote it etc. talk about a-holes.
back to practicals: In the link above simply search the page for MySQL-Python which is the official package name. Then find the right file by looking for python version (only difference is for amd64 but since thats a dead thing we can ignore those). I have used the mysqldb-python win32 for python 2.6 and python 2.7 on Vista and Windows 7 respectively without issues. for example the package name MySQL-python-1.2.3.win32-py2.6.exe means its MySQL-Python version 1.2.3 for ANY windows platform with python 2.6. Look for similar package.
I thank the maintainer and I hope he/she continues the good work.
p.s. I hate those [specially american] blogs that talk so much story and cock-a-dooodle instead of getting to the point. As soon as I read "I was eating my ... " when searching for mysqldb compile errors I know its a f*gg*ts blog.
Sunday, February 6. 2011
how to structure your django project
This is something I think about everytime I make a new django project. Instinctively it appears I do the right thing or maybe its just how django makes you think.
In essense you would want to create an app "creatapp" and think of it as module with the project.
For example I have category and subcategory for posts so I put them all in "Posts" app and in the same Model.py file.
But I may have categories in another app. Theoretically this is not a problem for django because you using a different app and there should be no conflict.
the problem for me personally is representation when I am coding or looking at DB. django does make tables list posts_category which helps. However I still want to be clear and avoid any confusion when using both Post and XX Categories in a 3rd app. To disambiguate I do this
MyProject/
- Posts/
-- models.py
- App2/
-- models.py
In Posts/ models.py I will have my classes named as follows
class PostCategory(...)
class PostSubcategory(...)
class Post(...)
I have noticed that I sometimes confuse myself and try to make too many Apps in the project thinking of every model as an app. Well I solve this problem using a mindmap. If you are making a vertical into any portion of your project then "its a App!" (reference to memebase). End of the day there is no right or wrong way, its entirely up to the dev. there are suggested methods based on experience. How you pack your bag is entirely up to you as long as you got everything you need in the bag.
In conclusion.
So each time you begin the quest, take note of the scrolls. its better not to carry too many scrolls but you don't want one scroll to be too fat. This will help you greatly if you have to face that french castle again. It will be easier to run if things go "south"
In essense you would want to create an app "creatapp" and think of it as module with the project.
For example I have category and subcategory for posts so I put them all in "Posts" app and in the same Model.py file.
But I may have categories in another app. Theoretically this is not a problem for django because you using a different app and there should be no conflict.
the problem for me personally is representation when I am coding or looking at DB. django does make tables list posts_category which helps. However I still want to be clear and avoid any confusion when using both Post and XX Categories in a 3rd app. To disambiguate I do this
MyProject/
- Posts/
-- models.py
- App2/
-- models.py
In Posts/ models.py I will have my classes named as follows
class PostCategory(...)
class PostSubcategory(...)
class Post(...)
I have noticed that I sometimes confuse myself and try to make too many Apps in the project thinking of every model as an app. Well I solve this problem using a mindmap. If you are making a vertical into any portion of your project then "its a App!" (reference to memebase). End of the day there is no right or wrong way, its entirely up to the dev. there are suggested methods based on experience. How you pack your bag is entirely up to you as long as you got everything you need in the bag.
In conclusion.
So each time you begin the quest, take note of the scrolls. its better not to carry too many scrolls but you don't want one scroll to be too fat. This will help you greatly if you have to face that french castle again. It will be easier to run if things go "south"
Sunday, January 23. 2011
django from decorator import decorator ImportError: No module named decorator
I ran into this problem and luckily i found out why.
the decorator needs to be installed to your site-packages using "python setup.py" install method.
you can download the latest decorator package here http://pypi.python.org/simple/decorator/
off-topic
I am making too many django posts haha.I am considering making a new category for it under python. But then again its only a matter of time things get our of hand with twisted, cherrypy etc etc.
the decorator needs to be installed to your site-packages using "python setup.py" install method.
you can download the latest decorator package here http://pypi.python.org/simple/decorator/
off-topic
I am making too many django posts haha.I am considering making a new category for it under python. But then again its only a matter of time things get our of hand with twisted, cherrypy etc etc.
« previous page
(Page 2 of 4, totaling 10 entries)
» next page
Search
The book that helped me most in my first Django production project
Calendar
|
|
May '12 | |||||
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
Categories
Archives
Syndicate This Blog
Top Referrers
www.google.com (277)
www.cosmosonline.ru (183)
www.ayzek.ru (129)
ladies-world.ru (123)
full-version.net (116)
tv-vision.ru (102)
vinnica.info (102)
teloperator.com (100)
www.mega-ka4ka.ru (91)
www.preconception.ru (89)
www.cosmosonline.ru (183)
www.ayzek.ru (129)
ladies-world.ru (123)
full-version.net (116)
tv-vision.ru (102)
vinnica.info (102)
teloperator.com (100)
www.mega-ka4ka.ru (91)
www.preconception.ru (89)
Last Search (Google, Yahoo, Bing, Scroogle)
© Copyright 2006, nerdwg.org design by Luka Cvrk, port for s9y by nerdwg.org
