Re: STATIC FILE

2022-11-09 Thread Chukwudi Onwusa
I think you should make your work more organized, iff I truly understand
you, by putting your static directory inside your working directory.

On Thu, Nov 10, 2022, 04:25 Mh Raffi  wrote:

> Media url in settings I have.
>
> On Thu, Nov 10, 2022, 8:50 AM ritik sahoo  wrote:
>
>> You must import media url
>>
>> On Wed, 9 Nov, 2022, 8:58 pm Mh Raffi,  wrote:
>>
>>> Hi,
>>> I run cmd to collect static files but files are stored in c:\ but not in
>>> the actual project folder.
>>> My project folder is on the desktop.
>>> while running the command am into that root folder of the project.
>>> and i have images that are also not stored. I have an app in railway
>>> host and debug in a false  mode.
>>> I tried the option of white noise and it was still the same.
>>> Can anyone let me know where I am missing?
>>>
>>>
>>> Thanks & Regards
>>> Mohammed Raffi.J
>>>
>>>
>>> --
>>> 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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%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/CAJwehCvguwsmDq9C9ohWWSmt%2BrORyT03ZSKhGStj1h9e8aLzDg%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/CAKfPRhV6POFbXFhiK%2BvyyZguAyk5WEw4LGt506V2kV2MWg8EYg%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/CAGoV8n%3DjC5r%2BRo-9ma7OXBczg0792dp%2BW-B-NFQLR4UWHWw%2BXg%40mail.gmail.com.


Re: STATIC FILE

2022-11-09 Thread Mh Raffi
Media url in settings I have.

On Thu, Nov 10, 2022, 8:50 AM ritik sahoo  wrote:

> You must import media url
>
> On Wed, 9 Nov, 2022, 8:58 pm Mh Raffi,  wrote:
>
>> Hi,
>> I run cmd to collect static files but files are stored in c:\ but not in
>> the actual project folder.
>> My project folder is on the desktop.
>> while running the command am into that root folder of the project.
>> and i have images that are also not stored. I have an app in railway host
>> and debug in a false  mode.
>> I tried the option of white noise and it was still the same.
>> Can anyone let me know where I am missing?
>>
>>
>> Thanks & Regards
>> Mohammed Raffi.J
>>
>>
>> --
>> 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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%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/CAJwehCvguwsmDq9C9ohWWSmt%2BrORyT03ZSKhGStj1h9e8aLzDg%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/CAKfPRhV6POFbXFhiK%2BvyyZguAyk5WEw4LGt506V2kV2MWg8EYg%40mail.gmail.com.


Re: STATIC FILE

2022-11-09 Thread Mh Raffi
I have that configuration setup.

Images are not loading and collect static is collecting in c drive but my
project is in desktop.

On Thu, Nov 10, 2022, 8:50 AM ritik sahoo  wrote:

> You must import media url
>
> On Wed, 9 Nov, 2022, 8:58 pm Mh Raffi,  wrote:
>
>> Hi,
>> I run cmd to collect static files but files are stored in c:\ but not in
>> the actual project folder.
>> My project folder is on the desktop.
>> while running the command am into that root folder of the project.
>> and i have images that are also not stored. I have an app in railway host
>> and debug in a false  mode.
>> I tried the option of white noise and it was still the same.
>> Can anyone let me know where I am missing?
>>
>>
>> Thanks & Regards
>> Mohammed Raffi.J
>>
>>
>> --
>> 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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%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/CAJwehCvguwsmDq9C9ohWWSmt%2BrORyT03ZSKhGStj1h9e8aLzDg%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/CAKfPRhU%2BaU3uxCCBfp2YR%3DsuCL%2Bd1vWwoXmDj0jH3bu0qLzZPA%40mail.gmail.com.


Re: STATIC FILE

2022-11-09 Thread ritik sahoo
You must import media url

On Wed, 9 Nov, 2022, 8:58 pm Mh Raffi,  wrote:

> Hi,
> I run cmd to collect static files but files are stored in c:\ but not in
> the actual project folder.
> My project folder is on the desktop.
> while running the command am into that root folder of the project.
> and i have images that are also not stored. I have an app in railway host
> and debug in a false  mode.
> I tried the option of white noise and it was still the same.
> Can anyone let me know where I am missing?
>
>
> Thanks & Regards
> Mohammed Raffi.J
>
>
> --
> 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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%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/CAJwehCvguwsmDq9C9ohWWSmt%2BrORyT03ZSKhGStj1h9e8aLzDg%40mail.gmail.com.


