Re: Role And Permission

2021-08-23 Thread Lalit Suthar
https://medium.com/djangotube/django-roles-groups-and-permissions-introduction-a54d1070544

On Wed, 18 Aug 2021 at 18:32, Premkumar Chalmeti <
premkumarchalm...@gmail.com> wrote:

> I was working on a similar requirement.
>
> Checkout this https://github.com/premchalmeti/company_uam
>
> Inside `Docs/` I've attached a class diagram check if its useful. Lets
> collaborate together.
>
> On Tuesday, August 17, 2021 at 12:00:42 PM UTC+5:30 amit.m...@gmail.com
> wrote:
>
>> Handling Role From Frontend side
>> like:-
>> add role
>> delete role
>> update role
>> then Handling Permissions
>> Assign permission
>> remove permissions from frontend side
>>
>> So finally I want to Customise role and permission
>> any one guide me for this?
>>
>>
> --
> 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/7aa1aafd-697d-4938-ac3e-082bc8a69403n%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/CAGp2JVH7MpZDgr317YbZYLQBRTKyt%3D%3DGSmsGiT-HYvKBY2a3QQ%40mail.gmail.com.


Re: Run Any Python Project

2021-08-23 Thread Lalit Suthar
install requirements, possibly there'll be a file named requirements.txt
run the command after going inside the directory `pip install -r
requirements.txt` and it will do

On Mon, 23 Aug 2021 at 11:32, MUGOYA DIHFAHSIH  wrote:

> but i think the error is so clear, there is no module named gettext_noop
> so you need to first install it
>
> On Sun, 22 Aug 2021 at 00:25, Kasper Laudrup 
> wrote:
>
>> On 20/08/2021 15.08, Rana Zain wrote:
>> > Hi,
>> > Can anybody help me to know how we can run any python project from Git
>> > and any other sources.
>> >
>>
>> https://wiki.python.org/moin/BeginnersGuide
>>
>> --
>> 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/a55ddcee-0da8-c193-0d0b-8b187585cbec%40stacktrace.dk
>> .
>>
>
>
> --
> Mugoya Dihfahsih
> Software Engineer
> Kampala, Uganda
> Whatsapp: +256 751612792
> Profile: *dihfahsih1.github.io/
> profile*
>
> --
> 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/CAP%3DJD9y%3DcYs2Yx9LC5chBZ%3DTwZO%2Bf-quTRk-T5OX0TDug3%3DhoQ%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/CAGp2JVFgVGkq6VRAPAvAoZt7G0dL%3DcQr0MoEgovUMG_TPDhX4A%40mail.gmail.com.


Basic questions about scaling a Django web app. (e.g. AppEngine solves all problems?)

2021-08-23 Thread cseb...@gmail.com
I have a simple web app (bighelp.business).  I anticipate
the number of users to steadily increase.  

I'm having nightmares of having to guesstimate how much
extra RAM and cores to add every week.

Furthermore, WSGI has these switches I use...
--processes=5 and  --max-requests=50.  I don't know how
I should alter these as my userbase grows and I don't want
to guesstimate.

How to others deal with growth?  By the way, if I port
my Django app to Google App Engine, does it automatically
solve all these problems or is that just wishful thinking?

Thanks!

Chris

-- 
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/7bb16367-44fa-4593-9826-968a0084adbbn%40googlegroups.com.


Django admin - how to change breadcrumbs 'Home' into 'Main menu'

2021-08-23 Thread Mike Dewhirst
We are using 'Home' in a different, more public, part of the site and 
have to adjust that first item in the Admin breadcrumbs to 'Menu' or 
'Main menu' in order to keep the UX masters happy. Some of the Admin is 
public facing.


Looking at the source, I would have to override an awful lot of 
templates with ...


{% translate 'Home' %}

It looks impossible to do elegantly. I shudder at scripting a global 
search and replace.


Is this worth putting in the effort to make 'Home' a setting - if that 
is even possible.


If so, how do I get started on that?

Thanks

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
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/3306675c-6079-324e-0fad-b0857a9140a8%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Django Form Help

2021-08-23 Thread Billy Muller
Never mind, I realized I forgot the save command. Thanks in advance for 
anyone that was looking into this.


