Django 1.8.1, DB router and get_absolute_url()

2015-05-20 Thread Davide Setti
Hi all,
I'm using Django 1.8.1 with some models on a legacy DB. They all are in the 
same app, so the router is simple:

class MyRouter(object):
MYAPP = 'pkmain'

def db_for_read(self, model, **hints):
if model._meta.app_label == self.MYAPP:
return 'other_db'
return None


And similar for other Router methods. Everything works fine but the View on 
site in the admin. The model implements:

def get_absolute_url(self):
return 'http://example.com/{}'.format(self.id)


The View on site returns:

OperationalError at /admin/r/1/8461424/ 

no such table: 

It seems to be looking for mytable in the wrong database. Suggestions?

Regards.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e679782c-a7a7-4ac7-9247-2eeb7bd478d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django error about utf8 with BOM when running "python manage.py compilemessages"

2012-03-27 Thread Davide Setti
On Thursday, March 8, 2012 10:04:09 PM UTC+1, Tom Evans wrote:
>
> Yes, just remove the BOM:
>
> http://en.wikipedia.org/wiki/Byte_order_mark
>
But that file is in django, not in his code, am i wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Rc7vQY_Gnq8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



shared authentication and profiles

2011-04-22 Thread Davide Setti
Hello,
we're going to build some "federated" apps. Let's call them
app1.example.com and app2.example.com. I need to do two things:

1. single sign on
2. share some data between the two profiles. For example i want to
keep username, name and surname in the same place, while the phone
number should just stay in app1.

For point 1 i see there's https://github.com/easel/django-shared-auth
, but i don't understand why i need to use it. What if i simply share
cookie between subdomains and the session table?

For point 2, do you know if there are already apps to do this? I know
that i can use Database Routers to keep centralized data in a
different DB, but i would like to know if there are out-of-the-box
solutions...

Regards
-- 

Davide Setti
blog: http://blog.flatlandia.eu
code: http://github.com/vad

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.