Re: Combining two subquery counts using ORM

2022-11-09 Thread Ross Meredith
Last time I checked you can't use subquery inside the FROM clause.  If you
can please let me know how because I had this a while back and got stuck.
I ended up using a package called django-cte.

On Wed, Nov 9, 2022 at 9:01 PM Matthew Hegarty  wrote:

> Thanks
>
> I made some progress, and this gets me most of the way there (only the
> total count is wrong at present)
>
> def get_queryset(self):
> created_q = Q(created__gte=self.start_date) &
> Q(created__lt=self.end_date)
> completed_q = Q(completed__gte=self.start_date) &
> Q(completed__lt=self.end_date)
> opened_cnt = Count("type__name", filter=created_q)
> completed_cnt = Count("type__name", filter=completed_q)
> total_cnt = Count("type__name", filter=Q(created_q | completed_q))
> qs = (
> self.model.objects.filter(...)
> .values("type__name")
> .annotate(num_opened=opened_cnt)
> .annotate(num_completed=completed_cnt)
> .annotate(total=total_cnt)
> )
> return qs
>
> On Wednesday, 9 November 2022 at 20:46:15 UTC julika...@gmail.com wrote:
>
>> Post your model here and we do it
>>
>> On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty  wrote:
>>
>>> My question is about translating a SQL query to the ORM.
>>>
>>> I want to combine the output of two queries into one.  The query is
>>> counting records in the same table (Task) using two different fields.
>>>
>>> The query is:
>>>
>>> select q1.taskname, q1.count, q2.count, (q1.count + q2.count) as total
>>> from (
>>>   select ptt.name as taskname, count(1) from task pt
>>>   inner join tasktype ptt on pt.type_id = ptt.id
>>>where pt.created >= '2022-11-05T00:00:00+00:00'::timestamptz
>>>   group by ptt.name) q1
>>> left join (
>>>   select ptt.name as taskname, count(1) from task pt
>>>   inner join tasktype ptt on pt.type_id = ptt.id
>>>  where pt.completed >= '2022-11-05T00:00:00+00:00'::timestamptz
>>>   group by ptt.name) q2
>>> on q1.taskname = q2.taskname
>>>
>>> This gives an example output of
>>>
>>> taskname count1  count2   total
>>> ===
>>> 1st review8   4  12
>>> 2nd review4  13  17
>>>
>>> This works fine using raw SQL, but is it possible to do this using the
>>> ORM?
>>>
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAAcKVnmMWftvzceQJeBFYMKfBuOHZVgRGi%3D8BvoZts%3DaUY%2Bmyg%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/2abbf194-71a1-4c45-8671-e2de3accefc1n%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/CAA1Tdz3%3DaNJOZx4Y9WCWFk-QyZKOKt8s7ynVFoE6UzJZieH2aA%40mail.gmail.com.


formulaire dynamique

2022-11-09 Thread Arnold Falanga
Bonjour 
quelqu'un peut m'aider à concevoir un formulaire dynamique avec Django[image: 
capture_jupiter.png] 
l'idée est d'avoir deux parties dans ce formulaire .
un lien pour ajouter les lignes 

-- 
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/18632a8b-8be0-4088-b0a1-47e045c589f1n%40googlegroups.com.


Re: Combining two subquery counts using ORM

2022-11-09 Thread Matthew Hegarty
Thanks

I made some progress, and this gets me most of the way there (only the 
total count is wrong at present)

def get_queryset(self):
created_q = Q(created__gte=self.start_date) & 
Q(created__lt=self.end_date)
completed_q = Q(completed__gte=self.start_date) & 
Q(completed__lt=self.end_date)
opened_cnt = Count("type__name", filter=created_q)
completed_cnt = Count("type__name", filter=completed_q)
total_cnt = Count("type__name", filter=Q(created_q | completed_q))
qs = (
self.model.objects.filter(...)
.values("type__name")
.annotate(num_opened=opened_cnt)
.annotate(num_completed=completed_cnt)
.annotate(total=total_cnt)
)
return qs

On Wednesday, 9 November 2022 at 20:46:15 UTC julika...@gmail.com wrote:

> Post your model here and we do it
>
> On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty  wrote:
>
>> My question is about translating a SQL query to the ORM.
>>
>> I want to combine the output of two queries into one.  The query is 
>> counting records in the same table (Task) using two different fields.
>>
>> The query is:
>>
>> select q1.taskname, q1.count, q2.count, (q1.count + q2.count) as total 
>> from (
>>   select ptt.name as taskname, count(1) from task pt
>>   inner join tasktype ptt on pt.type_id = ptt.id
>>where pt.created >= '2022-11-05T00:00:00+00:00'::timestamptz
>>   group by ptt.name) q1
>> left join (
>>   select ptt.name as taskname, count(1) from task pt
>>   inner join tasktype ptt on pt.type_id = ptt.id
>>  where pt.completed >= '2022-11-05T00:00:00+00:00'::timestamptz
>>   group by ptt.name) q2
>> on q1.taskname = q2.taskname
>>
>> This gives an example output of 
>>
>> taskname count1  count2   total
>> ===
>> 1st review8   4  12
>> 2nd review4  13  17
>>
>> This works fine using raw SQL, but is it possible to do this using the 
>> ORM?
>>
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAAcKVnmMWftvzceQJeBFYMKfBuOHZVgRGi%3D8BvoZts%3DaUY%2Bmyg%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/2abbf194-71a1-4c45-8671-e2de3accefc1n%40googlegroups.com.


Re: Combining two subquery counts using ORM

2022-11-09 Thread kateregga julius
Post your model here and we do it

On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty  wrote:

> My question is about translating a SQL query to the ORM.
>
> I want to combine the output of two queries into one.  The query is
> counting records in the same table (Task) using two different fields.
>
> The query is:
>
> select q1.taskname, q1.count, q2.count, (q1.count + q2.count) as total
> from (
>   select ptt.name as taskname, count(1) from task pt
>   inner join tasktype ptt on pt.type_id = ptt.id
>where pt.created >= '2022-11-05T00:00:00+00:00'::timestamptz
>   group by ptt.name) q1
> left join (
>   select ptt.name as taskname, count(1) from task pt
>   inner join tasktype ptt on pt.type_id = ptt.id
>  where pt.completed >= '2022-11-05T00:00:00+00:00'::timestamptz
>   group by ptt.name) q2
> on q1.taskname = q2.taskname
>
> This gives an example output of
>
> taskname count1  count2   total
> ===
> 1st review8   4  12
> 2nd review4  13  17
>
> This works fine using raw SQL, but is it possible to do this using the ORM?
>
> 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/CAAcKVnmMWftvzceQJeBFYMKfBuOHZVgRGi%3D8BvoZts%3DaUY%2Bmyg%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/CAMVv_-EERCWrqmTmFrKJCNjRnzuX-xeuJ_O3qvkS1TCLX%3D-o6w%40mail.gmail.com.


Re: You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2022-11-09 Thread Chukwudi Onwusa
Please What exactly is the name of your error?
Is it showing 'page not found' ?
If so, then kindly apply the urls to your localhost:8000/urls_name
Regards...

On Wed, Nov 9, 2022, 18:26 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 09/11/2022 10.52, Priyanka Sivaratri wrote:
> > Hi,
> > I am new to django and I appreciate your quick help. I am able to run
> > django server on localhost:8000 but I am seeing this error :
> > *You are seeing this page because DEBUG=True is in your settings file
> > and you have not configured any URLs.*
>
> The error message tells you exactly what is wrong. If you don't
> understand it I highly suggest you follow the official Django tutorial
> before going any further:
>
> https://docs.djangoproject.com/en/4.1/intro/
>
> After that it should be much clearer what is wrong with your URL
> configuration.
>
> Kind regards,
> Kasper Laudrup
>
> --
> 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/84b0068d-2441-ad9f-aa6e-dfea764b51fa%40stacktrace.dk
> .
>

-- 
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/CAGoV8nk43zs%3D%3Dn7RX_c3vUb24-zQUOX-fUhz3qJ0qtU1c%3D0mEQ%40mail.gmail.com.


Re: You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2022-11-09 Thread 'Kasper Laudrup' via Django users

On 09/11/2022 10.52, Priyanka Sivaratri wrote:

Hi,
I am new to django and I appreciate your quick help. I am able to run 
django server on localhost:8000 but I am seeing this error :
*You are seeing this page because DEBUG=True is in your settings file 
and you have not configured any URLs.*


The error message tells you exactly what is wrong. If you don't 
understand it I highly suggest you follow the official Django tutorial 
before going any further:


https://docs.djangoproject.com/en/4.1/intro/

After that it should be much clearer what is wrong with your URL 
configuration.


Kind regards,
Kasper Laudrup

