Re: Passing an ID through a Modal to delete a user in a View

2018-11-06 Thread Daniel Roseman
On Monday, 5 November 2018 11:17:49 UTC, Mauro Caresimo wrote:
>
> Hello Im having some issues trying to pass an id through a modal. 
> Basically I want to pass an id through a modal, via urls.py and to hit a 
> function in the views to delete the user.
> This is my modal:
>
> Much appreciated for any help. Fairly new to Django. Really hope someone 
> can come to my rescue :-)
>
>
> 
> 
>
>
>
>{% trans 'Delete My Account' %}
> aria-label="Close">
>×
>
>
>
>{% trans 'Are you sure you want to delete your account?' %}
>
>
>
>data-dismiss="modal">{% trans 'Cancel' 
> %}
>
>
> 
> id="delete-account"
>   class="btn btn-raised btn-danger">{% trans 'Yes, 
> delete me' %}
>
>
>
>
> 
> 
>
>
> {% block bottomjs %}
> 
> $(function () {
>$('#delete-account').on('click', function () {
>$('#ms-preload, #status').show();
>});
> });
> 
> {% endblock %}
>
>
>
> URLS>PY
>
> from django.urls import path
>
> from .views import subscriptions, subscribe, unsubscribe,deleteme, 
> get_discounted_value, plan_details, my_subscription, manage_account
>
>
> urlpatterns = [
>path('my-subscription/', my_subscription, name='my_subscription'),
>path('manage-account/', manage_account, name='manage_account'),
>path('subscriptions/', subscriptions, name='subscriptions'),
>path('subscribe/', subscribe, name='subscribe'),
>path('unsubscribe/', unsubscribe, name='unsubscribe'),
>path('deleteme//', deleteme, name='deleteme'),
>path('discounted-value/', get_discounted_value, 
> name='discounted-value'),
>path('plan-details/', plan_details, name='plan-details'),
># 
> re_path('discounted-value/(?P([^/]+))/(?P([0-9.]+))/',
># get_discounted_value, name='assessment_question'),
> ]
>
>
> VIEWS
> @csrf_exempt
> def deleteme(request):
>request.user.deleteme(request.POST)
>return redirect('free_dashboard_index')
>


Your problem doesn't seem to have anything to do with modals or deleting. 
You should have posted the error you were getting, but presumably you have 
a TypeError because Django is trying to pass the id parameter from the URL 
to the view, but the view is not expecting it. Your view is, however, 
trying to do something with request.POST, but you don't actually send a 
POST request so even if you got that far it wouldn't work.

I think you are confusing a few things here. Your modal should actually 
submit a POST request, presumably via a form:


   
  {% trans 'Yes, delete me' %}
   

We also need to remove the ID from the URL:

path('deleteme', deleteme, name='deleteme'),

Note that there is no point submitting the user ID  either in the URL or 
the POST, since it is already available via the request. So I don't know 
what the `deleteme()` method does, but again since it seems to be a method 
on the User model it shouldn't need to accept any parameters:

request.user.deleteme()
--
DR.

-- 
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/a34c130f-d621-48d7-80ee-8ecd2b414dcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels: event loop and thread

2018-11-06 Thread Zhiyu (Drew) Li
Hi there,

I got the following 2 questions

There is only one thread (MainThread) and one event loop running on it by
default if all existing consumers are asynchronous consumers?

Regular sync views (if any) are handled by Threadpoolexecutor and run in a
sub Thread. These sync views won't block the event loop in the main thread.
Channels takes care of this subthread and I don't need to explicitly manage
it. Right?

Thanks
Drew

-- 
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/CAMmsbUkjbuRvYjoZDyDY%3DXkaoQJHHiG659XKX-tPCbe7HqgivA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding Channels to and Existing Django Application

2018-11-06 Thread jz

>
> even down to running two different servers for that project, one normal 
> WSGI one and one ASGI one to let you do async things.


I've tried doing that, but failed. I've created a asgi.py file and tried to 
run it with daphne, but the server didn't start. Daphne simply hang there. 
To my surprise, the same asgi.py file works fine on a completely 
independent django project. My best guess is that something on the 
convoluted settings.py is messing up with daphne.

Are you aware of a project that does what you've mentioned? Would you point 
me to it? I think that looking at the config files could help me set this 
up.

Juarez

On Monday, November 5, 2018 at 9:24:39 PM UTC-2, Andrew Godwin wrote:
>
> Hey,
>
> You can just add channels to an existing Django project and only use it 
> for the bits you need it for - even down to running two different servers 
> for that project, one normal WSGI one and one ASGI one to let you do async 
> things.
>
> You shouldn't migrate any existing code to channels - just add it and then 
> use it for the new bits you need it for, basically.
>
> Andrew
>
> On Sun, Nov 4, 2018 at 1:16 PM > wrote:
>
>> Greetings y'all!
>>
>> I'm looking for recommendations regarding adding Channels to an existing 
>> Django 1.11 application.
>>
>> Every guide I've followed assumes that one is using Channels to build an 
>> application from scratch, and that is OK to replace django's native calls 
>> by Channels.
>>
>> Channels' documentation suggests different ways of setting up 
>> authentication, sessions, etc, but it is not clear to me that every feature 
>> of Django 1.11 has its counterpart
>> on Channels. I am afraid I'll spend days migrating my system to Channels 
>> only to figure out that a particular feature of Django is not supported by 
>> Channels. In order to avoid that I've decided to ask y'all first.
>>
>> Ideally, I would like to set Channels on a particular Django app, not on 
>> the entire Django project (other apps would not be aware of Channels being 
>> setup). Is that possible?
>>
>> If this is not possible, my best guess is that I would need to add 
>> Channels to an independent Django project, and have these two servers 
>> communicate. This 2nd server would point to the same database as the 1st, 
>> and thus would be able to run authentication with same credentials, among 
>> other data related operations.
>>
>> I appreciate any guidance on this matter.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/a8c4164a-ffbb-4975-8d48-f8f058466b4d%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/5cba75bd-19cc-4a10-97bc-e85ffc51cca3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-06 Thread Jason
visual studio, the .net/C# IDE, is not for python (at least none of the 
versions I've used)

So not sure how to help you other than suggest another IDE

-- 
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/16400495-6799-4194-8e5a-0f3a6628f924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Template filter {{ value|date:"M" }} in Python

2018-11-06 Thread Carsten Fuchs

Hello,

complementing template filters, sometimes it is necessary to format dates also 
in Python code, that is, achieve the equivalent to


{{ value|date:"M" }}

For this, I'm using

from django.utils import dateformat
dateformat.format(value, "M")

(This works in Django views and in test cases, but not in `./manage.py shell`.)

As `dateformat.format()` is not covered in 
https://docs.djangoproject.com/en/2.1/ref/utils/, but still very useful e.g. in 
tests, my question is if this is the correct way to achieve in Python what the 
`date` template filter does? Are there alternatives? (`strftime()` does not 
provide translated months names etc., and so isn't).


Best regards,
Carsten

--
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/cb938e74-d2e3-e4cf-13fa-580befd8f49c%40cafu.de.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: event loop and thread

2018-11-06 Thread Andrew Godwin
Your assumptions are correct. The only extra thing to be aware of is that
some Django interactions (like the Channels Auth middleware) need to do
database connections and thus have to launch into a subthread for that, but
that's also managed.

Andrew

On Tue, Nov 6, 2018 at 4:41 AM Zhiyu (Drew) Li  wrote:

> Hi there,
>
> I got the following 2 questions
>
> There is only one thread (MainThread) and one event loop running on it by
> default if all existing consumers are asynchronous consumers?
>
> Regular sync views (if any) are handled by Threadpoolexecutor and run in a
> sub Thread. These sync views won't block the event loop in the main thread.
> Channels takes care of this subthread and I don't need to explicitly manage
> it. Right?
>
> Thanks
> Drew
>
>
> --
> 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/CAMmsbUkjbuRvYjoZDyDY%3DXkaoQJHHiG659XKX-tPCbe7HqgivA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFwN1urN2bWHedWU1YfpXYmGiZ8z%2BAdE4PUX_sitTtD6-EriVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding Channels to and Existing Django Application

2018-11-06 Thread Andrew Godwin
I'm afraid I don't have an easy example to hand - maybe someone else does.
It sounds like you might have something odd in your settings, models.py, or
other files that load at startup.

Andrew

On Tue, Nov 6, 2018 at 5:31 AM  wrote:

> even down to running two different servers for that project, one normal
>> WSGI one and one ASGI one to let you do async things.
>
>
> I've tried doing that, but failed. I've created a asgi.py file and tried
> to run it with daphne, but the server didn't start. Daphne simply hang
> there. To my surprise, the same asgi.py file works fine on a completely
> independent django project. My best guess is that something on the
> convoluted settings.py is messing up with daphne.
>
> Are you aware of a project that does what you've mentioned? Would you
> point me to it? I think that looking at the config files could help me set
> this up.
>
> Juarez
>
> On Monday, November 5, 2018 at 9:24:39 PM UTC-2, Andrew Godwin wrote:
>>
>> Hey,
>>
>> You can just add channels to an existing Django project and only use it
>> for the bits you need it for - even down to running two different servers
>> for that project, one normal WSGI one and one ASGI one to let you do async
>> things.
>>
>> You shouldn't migrate any existing code to channels - just add it and
>> then use it for the new bits you need it for, basically.
>>
>> Andrew
>>
>> On Sun, Nov 4, 2018 at 1:16 PM  wrote:
>>
>>> Greetings y'all!
>>>
>>> I'm looking for recommendations regarding adding Channels to an existing
>>> Django 1.11 application.
>>>
>>> Every guide I've followed assumes that one is using Channels to build an
>>> application from scratch, and that is OK to replace django's native calls
>>> by Channels.
>>>
>>> Channels' documentation suggests different ways of setting up
>>> authentication, sessions, etc, but it is not clear to me that every feature
>>> of Django 1.11 has its counterpart
>>> on Channels. I am afraid I'll spend days migrating my system to Channels
>>> only to figure out that a particular feature of Django is not supported by
>>> Channels. In order to avoid that I've decided to ask y'all first.
>>>
>>> Ideally, I would like to set Channels on a particular Django app, not on
>>> the entire Django project (other apps would not be aware of Channels being
>>> setup). Is that possible?
>>>
>>> If this is not possible, my best guess is that I would need to add
>>> Channels to an independent Django project, and have these two servers
>>> communicate. This 2nd server would point to the same database as the 1st,
>>> and thus would be able to run authentication with same credentials, among
>>> other data related operations.
>>>
>>> I appreciate any guidance on this matter.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/a8c4164a-ffbb-4975-8d48-f8f058466b4d%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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/5cba75bd-19cc-4a10-97bc-e85ffc51cca3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFwN1uqjQzKmzDoHhXE-M5a1B-XuJ7tRhpjhvJr%2Bf056Lck9DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


My developers have run amok

2018-11-06 Thread Dan Davis
My developers, who have come from ColdFusion, are fond of this:

cursor = connection.cursor()
cursor.execute()
data = [r for r in cursor]
return render(request, some_template_name, {'data': data})


The problem with this is that the database cursor reference will be leaked.

How do I integrate into a unit test environment (single-threaded, 
single-process), a check for no outstanding cursors?

-- 
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/f3a0682e-b36a-45ff-8f73-95628f231ebf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My developers have run amok

2018-11-06 Thread Jason
refactor to use the ORM for those bits?  and implement a team styleguide 
that says no direct connections unless its proven to work better?

-- 
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/66c5a5ff-fb30-490c-b582-7d4fd80392d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My developers have run amok

2018-11-06 Thread Dan Davis


On Tuesday, November 6, 2018 at 2:32:52 PM UTC-5, Jason wrote:
>
> refactor to use the ORM for those bits?  and implement a team styleguide 
> that says no direct connections unless its proven to work better?
>

I'm looking to identify the memory consuming bits to allow refactor.   Not 
a bad idea to do as you suggest.
 

-- 
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/92937dab-1bcd-4985-840d-a8521b6a75f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-06 Thread Saeed Pooladzadeh
There are some tools for visual studio which can make it a python IDE.
.I want just want to make the admin.py to work.
What are other IDE's for Django?

در سه‌شنبه 6 نوامبر 2018، ساعت 6:03:32 (UTC-8)، Jason نوشته:
>
> visual studio, the .net/C# IDE, is not for python (at least none of the 
> versions I've used)
>
> So not sure how to help you other than suggest another IDE
>

-- 
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/bd5ffb6d-18b0-43fc-ac59-b25dca55c097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Setting up admin in visual studio

2018-11-06 Thread Matthew Pava
PyCharm

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Saeed Pooladzadeh
Sent: Tuesday, November 6, 2018 3:31 PM
To: Django users
Subject: Re: Setting up admin in visual studio

There are some tools for visual studio which can make it a python IDE.
.I want just want to make the admin.py to work.
What are other IDE's for Django?

در سه‌شنبه 6 نوامبر 2018، ساعت 6:03:32 (UTC-8)، Jason نوشته:
visual studio, the .net/C# IDE, is not for python (at least none of the 
versions I've used)

So not sure how to help you other than suggest another IDE
--
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/bd5ffb6d-18b0-43fc-ac59-b25dca55c097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/6af5e6672bfe4b97960d2d21ed590d8a%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: My developers have run amok

2018-11-06 Thread Jason
oh boy...  Good luck.

you can use connection.cursor() as a context manager, which will clean up 
connections after it exits.  You could grep the project for 
connection.cursor and add the context manager.


how did none of the devs know to clean up after themselves, either with a 
context manager or try-finally?

-- 
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/0b436954-3e31-4dd7-b1ae-2bf75d72f472%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: My developers have run amok

2018-11-06 Thread Dan Davis
I am less certain this is the problem now.   It may simply be that my
project is one of the larger on the server.   I did a quick audit, and
although they are new to django, they either used connection.cursor() as a
context manager, or called close explicitly.

I will try to develop a middleware around pympler, tracemalloc, or objgraph.

On Tue, Nov 6, 2018 at 6:23 PM Jason  wrote:

> oh boy...  Good luck.
>
> you can use connection.cursor() as a context manager, which will clean up
> connections after it exits.  You could grep the project for
> connection.cursor and add the context manager.
>
>
> how did none of the devs know to clean up after themselves, either with a
> context manager or try-finally?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/TZ682yh2QfE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/0b436954-3e31-4dd7-b1ae-2bf75d72f472%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFzonYbp7uaBuqtRuEt5y691Gzs0%2BbAJ5HkMYQkzFsRkgCPMNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: My developers have run amok

2018-11-06 Thread Dan Davis
This will likely do it - tracking as a django middleware, I suspect too
much will still be lazy:

https://pypi.org/project/wsgi-objgraph/

On Tue, Nov 6, 2018 at 6:39 PM Dan Davis  wrote:

> I am less certain this is the problem now.   It may simply be that my
> project is one of the larger on the server.   I did a quick audit, and
> although they are new to django, they either used connection.cursor() as a
> context manager, or called close explicitly.
>
> I will try to develop a middleware around pympler, tracemalloc, or
> objgraph.
>
> On Tue, Nov 6, 2018 at 6:23 PM Jason  wrote:
>
>> oh boy...  Good luck.
>>
>> you can use connection.cursor() as a context manager, which will clean up
>> connections after it exits.  You could grep the project for
>> connection.cursor and add the context manager.
>>
>>
>> how did none of the devs know to clean up after themselves, either with a
>> context manager or try-finally?
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/TZ682yh2QfE/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/0b436954-3e31-4dd7-b1ae-2bf75d72f472%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/CAFzonYa88JNfCjkzfG1yastHs4T%2B96wC-i0iHaEwK%3DEmsnewxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels - core.py error

2018-11-06 Thread Paul Whipp
I've just had trouble with exactly the same error. In my case I was 
building from the tutorial ChatConsumer with my own XChatConsumer and I 
hadn't referenced it in the routing.py. As a result the tutorial async chat 
consumer was receiving a scope that did not contain a room_name in its 
url_route kwargs. Very obscure! I think the channel gets closed by an error 
and then this 500 error comes up rather than anything helpful for the 
original error.

On Friday, 12 October 2018 07:06:13 UTC+10, itsnate_b wrote:
>
> Hi Simon,
>
> Sorry to hear that you are having the same problem! Channels can be a 
> blessing and a curse. I find it very finicky with very poor documentation & 
> poor error handling. As for the fix: I had an AsyncWebsocketConsumer class 
> in consumers.py within which I had a custom __init__ function. I believe I 
> was setting the scope incorrectly within the init. I realized that I had no 
> need to override/augment the init and removed it. The result was that the 
> error disappeared. That was it for me. I have since updated to all the 
> latest builds for the channels & redis infrastructure.
>
> Hope that helps.
>
> Cheers,
> Nathan
>
> On Tuesday, October 9, 2018 at 9:59:33 AM UTC-4, Simon Vézina wrote:
>>
>> Hi itsnate_b,
>>
>> Would you mind elaborating on your fix?
>>
>> I'm getting this exact error and I'm at a complete loss.   Everything 
>> works fine in local, but on my live server, after a couple of minutes/hours 
>> of working fine, I start getting this error in the logs.
>>
>> Thanks!
>>
>> Le dimanche 2 septembre 2018 13:26:29 UTC-4, itsnate_b a écrit :
>>>
>>> Turns out there was an erroneous *init* function in the 
>>> AsyncWebsocketConsumer class. Removing it fixed the issue.
>>>
>>

-- 
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/e1ebd5c9-5326-4d03-9512-f6f1deec28a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-06 Thread Phako Perez
I can recommend py charm 

Sent from my iPhone

> On Nov 6, 2018, at 3:32 PM, Matthew Pava  wrote:
> 
> PyCharm
>  
> From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
> Behalf Of Saeed Pooladzadeh
> Sent: Tuesday, November 6, 2018 3:31 PM
> To: Django users
> Subject: Re: Setting up admin in visual studio
>  
> There are some tools for visual studio which can make it a python IDE.
> .I want just want to make the admin.py to work.
> What are other IDE's for Django?
> 
> در سه‌شنبه 6 نوامبر 2018، ساعت 6:03:32 (UTC-8)، Jason نوشته:
> visual studio, the .net/C# IDE, is not for python (at least none of the 
> versions I've used)
>  
> So not sure how to help you other than suggest another IDE
> -- 
> 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/bd5ffb6d-18b0-43fc-ac59-b25dca55c097%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> -- 
> 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/6af5e6672bfe4b97960d2d21ed590d8a%40iss2.ISS.LOCAL.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/34850594-7A4F-4112-B14B-B6663031EFEC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-06 Thread Saeed Pooladzadeh

But my problem is there is no admin page!!
What is wrong? please inform me.
در سه‌شنبه 6 نوامبر 2018، ساعت 17:39:25 (UTC-8)، Phako Perez نوشته:
>
> I can recommend py charm 
>
> Sent from my iPhone
>
> On Nov 6, 2018, at 3:32 PM, Matthew Pava > 
> wrote:
>
> PyCharm
>
>  
>
> *From:* django...@googlegroups.com  [
> mailto:dj...@googlegroups.com ] *On Behalf Of *Saeed 
> Pooladzadeh
> *Sent:* Tuesday, November 6, 2018 3:31 PM
> *To:* Django users
> *Subject:* Re: Setting up admin in visual studio
>
>  
>
> There are some tools for visual studio which can make it a python IDE.
>
> .I want just want to make the admin.py to work.
>
> What are other IDE's for Django?
>
>
> در سه‌شنبه 6 نوامبر 2018، ساعت 6:03:32 (UTC-8)، Jason نوشته:
>
> visual studio, the .net/C# IDE, is not for python (at least none of the 
> versions I've used)
>
>  
>
> So not sure how to help you other than suggest another IDE
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to djang...@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/bd5ffb6d-18b0-43fc-ac59-b25dca55c097%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to django...@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/6af5e6672bfe4b97960d2d21ed590d8a%40iss2.ISS.LOCAL
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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/023801d6-f969-464c-9034-327f45bc257a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.