views:

27

answers:

1

I'm using Git to push my code from my development machine to my testing server.

  • Dev: Mac, Python 2.6, sqllite and
  • Test: Linux, Python 2.7, MySQL

I took an early dev database and exported it to MySQL for initial testing.

So now I'm regularly pushing new code to the testing server. In general it seems to be working well, but I'm getting an Integrity Error regarding multiple objects with same Primary Key occasionally.

Does this ring any bells at this point? Is there something inherently wrong with the setups? Obviously there are some configuration differences for instance Python 2.6 and 2.7. So if there were issues here, I was hoping somebody could target them before I try some platform config syncing.

Thanks!

+1  A: 

I'm not able to answer this question directly.

Depending on the reasons why you have used a different Python environment for your testing server, there are a few options:

First, if you want to test to see whether your code functions in multiple environments, I recommend you look into py.test. It has support for distributed testing. This includes providing the ability to create a virtualenv for each Python version that you wish to test.

Once you've done this, it will easier to tell whether your code, Django core or whether MqSQL is at fault. My suspicion is that there may be a problem with the database abstraction. It looks like sqllite is being tolerant but MySQL is not.

Secondly, it may be worthwhile to look into virtualenv yourself. This creates a standalone Python environment that makes replicating your dev setup much simpler.

Tim McNamara
Will investigate. Thanks for noting your suspicions!
iJames