On Monday, August 23, 2021 at 4:35:16 PM UTC-4 Billy Muller wrote:

> I have a form in Django that requires a little user input and then 
> executes some commands in doctl and then I want to return specifc doctl 
> info (droplet id, and public ip) into the rest of the form and save it.
>
> The form executes, creates the droplet and even returns to success but 
> does not save the form. 
>
> My view function is at the attached gist:
>
> https://gist.github.com/from-wtm/b4d6e261ca1a9f4a6d42952720411424
>
>
>
>

-- 
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/f20e2186-71dc-47e6-b98f-d37f12a9bcfcn%40googlegroups.com.


Filter GenericForeignKey by list of different model objects

2021-08-23 Thread Msw Tm
 

I am trying to build activity logs by a User or any other model object, to 
which a user can follow/subscribe.

These are the models related with logging the activities and following them:














*class Activity(models.Model):"""An activity log : Actor acts on 
targetActor can be a User or a model Object"""
actor_content_type = models.ForeignKey(ContentType, 
on_delete=models.CASCADE, related_name="actor_type")actor_object_id = 
models.PositiveIntegerField()actor = 
GenericForeignKey('actor_content_type', 'actor_object_id')description = 
models.TextField()target_content_type = models.ForeignKey(
ContentType, on_delete=models.CASCADE, related_name="target_type")
target_object_id = models.PositiveIntegerField()target = 
GenericForeignKey('target_content_type', 'target_object_id')*
*timestamp = models.DateTimeField(auto_now_add=True)*









*class Follow(models.Model):"""A user can follow any User or model 
objects."""user = models.ForeignKey(User, 
on_delete=models.CASCADE)content_type = models.ForeignKey(ContentType, 
on_delete=models.CASCADE)object_id = models.PositiveIntegerField()
follow_object = GenericForeignKey('content_type', 'object_id')*

Suppose:

   - Thor follows user Loki // User follows User
   - Thor follows user Stark // User follows User
   - Thor follows project Avenger // User follows Project

And suppose these are activities:

   - Nick Fury Created a project "Shield"
   - Nick Fury Created a project "Avengers"
   - Stark created a project "Mark II"
   - Avengers added Vision
   - Dr Strange created a project Dormammu

I can get the user *Thor* :
*thor = User.objects.get(email="t...@gmail.com")* 

And get the list of users/objects followed by *Thor*:

*thor.follow_set.all() *
*, , ]> *

Now to get the list of activities followed by the user Thor, I tried this:


* q = Q(actor__in=thor.follow_set.all())| Q(target__in= 
thor.follow_set.all()) *
*Activity.objects.filter(q) *

But its throwing an error:

*FieldError: Field 'actor' does not generate an automatic reverse relation 
and therefore cannot be used for reverse querying. If it is a 
GenericForeignKey, consider adding a GenericRelation.*

I can get all the activities for a single object followed by user Thor:

*followed_last = thor.follow_set.last().follow_object *


*q = Q(actor_content_type=ContentType.objects.get_for_model(followed_last), 
actor_object_id=followed_last.id)| 
Q(target_content_type=ContentType.objects.get_for_model(followed_last), 
target_object_id=followed_last.id)) *

* Activity.objects.filter(q)*
*, ]> *

But how can I get all the activities Thor is following from the above 
activities:

   - Nick Fury Created a project "Avengers"
   - Stark created a project "Mark II"
   - Avengers added Vision

-- 
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/a2f82ae0-10c4-4a52-b960-90a6032b4799n%40googlegroups.com.


Re: Surpress Daphne request logging levels

2021-08-23 Thread Jason
daphene runs at the same infra layer level as uwsgi/gunicorn so you need to 
define the log level at process init.  Django has no control over this.

On Friday, August 20, 2021 at 12:05:17 PM UTC-4 benny.s...@gmail.com wrote:

> I am trying to surpress the log output from daphne.
>
> example log:
>
> Aug 20 08:33:53 admin daphne[663290]: 127.0.0.1:35638 - - 
> [20/Aug/2021:08:33:50] "PATCH /api/v1/worker/59/" 200 168
>
> logger  'django.request'  seem to have no effect on it.
>

-- 
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/97bb1d13-d536-4fab-94a4-158b40e83927n%40googlegroups.com.