Re: why style.css is not read by my codes. i am using VScode for Django

2020-08-24 Thread RANGA BHARATH JINKA
Hi,

   I think it is not able to find the file. Please check whether it is the
correct location of the files.
  Add a static root in settings file like
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

STATIC_URL = '/static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]

MEDIA_URL = '/images/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')

All the best

On Mon, Aug 24, 2020 at 10:03 PM Haris Ahmad  wrote:

> Have you added whitenoise to the settings.py
>
> On Mon, 24 Aug 2020, 9:27 PM Amresh Giri,  wrote:
>
>> Is is supposed to be "statics" ?
>>
>> On Mon, Aug 24, 2020, 9:49 PM alka reetesh 
>> wrote:
>>
>>> I have used python manage.py collectstatic, which gave
>>> error--FileNotFoundError: [WinError 3] The system cannot find the path
>>> specified: 'C:\dmform\myproject\statics'
>>>
>>> --
>>> 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/0dd03bb0-3c6c-4e7f-b7d7-9f6f55aae7bbn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CAJqzuMH9YfLHQnj3tESo8cZpYTRqf7uqXitZHdakfVt_2yRFTg%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAG0UDYbWg9NQ6vHNdbWA0UNhb3Td1v7Mc4SxnxCeveywe6AMkg%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m316v%2BgjgysVfK66Nrz4rG%2BUwYdV07u1y_QHB%3DMp-MhhU%2Bw%40mail.gmail.com.


Re: Stream Webcam and with Button Capture Image

2020-08-24 Thread RANGA BHARATH JINKA
Hi,

Try this. This may be useful for you.
https://github.com/kevinam99/capturing-images-from-webcam-using-opencv-python
All the best

On Tue, Aug 25, 2020 at 2:03 AM Samara Muñoz  wrote:

> Hi Ketul, I was wondering if you have had any luck. I was seeing a video
> and they use FileSystemStorage(). Do you think it has something to do with
> it?
>
> Regards, thanks for your time.
>
> Samara
>
> On Mon, Aug 17, 2020 at 4:32 PM Ketul Suthar  wrote:
>
>> I will let you know. I am also working on same concept.
>>
>> On Mon., Aug. 17, 2020, 5:19 p.m. samar...@gmail.com, <
>> samaram...@gmail.com> wrote:
>>
>>> Hello, I already achieved opening the webcam in browser, I would like to
>>> add a button in a template and every time it is clicked, it saves the frame
>>> in a folder ('media')
>>> I am new and Django and I don't understand much on how to use views and
>>> templates work together.
>>>
>>> Can someone help me? I uploaded the folder
>>>
>>> --
>>> 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/12f53f21-f406-4ea8-840e-42f01cdac863n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CANuqdaW_ofjaBrnY4Hii6BLE99xKuvYv_cXTB6CDYO7KJuWbbQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAA%2Btjr5JagaPwofPh9q4OmTAkcKqFe_s5k531cK_972_5jhLfw%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m317tDENY5ZtRYF1HjJf6gzNTjywuz_cDLh%2By_3c7Ji7fqg%40mail.gmail.com.


Re: How to reset is_active field of auth_user

2020-08-24 Thread Amresh Giri
This setting can be configured from the Identity Provider account like
Okta, onelogin, etc when you create an app on it.

On Tue, Aug 25, 2020, 10:48 AM Kamakshi Aggarwal 
wrote:

> Can you explain it more to me? Its not clear.
>
> On Mon, 24 Aug 2020, 8:04 pm Amresh Giri,  wrote:
>
>> I think this setting can be handled from your IDP side in the
>> application.
>>
>> On Mon, Aug 24, 2020, 5:46 PM Kamakshi Aggarwal 
>> wrote:
>>
>>> Hi,
>>>
>>> We are using django application in our company. We are using
>>> RemoteUserAuthentication for that(single sign on). Only employees can sign
>>> in.
>>>  Once employee signs in,is_active filed is set to True by default in
>>> auth_user table.
>>>
>>> Now if user leaves the company how should I set "is_active" field to
>>> False.
>>>
>>> Thanks
>>> Kamakshi
>>>
>>> --
>>> 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/CAAK5yVtWjyate%2BNuzv58yq-%2Bo9Kd5wju%3DKVP7iBUOSCGc7YSsw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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/CAJqzuMGHAvTGfMOFDt%3Dq3wtmJBeTCKL1Ui31vkDsga5ggobuJA%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAAK5yVuvGBEZCGkDNt8825sp%2BPKGezPE855ScLPt4Ltw%2B6J5Xw%40mail.gmail.com
> 
> .
>

-- 
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/CAJqzuMHoUs%3DVa0%2BL86ipVE7ZRFGfdp0WFzvy6haUyim3C1i%2BWw%40mail.gmail.com.


Re: Real-time audio processing with django-based app?

2020-08-24 Thread RANGA BHARATH JINKA
Hi,

   Check this. It may be useful for you.
https://stackoverflow.com/questions/46386011/real-time-audio-signal-processing-using-python
All the best

On Tue, Aug 25, 2020 at 4:13 AM Rowan V  wrote:

> Hi all,
>
> I’m interested in building out an app with the following functionality. I
> would like to:
> 1) obtain audio data from a variety of users via a browser
> 2) undertake some analysis of the signal data in real time
> 3) Then create a composite stream of audio data based on transformations
> of the original n users’ audio. More than 1 user’s audio data is input, but
> only a single audio stream is output, and some level of latency on the
> order of a second is fine.
>
> Is this something that I can use Django for, perhaps with Django channels?
> There are some signal processing libraries in python that I would like to
> leverage, if possible, but am having trouble finding examples of folks who
> have set up similar architectures. Perhaps I can use some sort of real-time
> data store such as Kinesis together with some Django components? Or will I
> instead need to do all of my processing on the front end side? Is real-time
> audio processing outside of the scope of something Django-based?
>
> Thanks,
>
> --
> 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/5aaee8fd-bb94-45fc-9d8f-3625b9da516bn%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m316Ex4JC29sH2-eon8%2BqMOtQWQSyFd0wn9Nc9YyCT6TqNw%40mail.gmail.com.


