Re: Populate a select dropdown based on queryset

2018-03-30 Thread Derek
You can use "smart selects": https://github.com/digi604/django-smart-selects Works for both normal forms and in the admin. On Wednesday, 28 March 2018 23:02:36 UTC+2, James Farris wrote: > > Hi, > > I'm trying to populate a 'vaccine' dropdown based on a 'species' of a > pet. For example, if a

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Andréas Kühne
Hi, I am sorry, but this doesn't really make sense. What do you mean by decoupling the data? Deploying to the cloud, will mean that you will need to setup a new database for your project - there you will get a completly new database, that won't be connected to your development data in any way. Y

[django-channels] Which process sends message to all channels in a group during group_send?

2018-03-30 Thread krdeepak
Hi, I was doing a deep dive in django channels and related projects, and plan to use it in my project along with contributing to it in the future. I understood most of the details, but still not clear about one things. During a group_send in channel_layer, which process is responsible for liste

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
Hi, Environment variables are the best option for not embedding sensitive information in files which have chances to be stored in places such as external source repositories (GitHub et al.). If you are working with orchestrators such as Kubernetes, you can use the "secrets", which are specia

How to make asynchronous ajax requests if the server side work takes plenty of time to finish?

2018-03-30 Thread Chasan KIOUTSOUKMOUSTAFA
I need advice or sample code to achieve a task related asynchronous ajax request that server side work takes plenty of time to finish its job. Here is the sample scenario; I've a simple CSV file upload form. User submits file - Server starts processing CSV file. - Server makes queries

Django Version update for my project

2018-03-30 Thread Haroon Ahmed
Hi, I want to update my Django version from Django 1.9.8 to Django 2.0.3 because it is mentioned in the Django 1.9.8 official document that this version has security issues. https://docs.djangoproject.com/en/1.9/internals/release-process/#backwards-compatibility-policy 'This document is for an

Updating Django for my web based application

2018-03-30 Thread Haroon Ahmed
Hi, Currently my application is developed with Django 1.9.8 and I want to upgrade it to 2.0.3 because Django 1.9.8 is an insecure version of django as mention on it official documentation. https://docs.djangoproject.com/en/1.9/internals/release-process/#backwards-compatibility-policy This do

Re: Getting channels 2 to work

2018-03-30 Thread Luke Waltman
Hello Everyone, I am still having an issue with Channels that was never really solved in an earlier Stackoverflow question... Why does : from channels.asgi import get_channel_layer result in : from channels.asgi import get_channel_layerImportError: No module named asgi I am using Django (2.0

Re: How to make asynchronous ajax requests if the server side work takes plenty of time to finish?

2018-03-30 Thread m1chael
I think a typical approach would be, using Django celery to process your heavy workload in the background, and then when finished, notify the user via email, text, or maybe have a periodic async ajax call check to see if there are completed tasks not yet looked at On Fri, Mar 30, 2018 at 12:53 AM,

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Antonis Christofides
> Environment variables are the best option for not embedding sensitive > information in files However some people (me that is :-) think that environment variables, though widely used, are an ugly hack for this problem. I explain the way I do it (TLDR; production settings must be stored in a dif

Re: Updating Django for my web based application

2018-03-30 Thread Jani Tiainen
Hi, Standard procedure to update Django is to upgrade gradually all versions from source version to target. There is no single document to describe changes needed between versions that are apart more than one release. Only changelog you can find is at every release which contains changes from pr

When deleting field in models admin form not updating.

2018-03-30 Thread Gerald Brown
I am using Django 2.0.3 and Python 3.6. When I delete a field in the model file it is NOT being deleted in the admin form. Any ideas on how I can delete the field on the admin form? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
Env vars are considered bad in contexts where everything runs in the same... environment. And I too have considered them as hacks or as options to avoid by all means. But times are changing, and nowadays there is a move towards containerized apps, even outside the cloud context. And we are no

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Bill Torcaso
I have a concern about using environment variables to hold secret information, and an opinion about it. IF DEBUG is enabled, and there is a 500 server internal error, and the default 500 template is used to render the response, THEN *all of your secret information is shown in the browser

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread PASCUAL Eric
You're perfectly right about the "500 Error + DEBUG" case. One solution is to set DEBUG to off by default, and turn it on by code in the setting module if detecting that the app is executing in a dev or Q&A environment. Depending on your context, this can be done with rules based on the host

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Phang Mulianto
I agree to set debug to false in your production configuration file. Never debug on production setup. If need enable debug on, use in staging environment or with different django configuration files. On Fri, 30 Mar 2018 23:52 PASCUAL Eric, wrote: > You're perfectly right about the "500 Error

Re: Getting channels 2 to work

2018-03-30 Thread Andrew Godwin
That code would be for Channels 1. Channels 2 is an entirely different import set - make sure you are using tutorials or answers specifically for 2. Andrew On Thu, Mar 29, 2018 at 4:52 PM, Luke Waltman wrote: > Hello Everyone, > > I am still having an issue with Channels that was never really s

Re: [django-channels] Which process sends message to all channels in a group during group_send?

2018-03-30 Thread Andrew Godwin
When you do a group send, the message doing the sending fans out the send to all the target channels (currently using individual commands, and soon with a Lua script inside Redis). We're not using redis pub-sub - we use lists instead. Andrew On Fri, Mar 30, 2018 at 2:26 AM, krdeepak wrote: > Hi

Re: When deleting field in models admin form not updating.

2018-03-30 Thread Andrew Korir
have you tried to run migrations on that particular app in your django project python manage.py makemigrations app_name python manage.py migrate app_name On Fri, Mar 30, 2018 at 4:27 PM, Gerald Brown wrote: > I am using Django 2.0.3 and Python 3.6. When I delete a field in the > model file it

Re: Filtering Queryset by Foreign Key Properties

2018-03-30 Thread Jamaldin Pro
> > class ProductType(models.Model): > class Meta: > verbose_name_plural = 'тип' > verbose_name = 'типы' > > image = models.ImageField(upload_to='products_type_images/') > name = models.CharField(max_length=20, blank=True, null=True, > default=None) > is_active = m

How to make a custom login() using Django login() method?

2018-03-30 Thread Susan Tan
Hi Django Users, This is my first-time post. I want to return my own SusanTemplateResponse class in https://github.com/django/django/blob/stable/1.10.x/django/contrib/auth/views.py#L98

Re: [django-channels] Which process sends message to all channels in a group during group_send?

2018-03-30 Thread kumar deepak
Thanks Andrew. I looked at the code and was able to figure out how it is being done (including the comment to use lua scripts in the future). The deep dive into codebase keeps getting deeper (channels, channels_redis, aioredis, asgiref, twisted, asyncio ...). I am building a chat based game using

Re: Populate a select dropdown based on queryset

2018-03-30 Thread James Farris
Thank you Derek! I will definitely look into it. -James > On Mar 30, 2018, at 12:08 AM, Derek wrote: > > You can use "smart selects": > > https://github.com/digi604/django-smart-selects > > Works for both normal forms and in the admin. > > >> On Wednesday, 28 March 2018 23:02:36 UTC+2, Jam