--
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/84b0068d-2441-ad9f-aa6e-dfea764b51fa%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Combining two subquery counts using ORM

2022-11-09 Thread Matthew Hegarty
My question is about translating a SQL query to the ORM.

I want to combine the output of two queries into one.  The query is
counting records in the same table (Task) using two different fields.

The query is:

select q1.taskname, q1.count, q2.count, (q1.count + q2.count) as total from
(
  select ptt.name as taskname, count(1) from task pt
  inner join tasktype ptt on pt.type_id = ptt.id
   where pt.created >= '2022-11-05T00:00:00+00:00'::timestamptz
  group by ptt.name) q1
left join (
  select ptt.name as taskname, count(1) from task pt
  inner join tasktype ptt on pt.type_id = ptt.id
 where pt.completed >= '2022-11-05T00:00:00+00:00'::timestamptz
  group by ptt.name) q2
on q1.taskname = q2.taskname

This gives an example output of

taskname count1  count2   total
===
1st review8   4  12
2nd review4  13  17

This works fine using raw SQL, but is it possible to do this using the ORM?

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/CAAcKVnmMWftvzceQJeBFYMKfBuOHZVgRGi%3D8BvoZts%3DaUY%2Bmyg%40mail.gmail.com.


Re: STATIC FILE

2022-11-09 Thread Lakshyaraj Dash
Set the STATIC_ROOT conf as follows
import os # ignore if once imported
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

Also see of you've allowed that particular host.

Thanks and Regards
Lakshyaraj Dash

On Wed, Nov 9, 2022, 20:57 Mh Raffi  wrote:

> Hi,
> I run cmd to collect static files but files are stored in c:\ but not in
> the actual project folder.
> My project folder is on the desktop.
> while running the command am into that root folder of the project.
> and i have images that are also not stored. I have an app in railway host
> and debug in a false  mode.
> I tried the option of white noise and it was still the same.
> Can anyone let me know where I am missing?
>
>
> Thanks & Regards
> Mohammed Raffi.J
>
>
> --
> 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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%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/CAF7qQgBJe0v4JBU_MQ2YJbzEQ1gzttgRz4OfUhdK87soS4VQgw%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread Ahmed omar miladi
you can use the function send mail of django

Téléchargez Outlook pour iOS

De : django-users@googlegroups.com  de la part 
de It's Aladdin 
Envoyé : Wednesday, November 9, 2022 12:06:33 PM
À : django-users@googlegroups.com 
Objet : Re: Email Sending In Django not working

Google hast stopped less secure apps, so u cant send email messages anymore 
with ur email and password, U will have to find some other way of sending mails.

On Wed, 9 Nov, 2022, 16:26 peteru mimo, 
mailto:peterumi...@gmail.com>> wrote:
Good day team,

I have been facing this challenge in sending mail in django

here is the error "A connection attempt failed because the connected party did 
not properly respond after a period of time, or established connection failed 
because connected host has failed to respond"