Re: load static in css file

2020-08-24 Thread RANGA BHARATH JINKA
Hi,
 Try this.
 style="background: url(../images/showcase.jpg) no-repeat top center
!important;"
Add these in your settings.py file.
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

  STATIC_URL = '/static/'

  STATICFILES_DIRS = [
 os.path.join(BASE_DIR, 'static')
  ]

   MEDIA_URL = '/images/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')
 Also check the correct path of images. Whether the images are loading
properly by pasting the image path url in the browser.
 All the best.



On Tue, Aug 25, 2020 at 5:46 AM MAMADOU KANTE  wrote:

> I did load static at the top of the file {% load static %}.
> Also I linked the CSS file named style.css. Part of the css file was
> working perfectly. I only had issues with the background image.
>
> On Mon, Aug 24, 2020 at 4:02 PM sapna Choudhary  wrote:
>
>> create a directory named 'static' in the current directory. This
>> directory is used to store images/css files, you can load static in
>> template using {%load static%}  this code block and link under image tag
>> like this {% static 'app_name/img.jpg' %}
>>
>> On Mon, Aug 24, 2020 at 6:16 PM 'Akash Sinha' via Django users <
>> django-users@googlegroups.com> wrote:
>>
>>>
>>> Hi
>>>
>>> Create a folder inside ur project as static and keep ur images,css and
>>> js files into that folder then in your settings.py file define static path.
>>> U need to run python manage.py collect static command on terminal and then
>>> you have to link that css file in HTML
>>>
>>>
>>> Hint: check for Managing static files in official django doc or try
>>> stack overflow.com you will get example to setup static path
>>>
>>>
>>> On Mon, 24 Aug 2020 at 5:37 pm, MAMADOU KANTE
>>>  wrote:
>>> Hi Everybody!
>>> I am trying to set a background image using the STYLE tag with django
>>> template as follows:
>>>  
>>> But when I open the HTML page and inspect the page I receive an image
>>> with width zero. Can anyone help?
>>> When I use the same syntax on a regular HTML without django templates it
>>> works.
>>>
>>> On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent <
>>> uobodoma...@gmail.com> wrote:
>>>
>>> Hello your have to follow the direction where you stored your file .
>>> Generally, in Django you create a static folder then maybe an image files
>>> where you store the images. You should link the image this way src= "{%
>>> static 'images/imag.png' %}"
>>>
>>> On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:
>>>
>>> This may not work as intended if the CSS files are not rendered using
>>> the Django template engine. You have to put the style declaration where
>>> you'd need the image in the ** tag in your template
>>> code. From there you can use the *{% static “images/imag.png” %}*
>>> syntax.
>>> On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:
>>>
>>> tried this buddy yet it is not working
>>>
>>> Regards
>>> Chander Shekhar
>>> (bestcsp)
>>>
>>>
>>> On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:
>>>
>>> {% static 'imag.jpg' %}   instead of this try
>>>
>>> {% static “images/imag.png” %}
>>>
>>> On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar 
>>> wrote:
>>>
>>> I am unable to fetch images from css file .
>>> I have used {% load static %}
>>> {% static 'imag.jpg' %}
>>> buti can't fetch.console is saying image not found.
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.com
>>> 
>>> .
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com
>>> 
>>> .
>>>
>>> --
>>> 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/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.com
>>> 
>>> .
>>>
>>> --
>>> 

Re: How to reset is_active field of auth_user

2020-08-24 Thread Kamakshi Aggarwal
Can you explain it more to me? Its not clear.

On Mon, 24 Aug 2020, 8:04 pm Amresh Giri,  wrote:

> I think this setting can be handled from your IDP side in the application.
>
> On Mon, Aug 24, 2020, 5:46 PM Kamakshi Aggarwal 
> wrote:
>
>> Hi,
>>
>> We are using django application in our company. We are using
>> RemoteUserAuthentication for that(single sign on). Only employees can sign
>> in.
>>  Once employee signs in,is_active filed is set to True by default in
>> auth_user table.
>>
>> Now if user leaves the company how should I set "is_active" field to
>> False.
>>
>> Thanks
>> Kamakshi
>>
>> --
>> 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/CAAK5yVtWjyate%2BNuzv58yq-%2Bo9Kd5wju%3DKVP7iBUOSCGc7YSsw%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAJqzuMGHAvTGfMOFDt%3Dq3wtmJBeTCKL1Ui31vkDsga5ggobuJA%40mail.gmail.com
> 
> .
>

-- 
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/CAAK5yVuvGBEZCGkDNt8825sp%2BPKGezPE855ScLPt4Ltw%2B6J5Xw%40mail.gmail.com.


Re: load static in css file

2020-08-24 Thread MAMADOU KANTE
I did load static at the top of the file {% load static %}.
Also I linked the CSS file named style.css. Part of the css file was
working perfectly. I only had issues with the background image.

On Mon, Aug 24, 2020 at 4:02 PM sapna Choudhary  wrote:

> create a directory named 'static' in the current directory. This directory
> is used to store images/css files, you can load static in template using
> {%load static%}  this code block and link under image tag like this {%
> static 'app_name/img.jpg' %}
>
> On Mon, Aug 24, 2020 at 6:16 PM 'Akash Sinha' via Django users <
> django-users@googlegroups.com> wrote:
>
>>
>> Hi
>>
>> Create a folder inside ur project as static and keep ur images,css and js
>> files into that folder then in your settings.py file define static path. U
>> need to run python manage.py collect static command on terminal and then
>> you have to link that css file in HTML
>>
>>
>> Hint: check for Managing static files in official django doc or try stack
>> overflow.com you will get example to setup static path
>>
>>
>> On Mon, 24 Aug 2020 at 5:37 pm, MAMADOU KANTE
>>  wrote:
>> Hi Everybody!
>> I am trying to set a background image using the STYLE tag with django
>> template as follows:
>>  
>> But when I open the HTML page and inspect the page I receive an image
>> with width zero. Can anyone help?
>> When I use the same syntax on a regular HTML without django templates it
>> works.
>>
>> On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent <
>> uobodoma...@gmail.com> wrote:
>>
>> Hello your have to follow the direction where you stored your file .
>> Generally, in Django you create a static folder then maybe an image files
>> where you store the images. You should link the image this way src= "{%
>> static 'images/imag.png' %}"
>>
>> On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:
>>
>> This may not work as intended if the CSS files are not rendered using the
>> Django template engine. You have to put the style declaration where you'd
>> need the image in the ** tag in your template code. From
>> there you can use the *{% static “images/imag.png” %}* syntax.
>> On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:
>>
>> tried this buddy yet it is not working
>>
>> Regards
>> Chander Shekhar
>> (bestcsp)
>>
>>
>> On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:
>>
>> {% static 'imag.jpg' %}   instead of this try
>>
>> {% static “images/imag.png” %}
>>
>> On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar 
>> wrote:
>>
>> I am unable to fetch images from css file .
>> I have used {% load static %}
>> {% static 'imag.jpg' %}
>> buti can't fetch.console is saying image not found.
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.com
>> 
>> .
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com
>> 
>> .
>>
>> --
>> 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/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.com
>> 
>> .
>>
>> --
>> 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/CACsKspkUCWwQdO_nGB%3DoU61X9qta7_8bFoBJODSF5rZNoVhiyQ%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group 

Real-time audio processing with django-based app?

2020-08-24 Thread Rowan V
Hi all,

I’m interested in building out an app with the following functionality. I 
would like to:
1) obtain audio data from a variety of users via a browser
2) undertake some analysis of the signal data in real time
3) Then create a composite stream of audio data based on transformations of 
the original n users’ audio. More than 1 user’s audio data is input, but 
only a single audio stream is output, and some level of latency on the 
order of a second is fine.

Is this something that I can use Django for, perhaps with Django channels? 
There are some signal processing libraries in python that I would like to 
leverage, if possible, but am having trouble finding examples of folks who 
have set up similar architectures. Perhaps I can use some sort of real-time 
data store such as Kinesis together with some Django components? Or will I 
instead need to do all of my processing on the front end side? Is real-time 
audio processing outside of the scope of something Django-based?

Thanks,

-- 
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/5aaee8fd-bb94-45fc-9d8f-3625b9da516bn%40googlegroups.com.


Re: Stream Webcam and with Button Capture Image

2020-08-24 Thread Samara Muñoz
Hi Ketul, I was wondering if you have had any luck. I was seeing a video
and they use FileSystemStorage(). Do you think it has something to do with
it?

Regards, thanks for your time.

Samara

On Mon, Aug 17, 2020 at 4:32 PM Ketul Suthar  wrote:

> I will let you know. I am also working on same concept.
>
> On Mon., Aug. 17, 2020, 5:19 p.m. samar...@gmail.com, <
> samaram...@gmail.com> wrote:
>
>> Hello, I already achieved opening the webcam in browser, I would like to
>> add a button in a template and every time it is clicked, it saves the frame
>> in a folder ('media')
>> I am new and Django and I don't understand much on how to use views and
>> templates work together.
>>
>> Can someone help me? I uploaded the folder
>>
>> --
>> 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/12f53f21-f406-4ea8-840e-42f01cdac863n%40googlegroups.com
>> 
>> .
>>
> --
> 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/CANuqdaW_ofjaBrnY4Hii6BLE99xKuvYv_cXTB6CDYO7KJuWbbQ%40mail.gmail.com
> 
> .
>

-- 
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/CAA%2Btjr5JagaPwofPh9q4OmTAkcKqFe_s5k531cK_972_5jhLfw%40mail.gmail.com.


Re: load static in css file

2020-08-24 Thread sapna Choudhary
create a directory named 'static' in the current directory. This directory
is used to store images/css files, you can load static in template using
{%load static%}  this code block and link under image tag like this {%
static 'app_name/img.jpg' %}

On Mon, Aug 24, 2020 at 6:16 PM 'Akash Sinha' via Django users <
django-users@googlegroups.com> wrote:

>
> Hi
>
> Create a folder inside ur project as static and keep ur images,css and js
> files into that folder then in your settings.py file define static path. U
> need to run python manage.py collect static command on terminal and then
> you have to link that css file in HTML
>
>
> Hint: check for Managing static files in official django doc or try stack
> overflow.com you will get example to setup static path
>
>
> On Mon, 24 Aug 2020 at 5:37 pm, MAMADOU KANTE
>  wrote:
> Hi Everybody!
> I am trying to set a background image using the STYLE tag with django
> template as follows:
>  
> But when I open the HTML page and inspect the page I receive an image with
> width zero. Can anyone help?
> When I use the same syntax on a regular HTML without django templates it
> works.
>
> On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent <
> uobodoma...@gmail.com> wrote:
>
> Hello your have to follow the direction where you stored your file .
> Generally, in Django you create a static folder then maybe an image files
> where you store the images. You should link the image this way src= "{%
> static 'images/imag.png' %}"
>
> On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:
>
> This may not work as intended if the CSS files are not rendered using the
> Django template engine. You have to put the style declaration where you'd
> need the image in the ** tag in your template code. From
> there you can use the *{% static “images/imag.png” %}* syntax.
> On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:
>
> tried this buddy yet it is not working
>
> Regards
> Chander Shekhar
> (bestcsp)
>
>
> On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:
>
> {% static 'imag.jpg' %}   instead of this try
>
> {% static “images/imag.png” %}
>
> On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar  wrote:
>
> I am unable to fetch images from css file .
> I have used {% load static %}
> {% static 'imag.jpg' %}
> buti can't fetch.console is saying image not found.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.com
> 
> .
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com
> 
> .
>
> --
> 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/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.com
> 
> .
>
> --
> 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/CACsKspkUCWwQdO_nGB%3DoU61X9qta7_8bFoBJODSF5rZNoVhiyQ%40mail.gmail.com
> 
> .
>
> --
> 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/CAOUY%2BRry8CUXbtx9QGhXYoU5c8R92gxG3q32%2B7dFpiPTnNgWaQ%40mail.gmail.com
> 

Python Django Tutorial for absolute beginners

