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
Outdated Flask extensions

I basically love Flask and its open source culture.

But what I noticed is that some important extensions don't seem to be maintained anymore. For example, flask-restful had its last commit in October last year, and currently 78 issues and 35 pull requests. That looks like that the owners of the repo are not working anymore on this extension. Doesn't that even impose security risks if nobody fixes possible flaws?

/r/flask
https://redd.it/le6htu
I built a URL Shortening Tool which provides Smarter Analytics!

TLDR: Looking for reviews on my first side project: **https://tracer.syscape.live/**

It is a minimal app, which does what it says. Shortens your URL, and provides you with analytics.

Analytics Include:

IP Address
Location of ISP
RAM
OS
Device Brand and Name
Battery Percentage when URL was clicked

​

https://preview.redd.it/hds13y2fawf61.jpg?width=1265&format=pjpg&auto=webp&s=53bb212903289da4eb6d13078ff5b8712a8b0e30

Hey guys, so this lockdown, I built a url shortening service using Flask, DynamoDB, AWS SES, Nuxt.js, AWS Amplify and AWS Lambda.

We also provide these analytics on a user friendly dashboard.

I would much appreciate your feedback on the website. We plan to add much more stuff like map based UI for location, etc.

/r/flask
https://redd.it/le2nap
CONFETTI - The way to start a Django project with Docker

I tried to accumulate best practices that I used for a long time in one project. I hope you'll learn something new from this. It's not a template, it's more like 'copy some piece if you need this'. I will add more stuff, e.g. Redis, Celery... If you find it useful)

Source: https://github.com/funnydman/confetti

Don't hessite to make any improvement, pull requests are welcome.

/r/django
https://redd.it/le15j1
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/leack7
I created a web app that lets you practice trading in the stock market

Address: investick.net

How it works:

You get $500k (virtual cash) and you can start buying and selling stocks and crypto. You can check your performance (day, month, year...) and see how you stack up against others on the leader-board.

​

buying and selling some stocks

​

performance of portfolio and stocks, news about your stocks

​

It's a PWA, which means it's fully responsive and you can "install" it.

It's free without any ads.

​

Tech stack:

Frontend - vue 2, vuetify, chartist for the graphs, gsap for the number transitions. Also vue-cli which is a great tool.

Backend - django, django rest framework.

​

My thoughts about django - overall it's a great framework. I like that it's built in with a great ORM, a user management system and an admin panel. the model system is super easy to work with. My only tiny problem is that I couldn't find a good tutorial/library about how to use session authentication when you have a spa and use django just as a rest api.

​

Ask me anything if something is not clear.

I would love to hear your feedback and ideas on how to improve this :D

/r/django
https://redd.it/leg89q
how does pewee ORM work with heroku for postgress?

Hi there I use peewee for flask and it works fine, even with postgres locally. But, when I go to heroku there is where I am unsure how to proceed. Do I need to statistically type the postgres heroku info ? I cannot seem to find the answer in heroku, some people recommend this #DATABASE=PostgresqlDatabase('heroku'), but it did not work for me. Again thank you!!

​

​

​

DATABASE = PostgresqlDatabase(

'',

user='',

password='', # Ditto.

host='') # Ditto.

​

​

​

​

​

​

​

Thanks

flask-bcrypt==0.7.1 Flask==1.1.1 Flask-CLI==0.4.0 Flask-Login==0.5.0 flask-marshmallow==0.11.0 Flask-Migrate==2.5.3 Flask-Script==2.0.6 Flask-SQLAlchemy==2.4.1 Flask-WTF==0.14.3 gunicorn==20.0.4 bcrypt==3.1.4 flask-peewee==3.0.3 Flask-WTF==0.14.3 Jinja2==2.11.1 lazy-object-proxy==1.4.3 regex==2020.4.4 requests==2.23.0 slugify==0.0.1 SQLAlchemy==1.3.16 sqlparse==0.3.1 urllib3==1.25.8 utils==1.0.1 wcwidth==0.1.9 Werkzeug==1.0.1 wtf-peewee==3.0.0 WTForms==2.2.1

/r/flask
https://redd.it/led12p
I just used Python to grab the rest of the semester's lecture notes in a discrete math class I'm taking!

I've been programming for a long time, but this is the first time I've used it in my day-to-day life! I realized that the lecture notes for a class I'm taking are listed sequentially as urls, so I figured they might be exposed on the server despite not being posted directly on the website. UrlLib to the rescue!

Here's the link to a tiny GitHub repo if anyone's interested.

/r/Python
https://redd.it/leaf6v
How do you mock authentication in flask unit tests (pytest)

How do you guys mock the oauth2 token authentication while writing unit tests in pytest. I have tried pytest-mocks "patch", assigning a simple decorator (which gives back the function itself) to the authentication module and yielding the app. Nothing seems to work, it always goes to the original authentication module when I run the tests. Any ideas?

