Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Wednesday Daily Thread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

/r/Python
https://redd.it/xjov3k
Django cannot assign must be an instance error

Hello, so i'm trying to add the user that clicked on a button by getting his ID and his trip ID and placing it into a reservation table I have.

views.py (thanks u/drbandre !)

def nbrplaces(request, id):

object = Trip.objects.get(id=id)
object.nbrplaces -= 1
object.save()
print(
object.id)
username = request.user
reser = Reservation(user
id=username, tripid=object.id)
reser.save()
return redirect(index)


Now I get the trip ID correctly and the username as well. But I get this error:

Cannot assign "3": "Reservation.trip
id" must be a "Trip" instance.

Now I tried with name, with just trip with many things but I believe the error is somewhere in my models :l

Here's what the table SHOULD look like: https://imgur.com/a/tsirpbI

Here's what it looks like:

class User(AbstractUser):
pass

class

/r/djangolearning
https://redd.it/xjnm80
Two Scopes of Django 3.x

Anyone read this book?... Is it good...

/r/django
https://redd.it/xjvfua
OpenZiti SDK: make your app secure with embedded zero trust networking

I am happy to introduce OpenZiti Python SDK: .

It allows you to:

* embed zero trust secure networking right into your Python application

* run your Python services without any open network ports.

Powered by: https://github.com/openziti/ziti

/r/Python
https://redd.it/xk3b58
P My co-founder and I quit our engineering jobs at AWS to build “Tensor Search”. Here is why.

My co-founder and I, a senior Amazon research scientist and AWS SDE respectively, launched Marqo a little over a week ago - a "tensor search" engine https://github.com/marqo-ai/marqo

Another project doing doing semantic search/dense retrieval. Why??

Semantic search using vectors does an amazing job when we look at sentences, or short paragraphs. Vectors also do well as an implementation for image search. Unfortunately, vector representations for video, long documents and other more complex data types perform poorly.

The reason isn't really to do with embeddings themselves not being good enough. If you asked a human to find the most relevant document to some search query given a list of long documents, an important question comes to mind - do we want the document that on average is most relevant to your query or the document that has a specific sentence that is very relevant to your search query?

Furthermore, what if the document has multiple components to it? Should we match based on the title of the document? Is that important? Or is the content more important?

These questions arn't things that we can expect an AI algorithm to solve for us, they need to be encoded into each specific search experience and use case.

Introducing Tensor

/r/MachineLearning
https://redd.it/xk31n8
TLJH Managing GPU visibility ( CUDAVISIBLEDEVICES )



Hello everyone,

I just joined this community, and this is my first message here. I am a second-year student studying SE in Serbia. I've set up JupyterHub from my Ubuntu server, which runs on 8GPUS. I am looking to restrict and manage GPU resources for the users of JupyterHub.Some schemes would look like this:

\-Admin

|- user1: 2 usable GPUs

|- user2: 3 usable GPUs

|- user3: 4 usable GPUs

|- user4: 1 usable GPU

I looked through documentation from links( such as:

\-https://medium.com/rapids-ai/setting-up-gpu-data-science-environments-for-hackathons-cdb52e7781a5

\-https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda\_visible\_devices/

\-https://tljh.jupyter.org/en/latest/topic/tljh-config.html

Trust me, my first three pages of google are purple :D ), and I could not find the particular thing that is suitable for me and working. This is what I have so far, and with sudo tljh-config show:


users:
admin:
- skynet
allowed:
- good-user1
- marko
limits:
memory: 4G
marko:
CUDA
VISIBLEDEVICES: 0,1,2
https:
enabled: true
user
environment:


/r/IPython
https://redd.it/xk3bm5
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!

This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.

/r/Python
https://redd.it/xkldrj
Add custom entries to the JupyterLab launcher with jupyterapplauncher

Hi all, I want to present my new JupyterLab extension jupyter_app_launcher (https://github.com/trungleduc/jupyter\_app\_launcher). It is used to customize the JupyterLab launcher with a simple YAML file.

​

https://reddit.com/link/xke81n/video/rd8ukezni9p91/player

Users can add custom entries to the launcher to:

Open a predefined notebook or markdown file.
Render a notebook in dashboard mode
Open a notebook with Voila
Local/remote services like Plotly Dash or Streamlit

A live demo is available at https://mybinder.org/v2/gh/trungleduc/jupyter\_app\_launcher/main?urlpath=lab

Documentation: https://jupyter-app-launcher.readthedocs.io/

/r/JupyterNotebooks
https://redd.it/xke81n
Add custom entries to the JupyterLab launcher with jupyterapplauncher

Hi all, I want to present my new JupyterLab extension jupyter_app_launcher (https://github.com/trungleduc/jupyter\_app\_launcher). It is used to customize the JupyterLab launcher with a simple YAML file.

https://reddit.com/link/xke6q4/video/myekrzjfi9p91/player

Users can add custom entries to the launcher to:

Open a predefined notebook or markdown file.
Render a notebook in dashboard mode
Open a notebook with Voila
Local/remote services like Plotly Dash or Streamlit

A live demo is available at https://mybinder.org/v2/gh/trungleduc/jupyter\_app\_launcher/main?urlpath=lab

Documentation: https://jupyter-app-launcher.readthedocs.io/

/r/JupyterNotebooks
https://redd.it/xke6q4
OpenAI's Whisper: an open-sourced neural net "that approaches human level robustness and accuracy on English speech recognition." Can be used as a Python package or from the command line
https://openai.com/blog/whisper/

/r/Python
https://redd.it/xkwt34
TLJH GPU management

Hello everyone,

I just joined this community, and this is my first message here. I am a second-year student studying SE in Serbia. I've set up JupyterHub from my Ubuntu server, which runs on 8GPUS. I am looking to restrict and manage GPU resources for the users of JupyterHub.Some schemes would look like this:

\-Admin

|- user1: 2 usable GPUs

|- user2: 3 usable GPUs

|- user3: 4 usable GPUs

|- user4: 1 usable GPU

​

I looked through documentation from links( such as:

\-[https://medium.com/rapids-ai/setting-up-gpu-data-science-environments-for-hackathons-cdb52e7781a5](https://medium.com/rapids-ai/setting-up-gpu-data-science-environments-for-hackathons-cdb52e7781a5)

\-[https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda\_visible\_devices/](https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/)

\-[https://tljh.jupyter.org/en/latest/topic/tljh-config.html](https://tljh.jupyter.org/en/latest/topic/tljh-config.html)

Trust me, my first three pages of google are purple :D ), and I could not find the particular thing that is suitable for me and working. This is what I have so far, and with sudo tljh-config show:

users:
admin:
- skynet
allowed:
- good-user_1
- marko
limits:
memory: 4G
marko:
CUDA_VISIBLE_DEVICES: 0,1,2
https:
enabled: true
user_environment:
default_app: jupyterhub


/r/JupyterNotebooks
https://redd.it/xk34ub
This media is not supported in your browser
VIEW IN TELEGRAM
I made a small demo app for creating an image slider using JSONField

https://redd.it/xl1aps
@pythondaily