2020-08-24 Thread Balaji Shetty
Dear Participants

   *I am sharing you a video to learn Python Django with development
of project and app. You can download source code of this video also from
github link*

https://www.youtube.com/watch?v=EY-XY2HDo_c

 *Sourcecode*
https://github.com/balaji-shetty/Django-Sample-Proj-With-CODE-For-Begineers


Code to download source code is given in Video Description.

We are uploading new videos every week useful for beginners and provide
respective source code on GitHub


Prof Shetty Balaji
IT dept
SGGS IET Nanded. MH

https://youtu.be/EY-XY2HDo_c


-- 
Mr Shetty Balaji
Asst. Prof.
IT Department
SGGS I
Nanded. My. India

-- 
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/CAECSbOsR0b%3DjiFiXcbOmvvj69XH_kR3bKCLbug1sCqe24PnzEg%40mail.gmail.com.


Re: why style.css is not read by my codes. i am using VScode for Django

2020-08-24 Thread Haris Ahmad
Have you added whitenoise to the settings.py

On Mon, 24 Aug 2020, 9:27 PM Amresh Giri,  wrote:

> Is is supposed to be "statics" ?
>
> On Mon, Aug 24, 2020, 9:49 PM alka reetesh 
> wrote:
>
>> I have used python manage.py collectstatic, which gave
>> error--FileNotFoundError: [WinError 3] The system cannot find the path
>> specified: 'C:\dmform\myproject\statics'
>>
>> --
>> 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/0dd03bb0-3c6c-4e7f-b7d7-9f6f55aae7bbn%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAJqzuMH9YfLHQnj3tESo8cZpYTRqf7uqXitZHdakfVt_2yRFTg%40mail.gmail.com
> 
> .
>

-- 
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/CAG0UDYbWg9NQ6vHNdbWA0UNhb3Td1v7Mc4SxnxCeveywe6AMkg%40mail.gmail.com.


Re: why style.css is not read by my codes. i am using VScode for Django

2020-08-24 Thread Amresh Giri
Is is supposed to be "statics" ?

On Mon, Aug 24, 2020, 9:49 PM alka reetesh  wrote:

> I have used python manage.py collectstatic, which gave
> error--FileNotFoundError: [WinError 3] The system cannot find the path
> specified: 'C:\dmform\myproject\statics'
>
> --
> 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/0dd03bb0-3c6c-4e7f-b7d7-9f6f55aae7bbn%40googlegroups.com
> 
> .
>

-- 
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/CAJqzuMH9YfLHQnj3tESo8cZpYTRqf7uqXitZHdakfVt_2yRFTg%40mail.gmail.com.


Re: why style.css is not read by my codes. i am using VScode for Django

2020-08-24 Thread Shivansh Sen
Try replace \ with \\

Shivansh Sen
India

On Mon, Aug 24, 2020, 21:49 alka reetesh  wrote:

> I have used python manage.py collectstatic, which gave
> error--FileNotFoundError: [WinError 3] The system cannot find the path
> specified: 'C:\dmform\myproject\statics'
>
> --
> 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/0dd03bb0-3c6c-4e7f-b7d7-9f6f55aae7bbn%40googlegroups.com
> 
> .
>

-- 
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/CAOAmnBegx6MuVgzySbRUeMrNHGFeVvc8njwn_9y5tp_hkzZb0A%40mail.gmail.com.


why style.css is not read by my codes. i am using VScode for Django

2020-08-24 Thread alka reetesh
I have used python manage.py collectstatic, which gave 
error--FileNotFoundError: [WinError 3] The system cannot find the path 
specified: 'C:\dmform\myproject\statics' 

-- 
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/0dd03bb0-3c6c-4e7f-b7d7-9f6f55aae7bbn%40googlegroups.com.


Re: How to pass a set of objects in between two views?

2020-08-24 Thread Kunal Solanke
Two things come to my mind
1.Either create a questionlist model with for each user.
2.Bind questionlist to session.

On Mon, Aug 24, 2020, 20:01 vipul shinde  wrote:

> from django.shortcuts import render, redirect
> from .models import *
> from .forms import UserForm
> from django.contrib.auth.forms import AuthenticationForm
> import random
> from django.contrib.auth import login, logout, authenticate
>
> # Create your views here.
> def home(request):
> return render(request, 'testapp/home.html')
>
> def loginuser(request):
> #form = UserForm()
> if request.method == 'GET':
> form = AuthenticationForm()
> return render(request, 'testapp/login.html', {'form':form})
> else:
> user = authenticate(request, username=request.POST['username'],
> password=request.POST['password'])
> if user is None:
> return render(request, 'testapp/login.html',
> {'form':AuthenticationForm(), 'error':'Username or password incorrect'})
> else:
> login(request, user)
> return redirect('paper')
>
> def paper(request):
> #objects = Questions.objects.all()
> """count = Questions.objects.all().count()
> slice = random.random() * (count-5)
> objects = Questions.objects.all()[slice:slice+5]"""
> #objects = {{ objects }}
> objects = Questions.objects.all().order_by('?')[:5]
> return render(request, 'testapp/paper.html', {'objects':objects})
>
> On Mon, Aug 24, 2020 at 7:57 PM hans alexander  wrote:
>
>> Can you share the views.py that you wrote?
>> Actually If the page for random set of questions is same for User NOT
>> Logged In and User Logged In, the data you called from database will still
>> showing up.
>>
>> On Mon, Aug 24, 2020 at 9:19 PM vipul shinde 
>> wrote:
>>
>>>
>>> I'm building a quiz app in which I'm storing questions in the database
>>> by creating a model class. I am retrieving a random question set for each
>>> user from the database and then rendering them on an HTML page. The problem
>>> is after logging a user in, a random set of questions appears but that
>>> random set is lost after refreshing the page.
>>> How do I solve this
>>> One thing that I thought was retrieving the object set in another
>>> viewsay after logging a user in and passing it as a dictionary to
>>> another view.
>>> But I can't find the syntax or any function (if it exists). Please help.
>>> I'm using django 3.1 and MySQL as my database
>>>
>>> --
>>> 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/CANE4xcuDmZCAaB4pzTqvH1d2eGf2b12%2BBPwN90e5_hmK%3DUBeQw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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/CANV3w%3DYE%3DP6OW4cow0q%3D8uocbUSKoi259CJbRWrJYPo7A51oEw%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CANE4xcv3hx8pkaOh0E5xJg4_mOQjdnkGHt_4%3Dq61yZfMVodFyg%40mail.gmail.com
> 
> .
>