/r/flask
https://redd.it/lelnve
Kids Python 101 learning materials

Hi Reddit folks,

I have developed free learning materials for young kids (targeting 8+ kids) to learn Python from scratch on https://kidspython.com lately. I put lots of efforts on simplifying the course materials, providing plenty of good examples and sufficient exercises for kids to practice coding. The Web site even provides a Python Playground that supports visualization mode for kids to trace their code execution.

I hope the information is helpful. Please give it a try, and subscribe to our YouTube channel for watching Kids Python 101 videos.

/r/Python
https://redd.it/leh4eg
Are Django Templates not enough?

I am learning Django and based on the resources I've covered so far I know that Django can handle frontend with the templates. But most often I read about people preferring Django + a JS frontend framework.

What are some of the limitations of templates that make people prefer working with React, Vue, or Angular?

/r/django
https://redd.it/levqcu
Better ways to use a csv file in Django

Hello everyone,

I am building a web app in django that relies on a deep learning model. In my backend, I have used pandas to store information about my dataset (my dataset consists of images, the CSV files contain columns such as name, path, and an embedding for the images), and I am using the embedding of these images in Django. However, I would like to know if there is a better way than parsing a CSV file to obtain my information.

​

Thanks in advance!

/r/django
https://redd.it/lev2ri
Django Rest Framework

Using Django Rest framework, ModelSerializer to be exact, I am able to serialize my Django models. However, when I send a get request using postman my data does not return as Json, but as HTML, I’m not sure exactly what I’m missing. Any suggestions?

/r/django
https://redd.it/lf053k
This media is not supported in your browser
VIEW IN TELEGRAM
[D] Convolution Neural Network Visualization - Made with Unity 3D and lots of Code / source - stefsietz (IG)

https://redd.it/leq2kf
@pythondaily
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/lez6jg
Short Django Reset Password Tutorial

I published a short video earlier today based on a few requests. People have been asking for a tutorial on how to create reset password functionality with Django.

I use the built in functionality from Django, but I override the templates.

If you want to check it out, you can find it here:
https://www.youtube.com/watch?v=ZR8Ymkx30p0

I would love to hear what you think about the content and quality :-)

/r/djangolearning
https://redd.it/lf7d4e
Best ways to increase flask security?

This weekend, I got my first rest api running on heroku. It was a simple POST-GET api for moving data I had stored in a database to a simulation of a frontend interface.

My problem is that the domain branch is incredibly guessable, and it doesn’t take advantage of the random api key I have logged to every user in my database. I haven’t been able to research authentication methods built into flask so any resources on that would be insanely helpful.

My app is built in a way that flask moves json data around, but I want to do it in a way that the user never has to see, with security I don’t have to constantly monitor.

Any and all help is appreciated. Looking for a general-type view of authent on flask.

/r/flask
https://redd.it/lf2w4f
Bitcoin Clipper Malware made in Python




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

Hello everyone! I made bitcoin clipper malware in Python for educational purposes only. If it finds a bitcoin wallet address in your clipboard, it changes it to another bitcoin wallet address. Once the .py file is run, it deletes itself and replicates to the user's %appdata% and hides there. Then it adds itself to the startup registry so that it can run every time the user turns on their pc.

This is a project I created to make it easier for malware analysts or ordinary users to understand how Bitcoin clippers work and can be used for analysis, research, reverse engineering, or review.
(btw I made this for Windows only)

Github Link: https://github.com/NightfallGT/BTC-Clipper

/r/Python
https://redd.it/lf3kuo
Machine Learning Library by 14-year old : SeaLion

Recently as a 14-year old in high school I've created a machine learning library, SeaLion, from scratch. It took around 3 months of programming, and is 5k+ lines and uses Python and Cython. The library is very well maintained (80 releases in the last month.)

You can install this library with pip. It's on PyPI : https://pypi.org/project/sealion/ and GitHub : https://github.com/anish-lakkapragada/SeaLion

A problem I saw with the current ml libraries and tutorials was that they didn't go over too much into the theory of these libraries - more so on just the syntax and calling the functions. In the summer of 2020 I could easily build a CNN or RNN in tensorflow, but I didn't understand it - hence I decided to start learning from scratch.

SeaLion is an extremely comprehensive library that spans from basic Linear Regression up to modern approaches like deep neural networks. It mostly deals with regression, unsupervised clustering, bayesian models, dimensionality reduction, neural networks, etc. If you've never heard some of those algorithms before (or just are a complete beginner to ML), you are in the right place!! SeaLion has plenty of code examples to help guide you through each step of the way!

The examples

/r/Python
https://redd.it/lf59bw