Strange Error Dell

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, December 17, 2012

Introducing django and mysql

Posted on 6:08 AM by Unknown
I wanted to do some rapid prototyping with web applications, and decided to give python and django a go. There are various tutorials out there, but none of them seem to focus on using existing database structures and views.

So this is primarily to document my own findings. If someone else finds it useful: be my guest. ;-)



1. URL configs

These serve as the entry point to django from the web-browser's point of view. You can specify regex's and assign django views. The simplest one is probably this one:
urlpatterns = patterns('',
url(r'^$', views.index, name='index')
)
For those that are regular-expresionally challenged, this regex matches an empty url. It looks for start of line immediately followed by end of line.


2. views

These views can be simple functions that return a HttpResponse, or more sophisticated classes. The simplest one is probably this one:
def index(request):
return HttpResponse("Hello, world.")
This view always returns the text "Hello, world.". Yes, it really is that simple. There isn't even HTML code required. Most browsers will just render this text anyway.

3. manage.py syncdb

If you start out with an empty DB, you can use django to create it for you. You just need to define the data model in django. If you use multiple models with relationships, like in the excellent django tutorial here, you might wonder about foreign keys if you use MySQL. At least if InnoDB isn't your default storage engine. Fear not, one can easily tell django to use InnoDB anyway, by adding this to your settings.py file in the DATABASES section:
'OPTIONS': {
"init_command": "SET storage_engine=INNODB",

 

4. manage.py inspectdb

Everyone knows that django can create a DB schema according to a python model. This is very nice, but quite often you are presented with a pre-existing DB schema. In tha case, just run "python manage.py inspectdb". This will churn out a python model according to the DB schema. I've tried it with MySQL on MyISAM and InnoDB alike. It works better with InnoDB because it supports foreign keys. Of course it won't make a difference if your schema doesn't actually have any. ;-)




Read More
Posted in django, python, web | No comments

Oracle OMS Agent migration

Posted on 5:33 AM by Unknown
I've recently migrated a few Oracle databases to Enterprise Manager 12c. While this is worth a few posts on it's own, here's just a quick hint of how to update the IP/hostname of an agent after it's been registered at OEM.

First, verify that the agent is responding to requests, by navigating to the new IP/host with your browser:
https://my.new_server.lan:3872/emd/main/
Then log on to the OEM repository DB as sysman. The table MGMT_TARGETS holds all the juicy agent details. Just update the column EMD_URL with the new value, and everything is fine.
For instance
update mgmt_targets set emd_url=replace(emd_url,'my.server.lan','my.new_server.lan')  where target_name like '%my.server.lan%';
Verify your changes in the view MGMT$TARGET.
Finally the agent should be available in Setup - Agents at once. I then resync'd the agent from EMS, and secured the agent. All targets were up and running without issues then.

Read More
Posted in agent, oem, oms, oracle | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • trac-0.12.3 and HTML notification
    Trac still does not do HTML mails. As I've written before , it can be hacked to send good looking HTML notifications, though. I happily...
  • CollabNet Subversion Edge 4.0 with SSPI WSGI and trac
    CollabNet released Subversion Edge 4.0 recently, as they've written here . As you know I've been using this to host our Subversi...
  • TortoiseSVN with kerberos authentication
    I'm a big fan of TortoiseSVN (TSVN, short) on Windows. Working with multiple SVN servers and different authentication methods has its p...
  • trac and HTML notifications
    Hacking Trac Of course I used a modified trac 0.10 before, so there were some features I wanted to keep. The most important one are HTML no...
  • TortoiseSVN 1.8.0 and NTLM Authentication on Windows
    Subversion 1.8.0 was released recently, and my favorite svn client was updated , too. I had hoped this update to go down smooth, just like...
  • Meme
    Grab the nearest book. Open it to page 56. Find the fifth sentence. Post the text of the sentence in your journal along with these instructi...
  • Logitech Media Server & MySQL
    Logitech, in their infinite wisdom, has decided to rename slimserver to SqueezeCenter then Squeezebox Server and finally Logitech Media S...
  • Seconal And Nembutal I Am On Seconal And Nembutal...?
    I am on Seconal and Nembutal...? - seconal and nembutal Seconal and Nembutal, I think, in the morning, afternoon and evening to help sleep b...
  • XenServer and Dell OMSA - addendum
    As I've written here it is indeed possible to install Dell OMSA on a XenServer 5.6 host without DDK. I've taken a brand new Dell R71...
  • SQL Server Update Woes
    There are various issues that can happen when trying to update SQL Server. For almost all there are workarounds, and they usually work well....

Categories

  • .net framework 1.1
  • .nk2
  • active directory
  • agent
  • angel eyes
  • apache
  • apple iphone
  • authentication
  • autocomplete
  • bandwidth
  • bash
  • BD390
  • bmw
  • bmw diy
  • c#
  • cab
  • can't add http network place fix
  • ccfl
  • CE
  • centos
  • cisco
  • citrix
  • collabnet
  • computers
  • configuration
  • corrupt user profile
  • debian
  • debug
  • dell
  • device
  • diff
  • django
  • dotnetfx
  • driver
  • e36
  • edge
  • embedded
  • FAN
  • firefly
  • fix
  • gregarius
  • hid/xenon
  • hid/xenon conversion
  • hooks
  • hot-plug
  • html notifications
  • http network place
  • import
  • intel
  • interface
  • internet
  • ios
  • iperf
  • iperf windows centos monit
  • iphone driver fix
  • ipmi
  • iscsi
  • java
  • jdk
  • KB2494113
  • kb953297
  • kerberos
  • linux
  • logitech
  • lost desktop
  • lost documents
  • lost icons
  • lost shortcuts
  • lost user files
  • microsoft
  • microsoft exchange
  • mod_auth_kerb
  • mod_auth_sspi
  • mod_authnz_sspi
  • mod_wsgi
  • monit
  • msvc
  • mtb usb driver
  • multipath
  • mysql
  • nagios
  • NAS
  • network
  • nickname cache
  • not installed
  • not successful
  • nslu2
  • ntlm
  • oem
  • oms
  • omsa
  • openmediavault
  • oracle
  • OTRS
  • outlook
  • outlook 2007
  • outlook 2010
  • patch
  • perl
  • preparing desktop
  • pygments
  • python
  • queue servicing report
  • rancid
  • regedit
  • registry
  • single sign on
  • slimserver
  • smtp
  • snmp
  • software
  • solution
  • sql
  • sql server
  • sqldeveloper
  • sqlite
  • squeeze
  • squeezebox
  • squeezecenter
  • ss4200
  • ssh
  • ssl
  • sspi
  • subversion
  • svn
  • trac
  • uclinux
  • updates
  • upgrade
  • upgrading
  • usb
  • user profile
  • visual studio 2008
  • web
  • webclient service
  • windows
  • windows 7
  • windows update
  • windows vista
  • windows xp
  • wireless
  • wizd
  • x64
  • xenserver

Blog Archive

  • ►  2013 (8)
    • ►  July (2)
    • ►  June (1)
    • ►  April (1)
    • ►  March (3)
    • ►  January (1)
  • ▼  2012 (8)
    • ▼  December (2)
      • Introducing django and mysql
      • Oracle OMS Agent migration
    • ►  September (1)
    • ►  May (1)
    • ►  March (2)
    • ►  February (2)
  • ►  2011 (10)
    • ►  December (2)
    • ►  September (3)
    • ►  August (1)
    • ►  July (1)
    • ►  May (2)
    • ►  April (1)
  • ►  2010 (25)
    • ►  December (2)
    • ►  November (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (2)
    • ►  April (1)
    • ►  February (15)
    • ►  January (2)
  • ►  2009 (13)
    • ►  December (2)
    • ►  November (1)
    • ►  July (1)
    • ►  May (1)
    • ►  March (4)
    • ►  February (4)
  • ►  2008 (5)
    • ►  December (4)
    • ►  November (1)
Powered by Blogger.

About Me

Unknown
View my complete profile