-- 
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/CAOecAnyPvTd-m5C1CMky8fjLPtcMMuNDTJZ1y0qgXA0%3DYKxwXg%40mail.gmail.com.


Re: Problem to see file or image uploaded in admin django

2020-08-24 Thread AMINE AZIZ
i found solution

just i need to change media/  to /media/   :)

Le lun. 24 août 2020 à 15:40, Ogunsanya Opeyemi 
a écrit :

> Hi, do you have pillow installed in your library. and look for the image
> in that path in your local directory.
>
>
> On Mon, Aug 24, 2020 at 12:59 PM AMINE AZIZ  wrote:
>
>> Problem to see file or image uploaded in admin django
>>
>> see image below
>>
>> my setting.py
>>
>> 
>>
>> import os
>> from django.utils.translation import gettext_lazy as _
>>
>>
>>
>> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>> LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
>>
>> # Quick-start development settings - unsuitable for production
>> # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
>>
>>
>>
>>
>> # SECURITY WARNING: keep the secret key used in production secret!
>> SECRET_KEY = '##'
>> AUTH_PROFILE_MODULE= 'system.UserProfile'
>> # SECURITY WARNING: don't run with debug turned on in production!
>> DEBUG = True
>> JQUERY_URL = False
>> USE_DJANGO_JQUERY = True
>> ALLOWED_HOSTS = []
>>
>> MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
>> MEDIA_URL = 'media/'
>>
>> LANGUAGES = [
>> ('en', _('English')),
>> ('ar', _('Arabe')),
>> ]
>>
>> INSTALLED_APPS = [
>> 'django.contrib.admin',
>>
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'smart_selects',
>> 'fieldsets_with_inlines',
>> 'easy_thumbnails',
>> 'image_cropping',
>> 'file_resubmit',
>> 'admin_reorder',
>> 'system',
>> ]
>>
>>
>> from easy_thumbnails.conf import Settings as thumbnail_settings
>> THUMBNAIL_PROCESSORS = (
>> 'image_cropping.thumbnail_processors.crop_corners',
>> ) + thumbnail_settings.THUMBNAIL_PROCESSORS
>>
>>
>> CACHES = {
>> 'default': {
>> 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
>> },
>> "file_resubmit": {
>> 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
>> "LOCATION": '/tmp/file_resubmit/'
>> },}
>>
>> MIDDLEWARE = [
>> 'django.middleware.security.SecurityMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> 'django.middleware.common.CommonMiddleware',
>> #'admin_reorder.middleware.ModelAdminReorder',
>> 'django.middleware.csrf.CsrfViewMiddleware',
>> 'django.middleware.locale.LocaleMiddleware',
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware',
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> ]
>>
>> ROOT_URLCONF = 'portail.urls'
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>'DIRS': [os.path.join(BASE_DIR, "templates"),],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>>
>> # Password validation
>> #
>> https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
>>
>> AUTH_PASSWORD_VALIDATORS = [
>> {
>> 'NAME':
>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>> },
>> {
>> 'NAME':
>> 'django.contrib.auth.password_validation.MinimumLengthValidator',
>> },
>> {
>> 'NAME':
>> 'django.contrib.auth.password_validation.CommonPasswordValidator',
>> },
>> {
>> 'NAME':
>> 'django.contrib.auth.password_validation.NumericPasswordValidator',
>> },
>> ]
>>
>>
>> # Internationalization
>> # https://docs.djangoproject.com/en/3.0/topics/i18n/
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>>
>> # Static files (CSS, JavaScript, Images)
>> # https://docs.djangoproject.com/en/3.0/howto/static-files/
>>
>>
>> # Internationalization
>> # https://docs.djangoproject.com/en/3.0/topics/i18n/
>>
>> LANGUAGE_CODE = 'en'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> USE_TZ = True
>>
>> # Static files (CSS, JavaScript, Images)
>> # https://docs.djangoproject.com/en/3.0/howto/static-files/
>>
>> STATIC_URL = '/static/'
>> STATIC_ROOT = os.path.join(BASE_DIR, 'static')
>>
>> 
>>
>> --
>> 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 

Re: Problem to see file or image uploaded in admin django

2020-08-24 Thread Ogunsanya Opeyemi
Hi, do you have pillow installed in your library. and look for the image in
that path in your local directory.


On Mon, Aug 24, 2020 at 12:59 PM AMINE AZIZ  wrote:

> Problem to see file or image uploaded in admin django
>
> see image below
>
> my setting.py
>
> 
>
> import os
> from django.utils.translation import gettext_lazy as _
>
>
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
>
>
>
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '##'
> AUTH_PROFILE_MODULE= 'system.UserProfile'
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
> JQUERY_URL = False
> USE_DJANGO_JQUERY = True
> ALLOWED_HOSTS = []
>
> MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
> MEDIA_URL = 'media/'
>
> LANGUAGES = [
> ('en', _('English')),
> ('ar', _('Arabe')),
> ]
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
>
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'smart_selects',
> 'fieldsets_with_inlines',
> 'easy_thumbnails',
> 'image_cropping',
> 'file_resubmit',
> 'admin_reorder',
> 'system',
> ]
>
>
> from easy_thumbnails.conf import Settings as thumbnail_settings
> THUMBNAIL_PROCESSORS = (
> 'image_cropping.thumbnail_processors.crop_corners',
> ) + thumbnail_settings.THUMBNAIL_PROCESSORS
>
>
> CACHES = {
> 'default': {
> 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
> },
> "file_resubmit": {
> 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
> "LOCATION": '/tmp/file_resubmit/'
> },}
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> #'admin_reorder.middleware.ModelAdminReorder',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.middleware.locale.LocaleMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'portail.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>'DIRS': [os.path.join(BASE_DIR, "templates"),],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
>
> # Password validation
> #
> https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/3.0/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/3.0/howto/static-files/
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/3.0/topics/i18n/
>
> LANGUAGE_CODE = 'en'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/3.0/howto/static-files/
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'static')
>
> 
>
> --
> 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/782e3c34-27d2-4b27-b258-1fe40aeac128n%40googlegroups.com
> 

