Re: Django-MQTT

2019-05-21 Thread PASCUAL Eric
Hi Sabuhi, I wrote something similar a couple years ago, not involving Arduinos but using MQTT anyway. The selected approach consisted in having a MQTT listener, based on paho-mqtt lib (https://pypi.org/project/paho-mqtt/), acting as a gateway to a REST API on the Django side, based on Django

Write queryset containing request from middleware outside of django's views

2019-05-21 Thread valentin jungbluth
Hello guys, I have a little question about request attribute in my function located in a menu.py file (not my view): def list_of_edition(request): """ Return list of editions :return queryset """ instance = NavbarMenuSettings.objects.filter(application=request.cur_app , display=T

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
my manage.py is in project folder you can check attachment On Mon, May 20, 2019 at 5:42 PM Abu Yusuf wrote: > Where is your manage.py file? > > On Mon, May 20, 2019 at 11:57 AM sagar ninave > wrote: > >> AttributeError at /admin/ 'WSGIRequest' object has no attribute 'user' >> Request Method:

Re: LookupError: No installed app with label 'admin'.

2019-05-21 Thread Chris Bartos
When in your virtual environment, if you run 'pip install django' it should install sqlparse automatically. If not, you have to install it manually. 'pip install sqlparse' On Sunday, May 19, 2019 at 10:11:15 PM UTC-4, This is a test message wrote: > > Hi, > > > > I am new to django and am tryi

Re: LookupError: No installed app with label 'admin'.

2019-05-21 Thread kimeualexis
This error mostly has nothing to do with the admin. Try makemigrations and migrate. On Monday, May 20, 2019 at 5:11:15 AM UTC+3, This is a test message wrote: > > Hi, > > > > I am new to django and am trying out the tutorial. Get the following error: > >1. Create a virtual environment using

Re: Getting "SMTPServerDisconnected: Connection unexpectedly closed: [Errno 104] Connection reset by peer" errors when using django.core.mail.send_mail in the loop

2019-05-21 Thread Asif Khan
I am facing similar error while I am rendering html template to PDF by using xhtml2pdf. Same when my template have small number of rows it works perfect to render as pdf but when my result fetch mutiple table rows it start processing and after couple of duration give error [Errno 104] Connectio

Filtering Data Based On Foreign Key

2019-05-21 Thread Gavin Boyle
Hi all, I am having an issue dynamically populating form data based on the previous selected field. In my case I have two models one which contains different types of memberships associated to different clubs. Then I have another model which handles registrations for individual clubs. My problem

Re: No puedo generar qr en django

2019-05-21 Thread Mario R. Osorio
Osman, Un codigo QR no es otra cosa que una forma compacta de representar informacion. Sin embargo, existen varios tipos de codigos QR. Lo primero que tienes que hacer es seleccionar que es lo que vas a representar con el codigo; podria ser simplemente el identificador unico del empleado o, de

Re: Migrations File too Large preventing Migrate

2019-05-21 Thread Yoo
https://stackoverflow.com/q/56213264/10973829 Originally, I posted this in StackOverflow. Not getting any responses. I looked over all my migration files, and it seems like they get continuously larger. There are more “Test” tables than what you see in the migration files; what I’ve done was spli

Re: Migrations File too Large preventing Migrate

2019-05-21 Thread Peter Mudoko
On Mon, 20 May 2019, 05:11 Yoo, wrote: > In Django 2.2, I run makemigrations then migrate. I wait approx. 5-7 > minutes and then I get "Fatal Python error: Cannot recover from stack > overflow." "Current thread 0x0002094 (most recent call first):" yada yada > "File "manage.py", line 17 in main "F

Forbidden (CSRF token missing or incorrect)

2019-05-21 Thread Abdul Qoyyuum
Hi Django Devs, Got a problem that I don't understand what's going on or why its gone missing. Logs says: csrf.py:process_view#184: Forbidden (CSRF token missing or incorrect.) The necessary code is in there: $("document").ready(function () { // //

Occasional CSRF cookie not set django 1.11 -> 2.1

2019-05-21 Thread Yusuf Musleh
Hello, We recently migrated from django 1.11.5 to 2.1.4. We performed all the necessary changes needed for the migration and the application to work, things went smoothly except for some CSRF validation issues. After the migration on our production server we noticed an increase in the number of

Re: Projects to work on

2019-05-21 Thread wanbao jin
Hi, Ahmed, Could you share with me about it in more detail? On Monday, May 6, 2019 at 2:45:18 AM UTC+8, Ahmed Ishtiaque wrote: > > I also have a small chat project that you could possibly take a look at! > It's called chatter and it's on PyPI: www.pypi.org/django-chatter > > It definitely needs

Re: Unwelcome error!

2019-05-21 Thread Adam Parsons
You need to read the error message, it says there is no such table. This refers to a missing table in the database. Given it is referring to django_session, you have not run migrations yet. If you follow the Django project's official tutorial, it will walk you through that process in step 2 h

Re: Occasional CSRF cookie not set django 1.11 -> 2.1

2019-05-21 Thread Aldian Fazrihady
The form page itself can expire if you let it readily opened in a browser tab for hours. If I did that and I didn't reload my form before using it, I will get a CSRF error. There several ideas to fix it. The point is to have CSRF cookie to always fresh, and your form will use that cookie instead

Re: Projects to work on

2019-05-21 Thread DEEPAK RAGHAV
The chat project link is not working. It is showing error 404. On Wed, May 22, 2019 at 3:21 AM wanbao jin wrote: > Hi, Ahmed, Could you share with me about it in more detail? > > On Monday, May 6, 2019 at 2:45:18 AM UTC+8, Ahmed Ishtiaque wrote: >> >> I also have a small chat project that you co

Re: Is it possible to value based on another aggregation?

2019-05-21 Thread Jim Illback
Sorry this is late. I’d use the annotate to get the Max of one FK. Then, do a query on the other FK table with inverted order_by and use the [0] notation to just retrieve the latest row. It is 2 queries, but FK processes are indexed and should be fast. Hope this helps. Jim Illback On Apr 23,

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
This issue has been resolved yet? On Tue, May 21, 2019 at 4:55 PM sagar ninave wrote: > my manage.py is in project folder you can check attachment > > On Mon, May 20, 2019 at 5:42 PM Abu Yusuf > wrote: > >> Where is your manage.py file? >> >> On Mon, May 20, 2019 at 11:57 AM sagar ninave >> wr

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
Comment out the #'django.contrib.auth.middleware.SessionAuthenticationMiddleware', in your settings.py file in Middleware or remove. Then run again. It will work. On Wed, May 22, 2019 at 10:36 AM Abu Yusuf wrote: > This issue has been resolved yet? > > On Tue, May 21, 2019 at 4:55 PM sagar nin

Need help for Cascading Drop Down for Continent, Country in Admin GUI - Not Getting correct Answer from Many Days

2019-05-21 Thread Balaji Shetty
Hi I am learning Django from last months and want to implement Cascading Drop Down for Continent and Country in Admin GUI. I dropped same query two times but i could not get exact correct solution. I tried lot of option like django-smart-select and many more.. But i could not get updates in d

Re: Need help for Cascading Drop Down for Continent, Country in Admin GUI - Not Getting correct Answer from Many Days

2019-05-21 Thread Nitin Kumar
Everything seems alright. It seems you haven't created any continents yet. The table is empty. On Wed, 22 May, 2019, 10:52 AM Balaji Shetty Hi > > I am learning Django from last months and want to implement Cascading Drop > Down for Continent and Country in Admin GUI. > > I dropped same query t

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
no i am getting this error again On Wed, May 22, 2019 at 10:25 AM Abu Yusuf wrote: > > Comment out the > > #'django.contrib.auth.middleware.SessionAuthenticationMiddleware', > > in your settings.py file in Middleware or remove. Then run again. It will > work. > > On Wed, May 22, 2019 at 10:36 A

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
I did run your project and it's working fine. On Wed, May 22, 2019 at 11:43 AM sagar ninave wrote: > no i am getting this error again > > > On Wed, May 22, 2019 at 10:25 AM Abu Yusuf > wrote: > >> >> Comment out the >> >> #'django.contrib.auth.middleware.SessionAuthenticationMiddleware', >> >>

Re: Need help for Cascading Drop Down for Continent, Country in Admin GUI - Not Getting correct Answer from Many Days

2019-05-21 Thread Balaji Shetty
Hi I have registered model in admin.py Added Continent ( Cont1, Cont2, Cont3 ) Added Country under Continent Cont1 - Count11 Cont1- Count12 Cont2 - Count21 Cont2-Count22 Con3-Count31 Con3-Count31 When I add Location When i select Cont1, I should get only Count11 , Count12 When i select Con

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
when i am opening admin panel then it is getting error On Wed, May 22, 2019 at 11:19 AM Abu Yusuf wrote: > I did run your project and it's working fine. > > On Wed, May 22, 2019 at 11:43 AM sagar ninave > wrote: > >> no i am getting this error again >> >> >> On Wed, May 22, 2019 at 10:25 AM Abu

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
It's working fine. [image: wsgi.png] On Wed, May 22, 2019 at 11:57 AM sagar ninave wrote: > when i am opening admin panel then it is getting error > > On Wed, May 22, 2019 at 11:19 AM Abu Yusuf > wrote: > >> I did run your project and it's working fine. >> >> On Wed, May 22, 2019 at 11:43 AM sa

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
I did use this urls.py: from django.conf.urls import url from django.contrib import admin from django.urls import path # from microblog.admin import microblogs_admin_site urlpatterns = [ path('admin/', admin.site.urls), # url(r'^microblogs-admin/', microblogs_admin_site.urls), ] On Wed, May 22,

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
i am also using same url.py On Wed, May 22, 2019 at 11:33 AM Abu Yusuf wrote: > I did use this urls.py: > > from django.conf.urls import url > from django.contrib import admin > from django.urls import path > # from microblog.admin import microblogs_admin_site > > urlpatterns = [ > path('admin/

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
It's middleware. Not middleware_classes: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationM

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
i have tried already On Wed, May 22, 2019 at 11:45 AM sagar ninave wrote: > after doing this i am getting another error > > On Wed, May 22, 2019 at 11:44 AM Abu Yusuf > wrote: > >> It's middleware. Not middleware_classes: >> >> MIDDLEWARE = [ >> 'django.middleware.security.SecurityMiddleware',

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread sagar ninave
after doing this i am getting another error On Wed, May 22, 2019 at 11:44 AM Abu Yusuf wrote: > It's middleware. Not middleware_classes: > > MIDDLEWARE = [ > 'django.middleware.security.SecurityMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.middleware.common.Com

Re: 'WSGIRequest' object has no attribute '

2019-05-21 Thread Abu Yusuf
Which error? On Wed, May 22, 2019 at 12:15 PM sagar ninave wrote: > after doing this i am getting another error > > On Wed, May 22, 2019 at 11:44 AM Abu Yusuf > wrote: > >> It's middleware. Not middleware_classes: >> >> MIDDLEWARE = [ >> 'django.middleware.security.SecurityMiddleware', >> 'djan

Re: Need help for Cascading Drop Down for Continent, Country in Admin GUI - Not Getting correct Answer from Many Days

2019-05-21 Thread Nitin Kumar
Hi, The field 'continent' in Location model is redundant, should not be there. class Location(models.Model): continent = models.ForeignKey(Continent,on_delete=models.CASCADE) country = models.ForeignKey(Country,on_delete=models.CASCADE) city = models.CharField(max_length=50) stre

Re: Need help for Cascading Drop Down for Continent, Country in Admin GUI - Not Getting correct Answer from Many Days

2019-05-21 Thread Chetan Ganji
Hello Balaji Sir, AFAIK, Django does not filter the foreign key fields by default, Cascading Drop Down is not available by default in django. If the filtering was to be done on the initial value only, you could have overwritten the __init__() in the form to filter the fk values. But that does not