Session in Python for Login and Logout

2022-06-06 Thread Mukul Verma
Hii,

Help me out in this stuff please, some steps for solve this out

-- 
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/0b5522ff-2a71-4a51-b1db-847169d2d104n%40googlegroups.com.


Re: uvicorn and ASGI

2022-06-06 Thread Alexander Neilson
Hi Dan. 

Your question interested me so I went looking. The page you link to further 
links to the uvicorn documentation which seems to indicate their suggestion for 
production deployments is to use gunicorn and the uvicorn worker. 

Their rationale seems to be that uvicorn is great at running an event loop and 
operating asynchronously but the worker process management including increasing 
and decreasing them and hitless upgrades were managed by gunicorns more mature 
features here. 

The way I am conceptualising the core benefit here is multi core machines where 
workers can be thrown into different process threads to utilise all available 
cores while the asynchronous benefits improve parallelisation of requests where 
applied to reduce time to run particular views to completion. So they work 
together for best effect. 

https://www.uvicorn.org/#running-with-gunicorn

Regards
Alexander

Alexander Neilson
Neilson Productions Limited
021 329 681
alexan...@neilson.net.nz

> On 6/06/2022, at 16:06, Dan Davis  wrote:
> 
> I am doing some work comparing various ASGI frameworks, SQL Alchemy, just 
> writing the SQL, and that sort of thing, in order to determine what I think.  
> Speed isn't every thing, but speed is a thing.
> 
> Anyway, I was reading about this at 
> https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/uvicorn/ and it 
> is curious that the advise is to run uvicorn as a work rather than a full 
> ASGI server.  Can someone explain why this is necessary or better?
> 
> Thanks,
> 
> -Dan
> -- 
> 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/5dbf8350-1c28-4eb1-a3c8-f3a06566a06dn%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/74A2455C-6673-462B-9258-1E8E69F0D0CC%40neilson.net.nz.


Re: Session in Python for Login and Logout

2022-06-06 Thread 'Kasper Laudrup' via Django users

On 06/06/2022 11.16, Mukul Verma wrote:

Hii,

Help me out in this stuff please, some steps for solve this out



Python is a programming language so there's no such thing as a "session 
for login and logout".


If you want someone to help you, you should try to clarify what you 
actually need help with. I assume you mean something with Django 
sessions but it's impossible for me or anyone else to know exactly what 
kind of issue you need to solve.


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/ade6fd19-d942-f5e9-dc9e-1f921d94b648%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread cseb...@gmail.com
How replace "./manage.py < some_code.py" with "./some_code.py" for website 
scripts?

There seem to be a number of imports needed to make the 2nd version work.

cs

-- 
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/388530f4-7089-4e58-a5e9-6cb436f2cb5cn%40googlegroups.com.


Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread Jason
Why?  what's the purpose behind this?

On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote:

> How replace "./manage.py < some_code.py" with "./some_code.py" for website 
> scripts?
>
> There seem to be a number of imports needed to make the 2nd version work.
>
> cs
>

-- 
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/72eaa595-0d6c-44d3-a612-4776b0624c6dn%40googlegroups.com.


Re: Session in Python for Login and Logout

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
I think what he meant is 'session' in django.

Probably can take a look at this:
https://docs.djangoproject.com/en/4.0/ref/request-response/

For example, django app wants to know who is the current user, can use
something like:
`request.user`

On Mon, 6 Jun 2022 at 22:45, 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 06/06/2022 11.16, Mukul Verma wrote:
> > Hii,
> >
> > Help me out in this stuff please, some steps for solve this out
> >
>
> Python is a programming language so there's no such thing as a "session
> for login and logout".
>
> If you want someone to help you, you should try to clarify what you
> actually need help with. I assume you mean something with Django
> sessions but it's impossible for me or anyone else to know exactly what
> kind of issue you need to solve.
>
> 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/ade6fd19-d942-f5e9-dc9e-1f921d94b648%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/CAFKhtoRrvi6Y%3Dwu9rea42B7D9wSF-dOheiqXiFnUtADx4pBb%3Dg%40mail.gmail.com.


Re: How replace "./manage.py < some_code.py" with "./some_code.py" for website scripts?

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
You can add the following lines in your script:

`
import django
sys.path.append('')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '')
django.setup()
`

On Tue, 7 Jun 2022 at 04:17, Jason  wrote:

> Why?  what's the purpose behind this?
>
> On Monday, June 6, 2022 at 12:27:58 PM UTC-4 cseb...@gmail.com wrote:
>
>> How replace "./manage.py < some_code.py" with "./some_code.py" for
>> website scripts?
>>
>> There seem to be a number of imports needed to make the 2nd version work.
>>
>> cs
>>
> --
> 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/72eaa595-0d6c-44d3-a612-4776b0624c6dn%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/CAFKhtoRu-3XiM4-n5hNzKi2dE3sKfQ47kf7y%3DgzVHZZxo%3DvAoA%40mail.gmail.com.


Re: Best approach for audit logging in Django.

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
Based on my experience, this is the easiest one to start with:

https://django-auditlog.readthedocs.io/

On Mon, 6 Jun 2022 at 12:58, Mukul Verma  wrote:

> i also have the question regarding this, is that i have to create auditing
> log file for all the activities performing in the project smallest or
> biggest may you please tell how to initiate this task from beginning.
>
> *Thanks*
> *Mukul Verma*
>
> On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:
>
>> Hi Sencer, signals will be helpful only if you are auditing on certain
>> models
>> but if you are trying to audit a set of views then middleware will be a
>> better choice since that will be more manageable
>>
>> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>>
>>> one good source when you have a question "is there anything in django
>>> that does X?" is to go to djangopackages.org.
>>>
>>> https://djangopackages.org/grids/g/model-audit/, for example, is a list
>>> of packages for model auditing and history
>>>
>>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>>
 Hi,

 I've been planning to add audit logging to the project.

 But, I can not decide which approach is the best;
 Using signals or creating middleware?

 Project needs to being log events on change of model object with these
 informations below:

 - If a record is inserted, updated and deleted:
- who is taking this action (ForeignKey)
- what is the action (Choice)
- which applications model object affected (ContentType)
- affected object (Generic relation)
- current data in json format
- previous data in json format


 Kind regards,
 Sencer HAMARAT

 --
>>> 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/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%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/415a6eee-74b2-4cbf-b708-2ff15091aeecn%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/CAFKhtoTh3NPBa2BO%2BJ7FMZJf5zUg628K8AFDrEk5GNnkVkDszw%40mail.gmail.com.