Re: How to reset is_actibe field of auth_user

2020-08-24 Thread Amresh Giri
I think this setting can be handled from your IDP side in the application.

On Mon, Aug 24, 2020, 5:46 PM Kamakshi Aggarwal 
wrote:

> Hi,
>
> We are using django application in our company. We are using
> RemoteUserAuthentication for that(single sign on). Only employees can sign
> in.
>  Once employee signs in,is_active filed is set to True by default in
> auth_user table.
>
> Now if user leaves the company how should I set "is_active" field to False.
>
> Thanks
> Kamakshi
>
> --
> 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/CAAK5yVtWjyate%2BNuzv58yq-%2Bo9Kd5wju%3DKVP7iBUOSCGc7YSsw%40mail.gmail.com
> 
> .
>

-- 
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/CAJqzuMGHAvTGfMOFDt%3Dq3wtmJBeTCKL1Ui31vkDsga5ggobuJA%40mail.gmail.com.


Re: How to pass a set of objects in between two views?

2020-08-24 Thread vipul shinde
from django.shortcuts import render, redirect
from .models import *
from .forms import UserForm
from django.contrib.auth.forms import AuthenticationForm
import random
from django.contrib.auth import login, logout, authenticate

# Create your views here.
def home(request):
return render(request, 'testapp/home.html')

def loginuser(request):
#form = UserForm()
if request.method == 'GET':
form = AuthenticationForm()
return render(request, 'testapp/login.html', {'form':form})
else:
user = authenticate(request, username=request.POST['username'],
password=request.POST['password'])
if user is None:
return render(request, 'testapp/login.html',
{'form':AuthenticationForm(), 'error':'Username or password incorrect'})
else:
login(request, user)
return redirect('paper')

def paper(request):
#objects = Questions.objects.all()
"""count = Questions.objects.all().count()
slice = random.random() * (count-5)
objects = Questions.objects.all()[slice:slice+5]"""
#objects = {{ objects }}
objects = Questions.objects.all().order_by('?')[:5]
return render(request, 'testapp/paper.html', {'objects':objects})

On Mon, Aug 24, 2020 at 7:57 PM hans alexander  wrote:

> Can you share the views.py that you wrote?
> Actually If the page for random set of questions is same for User NOT
> Logged In and User Logged In, the data you called from database will still
> showing up.
>
> On Mon, Aug 24, 2020 at 9:19 PM vipul shinde 
> wrote:
>
>>
>> I'm building a quiz app in which I'm storing questions in the database by
>> creating a model class. I am retrieving a random question set for each user
>> from the database and then rendering them on an HTML page. The problem is
>> after logging a user in, a random set of questions appears but that random
>> set is lost after refreshing the page.
>> How do I solve this
>> One thing that I thought was retrieving the object set in another
>> viewsay after logging a user in and passing it as a dictionary to
>> another view.
>> But I can't find the syntax or any function (if it exists). Please help.
>> I'm using django 3.1 and MySQL as my database
>>
>> --
>> 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/CANE4xcuDmZCAaB4pzTqvH1d2eGf2b12%2BBPwN90e5_hmK%3DUBeQw%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CANV3w%3DYE%3DP6OW4cow0q%3D8uocbUSKoi259CJbRWrJYPo7A51oEw%40mail.gmail.com
> 
> .
>

-- 
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/CANE4xcv3hx8pkaOh0E5xJg4_mOQjdnkGHt_4%3Dq61yZfMVodFyg%40mail.gmail.com.


Re: How to pass a set of objects in between two views?

2020-08-24 Thread hans alexander
Can you share the views.py that you wrote?
Actually If the page for random set of questions is same for User NOT
Logged In and User Logged In, the data you called from database will still
showing up.

On Mon, Aug 24, 2020 at 9:19 PM vipul shinde 
wrote:

>
> I'm building a quiz app in which I'm storing questions in the database by
> creating a model class. I am retrieving a random question set for each user
> from the database and then rendering them on an HTML page. The problem is
> after logging a user in, a random set of questions appears but that random
> set is lost after refreshing the page.
> How do I solve this
> One thing that I thought was retrieving the object set in another
> viewsay after logging a user in and passing it as a dictionary to
> another view.
> But I can't find the syntax or any function (if it exists). Please help.
> I'm using django 3.1 and MySQL as my database
>
> --
> 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/CANE4xcuDmZCAaB4pzTqvH1d2eGf2b12%2BBPwN90e5_hmK%3DUBeQw%40mail.gmail.com
> 
> .
>

-- 
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/CANV3w%3DYE%3DP6OW4cow0q%3D8uocbUSKoi259CJbRWrJYPo7A51oEw%40mail.gmail.com.


How to pass a set of objects in between two views?

2020-08-24 Thread vipul shinde
I'm building a quiz app in which I'm storing questions in the database by
creating a model class. I am retrieving a random question set for each user
from the database and then rendering them on an HTML page. The problem is
after logging a user in, a random set of questions appears but that random
set is lost after refreshing the page.
How do I solve this
One thing that I thought was retrieving the object set in another
viewsay after logging a user in and passing it as a dictionary to
another view.
But I can't find the syntax or any function (if it exists). Please help.
I'm using django 3.1 and MySQL as my database

-- 
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/CANE4xcuDmZCAaB4pzTqvH1d2eGf2b12%2BBPwN90e5_hmK%3DUBeQw%40mail.gmail.com.


Re: load static in css file

2020-08-24 Thread 'Akash Sinha' via Django users

Hi
Create a folder inside ur project as static and keep ur images,css and js files 
into that folder then in your settings.py file define static path. U need to 
run python manage.py collect static command on terminal and then you have to 
link that css file in HTML

