Re: DatabaseRouter, add on runtime add new items to db.connections

2020-09-15 Thread Anton Melser
There appear to be relatively few references to this sort of thing peppered 
about the net, like this ancient stackoverflow 
post 
https://stackoverflow.com/questions/6585373/django-multiple-and-dynamic-databases,
 
the below email, or the now long abandoned db router mentioned below. 

Is there a "why this is completely unsupported and we won't answer any 
questions about it" post from one of the Django Masters somewhere? I also 
really want to do this... (actually am doing it but the dynamic dbs aren't 
managed by django, and I would really like them to be...). If it is a 
reasonable thing to do, is there some place with good advice on how to go 
about it? Thanks!

Le jeudi 23 février 2017 à 19:58:53 UTC+8, Matthieu Guffroy a écrit :

> Hello,
>
> We are using in our system for more than 2 years now, a specific 
> DatabaseRouter allowing us to use multiple databases depending on which 
> clients is connecting.
> It appears now, that the databases lists start to be really big, and that 
> it becomes bad to be forced to re-deploy our backend to add a new database 
> in the settings.
>
> So we add the configurations in a specific database, and add to our 
> middleware that was previously just setting the database to use in function 
> of the request, the ability to load dynamically new database configurations.
> With a function like this :
>
> from django.db import connections
> def add_db_connection(system_id, name, user, password, host, protocol):
> connections.databases[system_id] = {
> 'ENGINE': 'django.db.backends.' + protocol,
> 'NAME': name,
> 'USER': user,
> 'PASSWORD': password,
> 'HOST': host,
> 'CONN_MAX_AGE': 0
> }
>
> It appears we don't seams to be firsts to edit dynamically this, as it is 
> also the way works this extension : 
> https://github.com/ambitioninc/django-dynamic-db-router
>
> But before we put our new code in production, as we doesn't have found 
> some clear indication about if we can or if we cannot edit 
> django.db.connections in the documentation. We will be more confident, if 
> someone involved in django development can give us it's feedback about this 
> way of making things and if it's the recommended way ? or if their is a 
> better way ?
>
> Thanks a lot, for all you feedback,
>
> Matthieu
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b9f60727-30ae-4844-88e1-e4e030060c5bn%40googlegroups.com.


Best option for wrapping a wsgi app

2019-02-19 Thread Anton Melser
Hi,

I searched high and low but my Google-foo must be lacking. I want to wrap a
wsgi app (https://github.com/tsudoko/anki-sync-server) and serve it under
my Django site. After wasting large amounts of time working around this
thinking it wasn't possible, I stumbled across
https://github.com/2degrees/django-wsgi, which does the trick nicely (at
least it appears to for what I need, though I have only tested locally).
Unfortunately, the last commit was 3-4 years ago, and it doesn't support
Django 1.10+ (is_authenticated() vs is_authenticated). I have submitted a
PR and am currently using a fork but the project appears completely dead.

What are other people using, if anything?

Cheers,
Anton
-- 
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
This will help you for 99.9% of your problems ...

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPrsXNN1ve8PFYr9M%2BpbTHqA4T2xuwPAm%3DmJR13trp2meQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Messages rejected?

2019-02-13 Thread Anton Melser
Thanks for the reply. I thought there might be a moderation queue (I never
made it as far as the dedicate list docs). I would be quite interested in
finding out what was inappropriate about my first attempt at posting and
what changed so that my second attempt (with a different email) was
acceptable. I would like to make sure any future questions I post to the
list are in the right form. Is that possible somehow, do you know?

Thanks.

On Thu, 14 Feb 2019 at 02:38, Tim Graham  wrote:

> Messages from first time posters go through a moderation queue.
>
> On Tuesday, February 12, 2019 at 9:56:26 PM UTC-5, Anton Melser wrote:
>>
>> Hi,
>> I asked a question last night with a Google for business account and had
>> the message bounce - is that normal?
>>
>> Google also hasn't kept the message anywhere so it's completely lost :(.
>>
>> Anton
>>
>> ps. Also posted to see whether this will also bounce...
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2121f6d2-a61c-40e1-97e8-40591b6a7046%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
This will help you for 99.9% of your problems ...

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPrgiH6U7siMCwCFEMqA-vvQEjXrbmd4v2JJLmyD_KXRug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keeping/accessing the data Django generates during a test run

2019-02-13 Thread Anton Melser
>
> When you use django unittests commit is made as no-op. Use --keepdb and at
> the end of your tests run SQL commit against your database cursor
> connection.
>

Awesome, exactly the info I was missing. Thanks for your help.
Cheers,
Anton

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPpYWa3D9KvB%3DzYoas_UNKgHxk%3DY4vJqeAGnjLE65Kq0Gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Anton Melser
Hi,

I can't work out whether it is expected or whether I am missing something. 
I would like to keep the DB data that I generate during a test run to 
inspect/persist it. --keepdb means I have empty tables at the end, 
strangely even if I ctrl-C a test run. It would also be logical for test 
data to get cleaned... Is there an option I can add to keep it?

I have a lot of calls to external services that should be mocked. The json 
returned from these calls is put in the DB as-is, so if I can just set up 
an initial run of the tests and then get the data from the DB that would be 
optimal. I could add file writes about the place to persist, but I want to 
evolve the test data over time and will need to do this often, so being 
able to do that from the DB would be very handy.

Any pointers?

Thanks,
Anton

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Messages rejected?

2019-02-12 Thread Anton Melser
Hi,
I asked a question last night with a Google for business account and had 
the message bounce - is that normal? 

Google also hasn't kept the message anywhere so it's completely lost :(.

Anton

ps. Also posted to see whether this will also bounce...

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/92d7059a-e711-45e0-9b06-053840b40991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Release announcements?

2015-02-18 Thread Anton Melser
Hi,

I have started a new project on 1.8 and am looking for an RSS or mailing 
list that has release announcements for Django proper - is there anything? 
My understanding was that the first Beta was supposed to come out on the 16 
Feb, is that right?

Thanks!
Anton

-- 
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/1fd9766f-56f4-4661-af3f-89f3f27a1cc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the right location for my django translation files?

2013-10-09 Thread Anton Melser

>
> I'm giving my first steps with python/django/mezzanine so please bear with 
> me.
>
> I modified a translation file of the mezzanine's blog application and 
> compiled it OK. Mind you: I literally only modified a couple of words and 
> left the rest intact.
>
> The only place I found out I could place them in order to test was at the 
> blog app's locale folder 
> (~/MY_VIRTUAL_ENV/lib/python2.7/site-packages/mezzanine/blog/locale/es/LC_MESSAGES).
>
> It worked fine, but my guts tell me there has to be a better way so I can 
> have this file(s) in some other location WITHIN my own mezzanine 
> application so:
>
>1. I can easily maintain them and
>2. I don't have to keep my whole virtual environment in my SCM's 
>repository.in order to keep track of this single file with just a 
>couple or words modified and that will hardly ever get modified again.
>
> Great minds think alike? :-). I am in *exactly* the same situation - there 
are a couple of translations I would like to change slightly in Mezzanine 
(a capitalisation here, pluralisation there) and I had exactly the same 
thought. I don't want to have to maintain something completely separately. 
Did you find an elegant solution?

-- 
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/80e29974-637f-49d4-83e8-f176829cb18e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser


> Hey Anton,
>
> From my experience if it's a 2 year project you're building don't use a 
> CMS. Start with a plain Django project and then add apps you need. All 
> these CMSs will just lock you in and become more of a hinderance then help. 
>
> I also recommend building your own admin before you invest too much time 
> into customising the default admin. 
>
> Certainly very wise advice. I guess my problem is that I wanted to have a 
solid guide for overall project structure (not having done a major project 
in Django before), something which a good CMS can often provide. That and 
some first versions of apps so we can start with something and evolve. It's 
definitely the lock-in that I'm looking to minimise though... FeinCMS seems 
to be the project that puts itself across as what I'm looking for - a solid 
skeleton that doesn't assume too much. I'll look more into that.
Thanks for your insight,
A

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-28 Thread Anton Melser

>
>
> Might be an idea to write a one page business plan. Amazing how quickly 
> it all becomes clear as soon as the business objectives are nailed down. 
> After that I would guess only one of those would stand out for you. 
>
> We have a pretty solid business plan, or at least one that the startup 
incubator is happy with :-). The only problem is that they are necessary to 
create but only really for crystallising thinking rather than laying out a 
solid roadmap. We have far too many ideas and we want to let things evolve 
through test-and-learn and customer development. Basically we just want an 
MVP that we won't have to throw out 6 mths in. Maybe it's a pipe dream 
though...
Thanks,
A

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CMS base to start with?

2013-09-27 Thread Anton Melser


> Are you try with https://www.djangopackages.com/ ??
>

The problem is the amount of choice. There seem to be many great packages 
there but I was hoping someone from the community with more intimate 
knowledge of what is there might be able to shed some light on the subject. 
>From my investigations, Django-CMS, FeinCMS and Mezzanine all have their 
strong points for what I want. I guess there is no "right" choice but there 
might be a "righter" one :-).
Cheers,
A
 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


CMS base to start with?

2013-09-27 Thread Anton Melser
Hi,

I'm pretty new to Django/Python and I'm starting a fairly major project 
(hopefully next 2+ years of my life :-)). If all goes well, there will be 
several developers on the project in a year or two - getting our hands 
dirty is what it's all about. Use something I know? PHP/.NET/Java - no 
thanks! It's going to be a long road and I've quickly seen the superiority 
of Python and the ease of development with Django and I'm definitely in for 
the long haul so... 

There is quite a bit of functionality that has been written 50k times 
before and I'd rather not reinvent, like advanced user management (social 
everything yadda yadda), some nice templates to start with (supporting 
bootstrap 3 within the next 2-3 months or so) and dynamic theming, blog, 
article management, easy plugging to search backends, content and user 
rating, unit tests, etc.

Beta versions are fine as long as the latest sexy version will go stable 
within 2-3 months and contributing back is a given, at least while it 
remains viable.

So I've been looking around at what to start with and there is quite a bit 
of choice. Django-CMS, Mezzanine, FeinCMS to name but a few... 

The stuff I refer to above is stuff I would REALLY like to have out of the 
box (ie, it's what we're starting with), for the rest (marketplace, 
mapping, geo-location, kitchen sink, etc.) we just need for it to be easy 
to add new modules which by then I/we should be able to write from scratch 
anyway, if needed. Other stuff we probably don't need at all like 
multi-lang.

I guess the only other particularity is that we are going to need excellent 
caching - we are expecting around 90% of the traffic on 2-3 days and 
serious peaking within that. Going PAAS is not out of the question but if 
we can get away with some advanced caching then I'd rather start with that 
and then if cashflow warrants it re-evaluate the situation later. 

So, should I start with a CMS? If so, which one? What I'm really looking 
for is a base to start with that I don't end up saying "why the #!@& did I 
start with X" in 12 months time...

Any opinions or insults are most welcome!

Thanks,
Anton

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.