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
Django Online Studying App - Django + React - Feedback Please

Hey everyone!

First time working with Django + React. I built a free service where people can track and share everything their studying online. It's very early beta, but I would love some feedback. I've worked with Django quite a lot before, but not with DRF and pretty inexperienced with React. I originally built a version of this website with Node+React, but I really missed the structure of Django so I built it back from scratch.

https://stublio.com/

Feel free to be critical and harsh, I am very open to suggestions and ideas.

This is my profile: https://stublio.com/codemonkey

I haven't worked this in-depth with DRF before, and it's been amazing so far. I am learning the beauty of serializers and just how powerful DRF is out of the box.

Would also love input on validation with this stack. Typically I've had forms.py take care of that, but now I'm not quite sure where the best place to validate is. I could do it in React+views+models, but is that kind of overkill? So far, I've done almost 0 validation (early beta).

Also, within the profile page, there is a feature to filter by tags. I do that logic in React right now, I wonder if it's better to just

/r/django
https://redd.it/l347hh
Can anyone give me an example to display an image with bytea datatype from a postgresql table in a html page with flask ?



/r/flask
https://redd.it/l3bz87
how to make edit user profile page using Django without using Django forms??

I created this type of sign in and login views using User model ,without using Django forms how can make edit profile page view? please help me. I have not used Django form

https://preview.redd.it/nj9cwsrpg3d61.png?width=1920&format=png&auto=webp&s=12ead27814d144289f24d8ee9936d810eee46810

/r/django
https://redd.it/l3d89s
PWA

have you ever converted Django into Progressive Web App?

/r/djangolearning
https://redd.it/l36zze
Colorpedia – Command-line tool for looking up colors

Colorpedia is a command-line tool for quickly looking up colors, shades and palettes.

Supported color models: HEX, RGB, HSL, HSV, CMYK

https://i.redd.it/hkcizzp204d61.gif

/r/Python
https://redd.it/l3fad6
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/l3nwc0
Because is not easy to find Django jobs opportunities I created a telegram group with Django jobs I fund on the Internet +30 published today and counting.

Hello everyone I just created a group of Django Jobs, right now it has +30 jobs, my goal is to keep it updated and created a community of people sharing jobs related to Django https://xn--r1a.website/djangojobs

Let's create community!

/r/django
https://redd.it/l3ovs2
gerdemb/shashin Find duplicate images using perceptual hashing which can match similar images even if they have been resized, edited or had changes to their metadata (EXIF) tags, etc.
https://github.com/gerdemb/shashin

/r/Python
https://redd.it/l3mgdq
Celery Broken After Upgrading DJ to 3.1

Hello everyone,

I was running Celery 4.4.7 when I upgraded Django to 3.1. This ended up breaking it, and in `/var/log/celery/proj_worker.log` I got the error `ImportError: cannot import name '_lazy_re_compile' from 'django.utils.regex_helper'`

To attempt to resolve this, I've upgraded celery to 5.0, but now none of my tasks work at all.

When I run `celery -A proj beat -l debug`, celery beat does not start, saying:

celery beat v5.0.5 (singularity) is starting.
__ - ... __ - _
LocalTime -> 2021-01-24 13:55:15
Configuration ->
. broker -> redis://localhost:6379//
. loader -> celery.loaders.app.AppLoader
. scheduler -> celery.beat.PersistentScheduler
. db -> celerybeat-schedule
. logfile -> [stderr]@%DEBUG
. maxinterval -> 5.00 minutes (300s)
[2021-01-24 13:55:15,070: DEBUG/MainProcess] Setting default socket timeout to 30
[2021-01-24 13:55:15,070: INFO/MainProcess] beat: Starting...


/r/djangolearning
https://redd.it/l3zzk5
os.path vs pathlib?

One short question, how and when do you use this modules?

​

For a very long time I only used os.path, but recently I discovered pathlib. My short answer:

os.path, if I just want to check if the path exists or just a few actions.

And pathlib for complicated tasks, like a base folder in various functions or class.

​

What do you think about this?

/r/Python
https://redd.it/l45ojr
This media is not supported in your browser
VIEW IN TELEGRAM
Improved autocompletion in JupyterLab with the LSP

/r/JupyterNotebooks
https://redd.it/l47doj
SimpleGUIBuilder - A GUI for designing Python GUI's for PySimpleGUI

Hello Python people :)

I don't really like doing frontend but I really like the idea of giving my backend/terminal programs something more pleasurable to interact with and look at.

That's when I came across PySimpleGUI, a simple solution to quickly give my programs an interactive front. Shortly, it allows you to quickly create a GUI by designing its layout and then map it to your backend code.

But in checking it out I found I wanted more and had an idea: It would be nice if PySimpleGUI and therefore GUI making was in itself more interactive.

And that's how SimpleGUIBuilder came to be: A GUI for creating/designing GUI layouts for PySimpleGUI, made with PySimpleGUI.

I hope this will be useful to people :)

You can get it in the releases and check out more info here in github.

Short preview

/r/Python
https://redd.it/l46dz4
Monday Daily Thread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code!

/r/Python
https://redd.it/l4b3uy
AF Questions on a github repo / second guessing myself for a job interview

Hello,

I’m interviewing for a flask developer position and part of the process is this:

“Use Case: Building a Cloud Portal

After looking around to leverage other gov code, you find an available repo to use as a portal for your future cloud portal. Before using it, you want to review the instructions, deploy the system locally to your computer, and provide technical feedback on the README.md file that you could use to streamline the local deployment of the application.

After getting the system running, you are excited to show your work and setup a demo for the application for us to see.

The repo is locating here: https://github.com/dod-ccpo/atst

After attempting to deploy this application on multiple systems (mac os, windows, linux and docker) I’m unable to for a multitude of reasons,

My questions are the following: Is this code base fucked or what? What’s the point of using poetry (first time ive ever seen it) when better alternatives exist? Why reinvent the wheel? Why the hell would you want to use one script rules them all? Is this repo a test and it’s not meant to at work at all and they want to see what I say?

And also, for the record the docker deployment doesn’t

/r/flask
https://redd.it/l4clcy
Hiring Senior Backend Engineer | HR SaaS (Remote)

HI!

My team is looking for a skilled Senior Backend Engineer to join our growing 4-person engineering team. We're looking for someone with deep experience in Django Rest Framework and how it fits into a SaaS product.

Tech stack: Vue+Django, but open to other backgrounds

Compensation: $120k-150k base

Location: Remote (open to global applicants // we have team members in USA, Canada, and Europe // no visa transfers)

Company: Pequity

Mission: Equal pay and opportunity for all

Funding: Seed

Requirements:

Must have previous professional experience as a senior backend engineer
Startup experience highly preferred but not required
SaaS experience highly preferred by not required
Full-time preferred, but we can be flexible

If interested in learning more, please shoot me a message here and to warren@getpequity.com

/r/django
https://redd.it/l49bt0
Show profile page after login

If possible I'd like some help with a little self-teaching project. So I was following flask's own tutorial to build a blog. See here. I've managed to get the login and registration pages up and running with a connection to a mariadb server sitting on a raspberry pi in my network.

So I decided to expand on it to create a profile page which requires the user to be logged in to view. I created a new py file and a new html page to display this profile page. However, when I add the @loginrequired to the blueprint route for the profiles page it throws an app.context error.

Profile page code snippet

@zerg.beforeapprequest
def load
loggedinuser():
userid = session.get('userid')

if userid is None:
g.user = None
else :
db = get
db()
cur = db.cursor()


/r/flask
https://redd.it/l3zz22