Hint: check for Managing static files in official django doc or try stack 
overflow.com you will get example to setup static path
 
 
  On Mon, 24 Aug 2020 at 5:37 pm, MAMADOU KANTE wrote:   Hi 
Everybody!I am trying to set a background image using the STYLE tag with django 
template as follows: But when I open the 
HTML page and inspect the page I receive an image with width zero. Can anyone 
help?When I use the same syntax on a regular HTML without django templates it 
works.
On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent  
wrote:

Hello your have to follow the direction where you stored your file . Generally, 
in Django you create a static folder then maybe an image files where you store 
the images. You should link the image this way src= "{% static 
'images/imag.png' %}"
On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:

This may not work as intended if the CSS files are not rendered using the 
Django template engine. You have to put the style declaration where you'd need 
the image in the  tag in your template code. From there you can 
use the {% static “images/imag.png” %} syntax.
On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:

tried this buddy yet it is not working
Regards
Chander Shekhar
(bestcsp)


On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:

{% static 'imag.jpg' %}   instead of this try
{% static “images/imag.png” %}
On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar  wrote:

I am unable to fetch images from css file .I have used {% load static %}{% 
static 'imag.jpg' %}buti can't fetch.console is saying image not found.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.com.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com.




-- 
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/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.com.



-- 
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/CACsKspkUCWwQdO_nGB%3DoU61X9qta7_8bFoBJODSF5rZNoVhiyQ%40mail.gmail.com.



-- 
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/CAOUY%2BRry8CUXbtx9QGhXYoU5c8R92gxG3q32%2B7dFpiPTnNgWaQ%40mail.gmail.com.
  

-- 
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/1004603577.4391205.1598272002937%40mail.yahoo.com.


How to reset is_actibe field of auth_user

2020-08-24 Thread Kamakshi Aggarwal
Hi,

We are using django application in our company. We are using
RemoteUserAuthentication for that(single sign on). Only employees can sign
in.
 Once employee signs in,is_active filed is set to True by default in
auth_user table.

Now if user leaves the company how should I set "is_active" field to False.

Thanks
Kamakshi

-- 
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/CAAK5yVtWjyate%2BNuzv58yq-%2Bo9Kd5wju%3DKVP7iBUOSCGc7YSsw%40mail.gmail.com.


Re: load static in css file

2020-08-24 Thread MAMADOU KANTE
Hi Everybody!
I am trying to set a background image using the STYLE tag with django
template as follows:
 
But when I open the HTML page and inspect the page I receive an image with
width zero. Can anyone help?
When I use the same syntax on a regular HTML without django templates it
works.

On Mon, Aug 3, 2020 at 10:02 AM Obodoma Uzondu Vincent <
uobodoma...@gmail.com> wrote:

> Hello your have to follow the direction where you stored your file .
> Generally, in Django you create a static folder then maybe an image files
> where you store the images. You should link the image this way src= "{%
> static 'images/imag.png' %}"
>
> On Mon, 3 Aug 2020, 10:06 Yemin Sajid,  wrote:
>
>> This may not work as intended if the CSS files are not rendered using the
>> Django template engine. You have to put the style declaration where you'd
>> need the image in the ** tag in your template code. From
>> there you can use the *{% static “images/imag.png” %}* syntax.
>> On Friday, July 31, 2020 at 5:58:48 PM UTC+6 Chander shekhar wrote:
>>
>>> tried this buddy yet it is not working
>>>
>>> Regards
>>> Chander Shekhar
>>> (bestcsp)
>>>
>>>
>>> On Thu, Jul 30, 2020 at 6:11 PM Irfan Khan  wrote:
>>>
 {% static 'imag.jpg' %}   instead of this try

 {% static “images/imag.png” %}

 On Thu, 30 Jul 2020 at 6:07 PM, Chander shekhar 
 wrote:

> I am unable to fetch images from css file .
> I have used {% load static %}
> {% static 'imag.jpg' %}
> buti can't fetch.console is saying image not found.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/554cbaf1-3b94-40b4-a0f1-efe0bd3f24ceo%40googlegroups.com
> 
> .
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CALKGVio%3DAsCafgcd-zfjBb2of-RWbPaTwwGjf7sXbjstgFdM6Q%40mail.gmail.com
 
 .

>>> --
>> 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/f0e45bd1-68ca-405f-a033-c808d6da53d5n%40googlegroups.com
>> 
>> .
>>
> --
> 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/CACsKspkUCWwQdO_nGB%3DoU61X9qta7_8bFoBJODSF5rZNoVhiyQ%40mail.gmail.com
> 
> .
>

-- 
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/CAOUY%2BRry8CUXbtx9QGhXYoU5c8R92gxG3q32%2B7dFpiPTnNgWaQ%40mail.gmail.com.


Problem to see file or image uploaded in admin django

2020-08-24 Thread AMINE AZIZ
Problem to see file or image uploaded in admin django 

see image below

my setting.py 



import os
from django.utils.translation import gettext_lazy as _

 

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/




# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '##'
AUTH_PROFILE_MODULE= 'system.UserProfile'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
JQUERY_URL = False
USE_DJANGO_JQUERY = True
ALLOWED_HOSTS = []

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = 'media/'

LANGUAGES = [
('en', _('English')),
('ar', _('Arabe')),
]

INSTALLED_APPS = [
'django.contrib.admin',

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'smart_selects',
'fieldsets_with_inlines',
'easy_thumbnails',
'image_cropping',
'file_resubmit',
'admin_reorder',
'system',
]


from easy_thumbnails.conf import Settings as thumbnail_settings
THUMBNAIL_PROCESSORS = (
'image_cropping.thumbnail_processors.crop_corners',
) + thumbnail_settings.THUMBNAIL_PROCESSORS


CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
"file_resubmit": {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
"LOCATION": '/tmp/file_resubmit/'
},}

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
#'admin_reorder.middleware.ModelAdminReorder',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'portail.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
   'DIRS': [os.path.join(BASE_DIR, "templates"),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
 

# Password validation
# 
https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')



-- 
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/782e3c34-27d2-4b27-b258-1fe40aeac128n%40googlegroups.com.


Re: A question about running Channels and Django code under Celery

2020-08-24 Thread shahee...@gmail.com
Perhaps I should have known, but didn't: Celery 4.x does not support 
asyncio (celery#3883 , 
celery#3884 ). Luckily, this 
was explained over at channels_rabbitmq#25 
. From there, a 
subprocess based fix was easy...once I became aware of channels_rabbitmq#13 
. TL;DR:


   - You cannot naively call into Channels (or any other) async code from 
   inside a Celery task (until Celery 5).
   - You cannot naively call async_to_sync() et. al. Some awareness of the 
   scope of the event loop(s) that underpin the system is required, or a belt 
   and braces type workaround.
   
Thanks, Shaheed

P.S. I went down this rabbit hole partly because, at the time of my 
original posting, I had not noticed that the exception noted below was 
still happening AND when I moved off my development system onto an AWS 
deployment setup, everything stopped working.


On Saturday, 22 August 2020 at 14:52:33 UTC+1 shahee...@gmail.com wrote:

> I have a question about running Channels and Django code under Celery. 
> Originally, I had some code that used neither Channels nor Celery, but 
> simply run as part of the View code:
>
> def import_all(...)
>
> ...database access...
>
>
> This is an expensive operation and to avoid timing out the browser, I 
> needed to (a) run it under Celery but also (b) provide progress updates via 
> a Websocket to the client. First, I implemented (b) using a Channels 
> Consumer and the group_send, and that worked fine. I then tried to 
> implement (a) using a Celery Task:
>
> @task
>
> def import_all(...):
> ...database access...
> async_to_sync(group_send)(...)
>
>
> However, this caused Celery to be unhappy and the worker to die:
>
> ...
> 2020-08-22 13:33:08,303 [ERROR] MainProcess: Task handler raised error: 
> WorkerLostError('Worker exited prematurely: exitcode 0.') 
> Traceback (most recent call last): 
>  File 
> "/usr/local/lib/python3.8/dist-packages/billiard-3.6.3.0-py3.8.egg/billiard/pool.py",
>  
> line 1265, in mark_as_worker_lost 
>raise WorkerLostError( 
> billiard.exceptions.WorkerLostError: Worker exited prematurely: exitcode 0.
>
> After quite some Googling, and various detours including where the 
> DataBase access caused issues (it seems it cannot be run from an async 
> context), I ended up with this double-wrapped monster:
>
> @task
>
> def import_all(...):
> async_to_sync(_import_all)(...)
>
> async def _import_all(...):
> await database_sync_to_async(__import_all)(...)
>
> def __import_all(...):   << original code
> ...database access...
> async_to_sync(group_send)(...)
>
>
> This seems to work (even though the Celery task eventually dies, it seems 
> to have done its work first, and is replaced). Is this double-wrapping 
> really the correct approach? Even if it is clumsy, is there any reason to 
> think it won't be reliable?
>
> TIA, Shaheed
>
> P.S. I should mention that I am using Celery's prefork library, as 
> opposed to say gevent or greenlets. 
>
>
>
>
>
>
>
>
>
>
>
>
>

-- 
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/ef21c366-66b2-4760-a74f-415466695a55n%40googlegroups.com.


Re: hello every one. i have a probleme with 'pip install mysqlclient' please i need a help

2020-08-24 Thread RANGA BHARATH JINKA
Hi,

Please check the location of the .whl file. Copy .whl file into your
project root folder and install. All the best.

On Mon, Aug 24, 2020 at 1:04 PM Makan Leboss 
wrote:

> *my error code is:* " (myvenv) c:\djangoboys\dagakane>pip install
> mysqlclient-1.4.6-cp38-cp38-win32.whl
> WARNING: Requirement 'mysqlclient-1.4.6-cp38-cp38-win32.whl' looks like a
> filename, but the file does not exist
> Processing .\mysqlclient-1.4.6-cp38-cp38-win32.whl
> ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No
> such file or directory:
> 'C:\\djangoboys\\dagakane\\mysqlclient-1.4.6-cp38-cp38-win32.whl "
>
> --
> 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/361b2ead-b72f-4458-b564-354062be2975n%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m314ORJJ2-4z0uv9ZvKDk3-WQzhxxC7_8N%3DWGFW1wAbO59g%40mail.gmail.com.


Re: Sources for learning django

2020-08-24 Thread Setiawan Karnata
Dear All,

Thank your for the info.
Is there any specific Youtube channel/ebook pdf that explain/present how to
make web application with Django using database PostgreSQL for beginner
level? Thanks.

Regards,
Setiawan

On Mon, Aug 24, 2020 at 4:06 AM 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> Yo start with you can implement the Django in - built authentication
> system . You will learn a lot
>
> Sent from Yahoo Mail on Android
> 
>
> On Fri, 21 Aug 2020 at 4:00, Mohamed Ghoneim
>  wrote:
> Hey guys,
>
> can any one tell me  name of books , websites or youtube channels  which
> are good to learn django .
>
> i also want to ask ,how long does it take to learn django ?
>
> Thanks .
>
> --
> 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/5acb085e-246d-4802-9d23-b87b501918c9n%40googlegroups.com
> 
> .
>
> --
> 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/1482317931.3525134.1598216714045%40mail.yahoo.com
> 
> .
>

-- 
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/CALvAhLqvtnis3KQce6x1Qu0oEfja47SLeXfqHcnzH9CaCpx62Q%40mail.gmail.com.


hello every one. i have a probleme with 'pip install mysqlclient' please i need a help

2020-08-24 Thread Makan Leboss
*my error code is:* " (myvenv) c:\djangoboys\dagakane>pip install 
mysqlclient-1.4.6-cp38-cp38-win32.whl
WARNING: Requirement 'mysqlclient-1.4.6-cp38-cp38-win32.whl' looks like a 
filename, but the file does not exist
Processing .\mysqlclient-1.4.6-cp38-cp38-win32.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No 
such file or directory: 
'C:\\djangoboys\\dagakane\\mysqlclient-1.4.6-cp38-cp38-win32.whl "

-- 
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/361b2ead-b72f-4458-b564-354062be2975n%40googlegroups.com.