Code
def send_verification_email(request, user):
from_email = settings.DEFAULT_FROM_EMAIL
current_site = get_current_site(request)
mail_subject = 'Please activate your account'
message = 
render_to_string('accounts/emails/account_verification_email.html', {
'user': user,
'domain': current_site,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
to_email = user.email
mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
mail.send()

Settings
EMAIL_HOST = 'smtp.google.com'
EMAIL_POST = '587'
EMAIL_HOST_USER = 'myemail'
EMAIL_HOST_PASSWORD = 'email_password'
EMAIL_USE_TLS = True

Any solution will be appreciated. Thank you


--
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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%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/AS8P193MB1158CD635697F8E3E8596FF0AE3E9%40AS8P193MB1158.EURP193.PROD.OUTLOOK.COM.


Re: Email Sending In Django not working

2022-11-09 Thread Lakshyaraj Dash
Even if Google has stopped the support, emails can be still sent using two
step verification and generating app passwords after enabling two step
verification. Please update you email password with the generated app
password.

Steps:
1. Go to manage my Google account
2. Go to security tab
3. Enable two step verification and verify yourself
4. Create your app passwords after the app passwords in the security
settings is visible
5. Select the app name (or add your custom app name) and click generate.
6. Copy the app password as it's view once and cannot be viewed after the
pop up is closed.
7. Go to your settings.py file and replace your actual email password with
the generated app password.

Yay! You're all set.

Dear It's Alladin, please try this also to the one who asked this question
please try it once.

Thanks and Regards
Lakshyaraj Dash

On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:

> Google hast stopped less secure apps, so u cant send email messages
> anymore with ur email and password, U will have to find some other way of
> sending mails.
>
> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>
>> Good day team,
>>
>> I have been facing this challenge in sending mail in django
>>
>> here is the error *"A connection attempt failed because the connected
>> party did not properly respond after a period of time, or established
>> connection failed because connected host has failed to respond"*
>>
>> *Code*
>> def send_verification_email(request, user):
>> from_email = settings.DEFAULT_FROM_EMAIL
>> current_site = get_current_site(request)
>> mail_subject = 'Please activate your account'
>> message =
>> render_to_string('accounts/emails/account_verification_email.html', {
>> 'user': user,
>> 'domain': current_site,
>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>> 'token': default_token_generator.make_token(user),
>> })
>> to_email = user.email
>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>> mail.send()
>>
>> *Settings*
>> EMAIL_HOST = 'smtp.google.com'
>> EMAIL_POST = '587'
>> EMAIL_HOST_USER = 'myemail'
>> EMAIL_HOST_PASSWORD = 'email_password'
>> EMAIL_USE_TLS = True
>>
>> Any solution will be appreciated. Thank you
>>
>> --
>> 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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%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/CAF7qQgDgXF8_J6cJ6PsJDEuJOqxpwNd4nTLE8tAxcqthAPfmiw%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread It's Aladdin
Google hast stopped less secure apps, so u cant send email messages anymore
with ur email and password, U will have to find some other way of sending
mails.

On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> 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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com.


STATIC FILE

2022-11-09 Thread Mh Raffi
Hi,
I run cmd to collect static files but files are stored in c:\ but not in
the actual project folder.
My project folder is on the desktop.
while running the command am into that root folder of the project.
and i have images that are also not stored. I have an app in railway host
and debug in a false  mode.
I tried the option of white noise and it was still the same.
Can anyone let me know where I am missing?


Thanks & Regards
Mohammed Raffi.J

-- 
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/CAKfPRhVnz55d%2B%3Dw2N5Q2pJwj96ksnOWFO0njWPExGwNrzA6mMA%40mail.gmail.com.


You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2022-11-09 Thread Priyanka Sivaratri
Hi,
I am new to django and I appreciate your quick help. I am able to run 
django server on localhost:8000 but I am seeing this error :
*You are seeing this page because DEBUG=True is in your settings file and 
you have not configured any URLs.*
urls.py:

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from server.views import *


urlpatterns = [
path('admin/', admin.site.urls),
#path('', ReactView.as_view(),name="anything"),
#path('', include('server.urls')),
]

Settings.py:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'server',
'rest_framework',
'corsheaders',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

views.py:
from django.shortcuts import render
from rest_framework.views import APIView
from . models import *
from rest_framework.response import Response
from . serializer import *
# Create your views here.


class ReactView(APIView):

serializer_class = ReactSerializer

def index(request):
return render(request,'templates/meetups/index.html')

def get(self, request):
output = [{"employee": output.employee, "department": 
output.department}
  for output in React.objects.all()]
return Response(output)

def post(self, request):

serializer = ReactSerializer(data=request.data)
if serializer.is_valid(raise_exception=True):
serializer.save()
return Response(serializer.data)

models.py:

from django.db import models

# Create your models here.
class React(models.Model):
  employee = models.CharField(max_length=30)
  department = models.CharField(max_length=200)
def __str__(self):
return self.employee

-- 
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/e1b2ede4-f460-4faa-a965-cfb9375fe549n%40googlegroups.com.


Re: Reply: Re: Hosting django with Namecheap

2022-11-09 Thread Kiyavilo Msekwa
The static files in ur Django project should reflect to public_html/static 
files 


Sent from my iPhone

> On 9 Nov 2022, at 09:27, Namanya Daniel  wrote:
> 
> Thanks Jeff, 
> 
> i re-uploaded the website and it worked but now i have an issue with static 
> files.
> 
> i've static_url= "/static/"
> static_root ="/home/username/url/static"
> i ran collectstatic 
> 
> in my templates,
> 
> i  loaded static
> 
> and set src = folder/image.jpg
> 
> and these images are there in that folder... what could be the issue
> 
>> On Tuesday, November 8, 2022 at 11:34:18 AM UTC-8 jeffkin...@gmail.com wrote:
>> Do you have root access oba you are just using cpanel. I do think you will 
>> be able to succeed with cpanel, you need VSP.
>> 
>>> On Tue, Nov 8, 2022 at 3:58 PM bradie poa  wrote:
>> 
>>> its not a good idea
>>> 
>>> i have settings.py in the same folder with wsgi.py
>>> 
>>> 
 On Tuesday, November 8, 2022 at 4:07:09 AM UTC-8 Kasper Laudrup wrote:
 On 08/11/2022 10.41, Namanya Daniel wrote: 
 > Hello, am hosting a django application with namecheap for the very first 
 > time and am getting " Internal Server ErrorError 500" , in the error 
 > log, wsgi.py shows that there's not settings 
 > 
 > how do i handle this 
 > 
 
 You add the settings. 
 
 Kind regards, 
 Kasper Laudrup 
>>> 
>>> -- 
>>> 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/9f4bfc65-8319-4c19-85b2-7ac7ff1d7ff9n%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/03931t9smoccio3p86jn4id8.1667912304054%40email.vivo.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/e867ff52-2a67-4d4e-8147-a4d2a15f1952n%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/AF94E7E2-2BFD-44C2-8B63-6B9447CB9D33%40gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread Jitendra kumar Patra
Please use  int type EMAIL_PORT = 587

On Wed, 9 Nov, 2022, 16:42 peteru mimo,  wrote:

> EMAIL_PORT = '587'
>
> On Wed, Nov 9, 2022 at 11:56 AM peteru mimo  wrote:
>
>> Good day team,
>>
>> I have been facing this challenge in sending mail in django
>>
>> here is the error *"A connection attempt failed because the connected
>> party did not properly respond after a period of time, or established
>> connection failed because connected host has failed to respond"*
>>
>> *Code*
>> def send_verification_email(request, user):
>> from_email = settings.DEFAULT_FROM_EMAIL
>> current_site = get_current_site(request)
>> mail_subject = 'Please activate your account'
>> message =
>> render_to_string('accounts/emails/account_verification_email.html', {
>> 'user': user,
>> 'domain': current_site,
>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>> 'token': default_token_generator.make_token(user),
>> })
>> to_email = user.email
>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>> mail.send()
>>
>> *Settings*
>> EMAIL_HOST = 'smtp.google.com'
>> EMAIL_POST = '587'
>> EMAIL_HOST_USER = 'myemail'
>> EMAIL_HOST_PASSWORD = 'email_password'
>> EMAIL_USE_TLS = True
>>
>> Any solution will be appreciated. Thank you
>>
>> --
>> 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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAJBAA1Ls4VT_ZywWYz4NE1w3YX-xtw85mzMKk7cTwwBgQe5j0w%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/CAOAROfk4gAwfJeiwV5eOHAD%2BRtLa%3D6vRG7UU0ay4Hwgde-GnDA%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread Lakshyaraj Dash
It's more likely that google is not accepting the credentials you are
providing or else the smtp server has just hung up due to several requests.

You can do it without using the django.core.mail. I've written an article
recently on dev.to
https://dev.to/codewithlaksh/how-to-send-emails-using-python-django--8c3

Follow up and hope the article helps you

Thanks and Regards
Lakshyaraj Dash


On Wed, Nov 9, 2022 at 4:25 PM peteru mimo  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> 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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAF7qQgDsWQiDUyYuxNHDz5%2BWteJ%3DMF_6VbtrYoAQo_v4KhEjPA%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread peteru mimo
EMAIL_PORT = '587'

On Wed, Nov 9, 2022 at 11:56 AM peteru mimo  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> 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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%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/CAJBAA1Ls4VT_ZywWYz4NE1w3YX-xtw85mzMKk7cTwwBgQe5j0w%40mail.gmail.com.


Email Sending In Django not working

2022-11-09 Thread peteru mimo
Good day team,

I have been facing this challenge in sending mail in django

here is the error *"A connection attempt failed because the connected party 
did not properly respond after a period of time, or established connection 
failed because connected host has failed to respond"*

*Code*
def send_verification_email(request, user):
from_email = settings.DEFAULT_FROM_EMAIL
current_site = get_current_site(request)
mail_subject = 'Please activate your account'
message = 
render_to_string('accounts/emails/account_verification_email.html', {
'user': user,
'domain': current_site,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
to_email = user.email
mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
mail.send()

*Settings*
EMAIL_HOST = 'smtp.google.com'
EMAIL_POST = '587'
EMAIL_HOST_USER = 'myemail'
EMAIL_HOST_PASSWORD = 'email_password'
EMAIL_USE_TLS = True

Any solution will be appreciated. Thank you

-- 
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/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com.