This is already implemented in Django 1.11: 
https://code.djangoproject.com/ticket/27061.

On Wednesday, March 22, 2017 at 6:53:11 AM UTC-4, Melvyn Sopacua wrote:
>
> Hi,
>
>  
>
> I'm currently running into the problem that in order to run tests, I need 
> to grant my database user super-user privileges.
>
> No problem for dev, but I'd like to avoid that on any system resembling 
> production.
>
>  
>
> This is a Postgresql specific issue, as there is no seperate privilege I 
> can grant that makes it more secure, but even if there was / is going to 
> be, I'd be reluctant to grant it.
>
> I do however want to be able to run tests in staging / production 
> environments.
>
>  
>
> The problem can be avoided by using a template database that already has 
> the required extensions installed. The problem obviously exists for 
> django.contrib.postgres but also for django.contrib.gis and any reusable 
> apps that require an extension (like the custom JSONField implementations 
> out there).
>
>  
>
> I did a coarse search if this was discussed before, but template and 
> database are common words in this group :), so if this has been discussed 
> before, feel free to point me to it.
>
>  
>
> The question being: is there any aversion to supporting TEMPLATE in the 
> DATABASES[TEST] setting and that the database will then be created using 
> the template database (so mapping to CREATE DATABASE ... TEMPLATE ..)?
>
> -- 
>
> Melvyn Sopacua
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/38c11fbb-81b5-49d8-8c9c-3360d02d335e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to