Code Monkey home page Code Monkey logo

Comments (8)

selwin avatar selwin commented on July 17, 2024

Hi there, I tested the migrations on a fresh project and it seems to work ok. If you're upgrading from older version of post-office, you'll actually need to do two things:

  1. Upgrade post-office to 1.0 and apply all migrations (using south) to make sure your DB is up to date
  2. Upgrade to Django 1.7
  3. Install post-office 1.1 (I released this on PyPI just now).

Let me know if that fixes your problem.

from django-post_office.

garry-cairns avatar garry-cairns commented on July 17, 2024

Hi, thanks for the reply. I've applied the 1.0 migrations with South to my existing production DB, which is using Django 1.5. I then copied that DB with createdb -O ownername -T originaldb newdb, where newdb is a fresh copy of the database I'm using to upgrade the app.

With post_office commented out of my settings migrations apply to the new DB as expected. With post_office (now 1.1) installed and in settings then interesting things happen. Firstly, I get the same error message as before when applying migrations — the second error trace above. Secondly, I now get that error when trying to run the test client (presumably because it needs to create a database). The same error even appears when I try to migrate another app, with no dependence on post_office on its own. But when I start up a browser and use my site both the site and the post_office app itself work perfectly. This only seems to affect migrations.

I wondered whether this might even be a Django/Python 3.4 issue but the release notes suggest they're compatible.

I'll try tweaking some things in the post_office migration to see if it helps.

from django-post_office.

garry-cairns avatar garry-cairns commented on July 17, 2024

Okay, taking the error message as my hint, I changed all the byte strings in the migration file to ordinary strings. The migrations now apply and everything works as expected. My test suite runs and all tests that rely on post_office pass. Would you take a pull request for this or would the change I'm making there break other things?

from django-post_office.

selwin avatar selwin commented on July 17, 2024

Hi there, yes, I would welcome a PR for that. Thanks for the offer :).

I think a good first step would be to modify .travis.yml so that Travis to run the tests on Python 3.4 in addition to 3.3. And then, you could add your modification on the second commit :)

Thanks!

from django-post_office.

garry-cairns avatar garry-cairns commented on July 17, 2024

Okay, I'll do it tonight (my corporate proxy doesn't allow git pull/push). Thanks for your help.

from django-post_office.

selwin avatar selwin commented on July 17, 2024

I added Python 3.4 to Travis and it passed, so I suppose migration isn't
tested in test cases. https://travis-ci.org/ui/django-post_office

So please just remove the "b" strings on tonight's pull request. Thanks for
the report and your contribution :)

Win~

On Fri, Sep 26, 2014 at 5:27 PM, Garry Cairns [email protected]
wrote:

Okay, I'll do it tonight (my corporate proxy doesn't allow git pull/push).
Thanks for your help.


Reply to this email directly or view it on GitHub
#77 (comment)
.

from django-post_office.

selwin avatar selwin commented on July 17, 2024

I released version 1.1.1 containing the migration fix to PyPI. Thanks for your contribution :)

from django-post_office.

garry-cairns avatar garry-cairns commented on July 17, 2024

Thanks for accepting, glad to help.

from django-post_office.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.