Re: How to work in Visual Studio Code with Virtual Environment & Django ?

2019-12-30 Thread Scot Hacker
With your project option, use the command "Select Interpreter" - the virtual environment used by VSCode will be the one the python you select belongs to. Documentation is here: https://code.visualstudio.com/docs/python/environments ./s On Tuesday, December 24, 2019 at 1:41:43 AM UTC-8,

Python/Django job in energy efficiency

2021-04-30 Thread Scot Hacker
Want to put your python/django skills to work helping to reduce carbon footprints throughout the energy sector? Energy Solutions is looking for an experienced developer able to work permanent/full-time in one of the 50 U.S. states. (Sorry - small company.) Need about 4 years of experience -

Re: How Choose Random User from database ?

2021-04-21 Thread Scot Hacker
If the number of records you need to choose randomly between is not huge, this works fine: `User.objects.order_by('?').first()` You only need turn to use a special function or method if your query takes more than a microsecond to return, or you have a ton of traffic. i.e. use the ORM for

Proper way to create custom Group

2021-10-03 Thread Scot Hacker
It is possible to create a custom Group model in Django, although there is no `settings.AUTH_GROUPS_MODEL` equivalent to `AUTH_USER_MODEL`. When creating a custom Group system one can either inherit from the Django's `Group` model, or not. If you do, you still can use `user.groups.all()`. If

<    1   2