Re: decouple import config

2023-02-22 Thread Anurag Chauhan
Try *pip install python-decouple*, and then run your program again.

On Wednesday, February 22, 2023 at 7:38:43 AM UTC+5:30 Taufiq Subijantoro 
wrote:

>  from decouple import config
> ImportError: cannot import name 'config' from 'decouple' 
> (C:\Users\taufi\AppData\Local\Programs\Python\Python311\Lib\site-packages\decouple\__init__.py)
>
> "How to fix the problem mentioned in the error message:
>
> ThankYou
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a20b089b-e76b-4bbe-accc-17f55cde9737n%40googlegroups.com.


suggestion for open source contribution

2023-02-22 Thread Sanat Pawar
Hi Everyone, I hope you all are doing great. I am sanat pawar from MITWPU, 
pune I am new to open-source contribution. So can anyone help me in my 
first contribution by suggesting how to approach the good first issue and 
is it compulsory to set to project in the local environment and other basic 
things 
Thank you 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d847ad6c-95f0-4e9d-a07e-6a3f476ca897n%40googlegroups.com.


Re: suggestion for open source contribution

2023-02-22 Thread Durval Carvalho


Hi Sanat,

Welcome to the open-source community! It's great to see you interested in 
contributing to Django. Here are some suggestions on how to get started:

   1. 
   
   Check out the Django Contributing Guide: 
   https://docs.djangoproject.com/en/stable/internals/contributing/. This 
   guide provides an overview of the different ways you can contribute to 
   Django.
   2. 
   
   If you're looking to contribute code, take a look at the "Advice for New 
   Contributors" section in the guide: 
   
https://docs.djangoproject.com/en/stable/internals/contributing/new-contributors/.
 
   This section provides some helpful tips and best practices for getting 
   started.
   3. 
   
   You can also work through the "Writing Your First Patch" tutorial: 
   https://docs.djangoproject.com/en/stable/intro/contributing/. This 
   tutorial walks you through the process of contributing a patch to Django.
   4. 
   
   If you get stuck or have any questions, don't hesitate to post back in 
   the Django-developers group or the "Mentorship" section on the forum: 
   https://forum.djangoproject.com/c/internals/mentorship/10.
   
I hope this helps you get started with your first contribution to Django. 
Good luck!

Em quarta-feira, 22 de fevereiro de 2023 às 10:36:26 UTC-3, Sanat Pawar 
escreveu:

> Hi Everyone, I hope you all are doing great. I am sanat pawar from MITWPU, 
> pune I am new to open-source contribution. So can anyone help me in my 
> first contribution by suggesting how to approach the good first issue and 
> is it compulsory to set to project in the local environment and other basic 
> things 
> Thank you 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3d74f39e-ea5e-4c37-ac5b-6367413ac633n%40googlegroups.com.


Re: dynamically added INSTALLED_APPS

2023-02-22 Thread Jörg Breitbart




Am 21.02.23 um 22:05 schrieb Christian González:
My original question was HOW would I implement this in a "good-practice" 
way, by not violating Django's conventions, and showing a way it could 
be done clean.


I think thats not really feasible without big restrictions on the apps 
and what they might bring into a running django instance. Main reason 
being the multistage bootstrapping with collecting phases, esp. on ORM 
side. While it is possible to create models on the fly, they will not 
fully integrate properly. You'd have shim in all the bookkeeping, cache 
abstractions and static globals (django still has a few of those) and 
alter their values in way, that would resemble a clean startup. And with 
multithreading things will get really funny here.


If you introduce on-the-fly app loading, demand for on-the-fly app 
unloading or app updating is around the corner. Thats like opening 
pandora's box (from dangling refs to not gc'ing/freeing at all due to 
some deeply held ref).


Overall I think any attempt into these on-the-fly directions will lead 
to serious stability issues.


Cheers,
Jörg

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/694f2fb3-3f37-91fe-1af7-ec6b911fe8bb%40netzkolchose.de.


Re: Model icons

2023-02-22 Thread Brice Parent

Hello!

Really useful idea, I think! 2 points about it:

1. Syntax

I would also remove the html from the models, but probably in this way:

class Hammer(models.Model):
    ...

    Meta:
        icon = ModelIcon("🔨")


There would be something like

ModelIcon.as_html(self, model_name:str) -> str:
    """returns whatever html should be used in the admin"""


or a ModelIcon.set_text(self, text: str) and we'd use a simple 
str(model_icon) in the templates.


That way, it could be extended easily in a 
FontAwesomeModelIcon("fa-hammer") and a BootstrapModelIcon("bi-hammer") 
for example, and maybe get whatever extra arguments they may need, like 
FontAwesomeModelIcon("fa-hammer", thickness="solid").


2. Make it more widely useful
I like the fact that it's in the model itself and not in the modeladmin, 
as it allows to use it elsewhere, like in the __str__ to quickly add 
this visual indication of the class. Boostrap and co would have to 
provide a non-html version of the icon or return an empty string though.


Le 21/02/2023 à 01:31, Marty a écrit :
I really like the idea to add just a simple 'icon' attribute. That's 
quite elegant solution. Thanks, Mark! 🙂


On Monday, February 20, 2023 at 2:33:43 PM UTC+1 Jacob Rief wrote:

I agree with Adam Johnson that adding HTML to the model class is a
bit too coupled.
But I like the idea of Mark Niehues to add them to the ModelAdmin
class, although I would allow a HTML/SVG snippet rather than a CSS
class.

  * How would we then handle 3rd party apps providing their own
SVG file to be used as icon?
  * Shouldn't that icon definition be part of the ModelAdmin's
Media subclass?

– Jacob

--
You received this message because you are subscribed to the Google 
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/45c143cc-2716-430a-93cf-7c2a938640ccn%40googlegroups.com 
.


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/890a79aa-578f-0b06-95cb-33f660baecd2%40brice.xyz.