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
Burnout & Personal Projects

I've been developing web apps using Django as my main tool for about 4 years now.

It started with needing to solve a problem at an old job (requiring a relatively simple CRUD db app with some vaguely interesting front end stuff) and Django seemed like a great tool. I read tutorials and the Django docs and taught myself the basics over a few weeks, refined and expanded the app, read some more, bought a copy of TwoScoops, asked lots of questions on Stack Overflow and on /r/django (shoutout pydanny), and refined it some more. Had some ideas for personal projects that interested me, learned how to use REST APIs, built a reddit bot, read about ML, put a small portfolio together on github and ended up getting headhunted to be the lead developer at a company with some interesting tech problems to solve and a Django codebase that was in desperate need of some TLC.

Fast forward a few years and professionally things have been great, the money has grown, but so has the responsibility and mental energy required.

I just realised its now been months since I touched a personal project or did any development outside of

/r/django
https://redd.it/cgn3q2
500+ Python Machine Learning Applications in Various Industries

An exhaustive ML/DS list sorted by industry.

​

1500+ Stars on GitHub:

[https://github.com/firmai/industry-machine-learning](https://github.com/firmai/industry-machine-learning)

Join the new list to get access to the catalogue from November 2019 - November 2020.

​

||||
|:-|:-|:-|
|[Accommodation & Food](https://github.com/firmai/industry-machine-learning#accommodation)|[Agriculture](https://github.com/firmai/industry-machine-learning#agriculture)|[Banking & Insurance](https://github.com/firmai/industry-machine-learning#bankfin)|
|[Biotechnological & Life Sciences](https://github.com/firmai/industry-machine-learning#biotech)|[Construction & Engineering](https://github.com/firmai/industry-machine-learning#construction)|[Education & Research](https://github.com/firmai/industry-machine-learning#education)|
|[Emergency & Relief](https://github.com/firmai/industry-machine-learning#emergency)|[Finance](https://github.com/firmai/industry-machine-learning#finance)|[Manufacturing](https://github.com/firmai/industry-machine-learning#manufacturing)|
|[Government and Public Works](https://github.com/firmai/industry-machine-learning#public)|[Healthcare](https://github.com/firmai/industry-machine-learning#healthcare)|[Media & Publishing](https://github.com/firmai/industry-machine-learning#media)|
|[Justice, Law and Regulations](https://github.com/firmai/industry-machine-learning#legal)|[Miscellaneous](https://github.com/firmai/industry-machine-learning#miscellaneous)|[Accounting](https://github.com/firmai/industry-machine-learning#accounting)|
|[Real Estate, Rental & Leasing](https://github.com/firmai/industry-machine-learning#realestate)|[Utilities](https://github.com/firmai/industry-machine-learning#utilities)|[Wholesale & Retail](https://github.com/firmai/industry-machine-learning#wholesale)|

/r/Python
https://redd.it/cgclop
What are the best ways to learn TDD with Django?

Hey guys,

I have been learning Django for the past 6 months and I want to be better at Python and specifically Django (Specifically Django 2.1+ or at least Django 2.0+ if possible). I am currently trying to learn about unit/functional testing in Django.

I tried looking at obeythetestinggoat, test-driven-django-development etc., i noticed most of the them are in Django 1.11 (LTS edition) or Django 1.6 etc.) which all of them are not in DJango 2.0. I am quite worried about the compatibility issues that I will come across if I follow these tutorials. Also, I am quite concern that these tutorials might be outdated pretty soon in the near future, that's why I feel pretty reluctant.

What are some of the good resources/best practices for TDD out there for Django 2.0+?

Also, any good django learning resources (about best practices etc.) are welcomed too!

I really appreciate your help! Thanks! You guys are awesome!

/r/django
https://redd.it/cgpsgn
Jobs in Django development

Here in Gurugram,India jobs for A fresher in Django development are very few and less paid compare to nodejs & php. Which makes me think whether Django is worth it? Or what skills should you learn with Django to grab a better offer.
Would love to see what people think about it!

/r/django
https://redd.it/cgqs70
Unique_together not working

Hey guys,

​

I have a problem with unique\_together.

In my DB I have a composite/multi-column key with two fields.

In my models.py im trying this:

​

class CheckSequences(models.Model):
sequence = models.CharField(db_column='SEQUENCE', max_length=50)
category = models.CharField(db_column='CATEGORY', max_length=100)
active = models.CharField(db_column='ACTIVE', max_length=5)
rule_number = models.CharField(db_column='RULE_NUMBER', max_length=50)

class Meta:
managed = False
db_table = 'CHECK_SEQUENCES'
unique_together = ("sequence", "category")

Since only one `primary_key` is allowed, this is the only solution I found to realize that.

But somehow, I always get this error:

​

('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'id'. (207) (SQLExecDirectW)")

I think Django tries to find the auto-generated Id-field but obviously it doesn't exist, since I have a composite primary key.

I am using Django 2.1.0, I also considered to upgrade to 2.2.0 but that would be probematic through some dependencies.

​

I would appreciate any help and thoughts, if you need more information let me know.

​

Thanks

/r/django
https://redd.it/cgsr43
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/cgt306
Is this possible with django?

Hi Guys,

i'm relatively new to web development so pls be kind :D


So i'm trying to create a image gallery like this one: [https://scrolller.com](https://scrolller.com/)
Can I create such gallery only with django? How can i align the pictures together but keep their different sizes?

/r/django
https://redd.it/cgveiu
I'm really excited to announce the release of flask-praetorian 1.0.0!

It's here: [https://pypi.org/project/flask-praetorian/](https://pypi.org/project/flask-praetorian/)

​

I took way to long to finish up the last features for this release, but I'm excited to move to a new major release. Thanks to those that have been starring or suggesting the extension, and real big thanks to [pahrofit@github](https://github.com/pahrohfit) who contributed the *email registration* and *verify and update* features for the 1.0 release.

​

Constructive feedback welcome!

/r/flask
https://redd.it/ch03ng
Updating changed data displayed in active sessions screens

Say you have an app where multiple users are looking at the same data, and when data is updated by one user, you want to update the other users screens.

By what mechanism can Django do this , or what packages would be needed or recommended for this type of functionality?

/r/django
https://redd.it/ch2kri
Made a bot that plays sushi-go-round well enough to finish the whole game.

​

[Link to github: https:\/\/github.com\/nickbiso\/Sushi-go-round-bot\/blob\/master\/Sushi-go-round%20Bot%20.ipynb ](https://reddit.com/link/ch1k6g/video/69yl9ctem5c31/player)

/r/Python
https://redd.it/ch1k6g
Simple Rent Prorate Calculator

Its not much but it's the first project I've done myself with out a tutorial or guide. I use it at work to calculator residents rent prorate at move in or move out. Working now to code a GUI version with pyqt5.

[https://github.com/simmiek3/ProCal](https://github.com/simmiek3/ProCal)

/r/Python
https://redd.it/ch2jq5
Best Practices for Testing DRF

Hey Everyone,

​

I'm just starting to write some unit tests for an ongoing project I have that has a react front end and a django rest framework backend in lambda.

​

My tests right now are using APITestCase and APIClient from rest\_framework.test and I'm just following the instructions from the Django Rest Framework docs [here](https://www.django-rest-framework.org/api-guide/testing/).

​

Functionally, everything is working fine. My question is more from a birds eye view. What *exactly* should I be testing? Right now I'm setting up users with various permissions and making sure that certain views return 403's if they don't have the correct permissions (because we handle some permissions manually). Then I'm doing things like making sure that HTTP PATCH's are correctly updating objects in the database. However, I'm wondering if some of this is redundant? I guess I don't know where I should just be "trusting the framework" and where I should actually be testing the code.

​

Does anyone have any input or could point me towards any resources regarding best practices for testing DRF apps?

​

Thanks for any and all help!

/r/django
https://redd.it/cgyvmd
"Recompiling" Python to find different directory when importing a module

Hi. I don't know much about Python as a system.

Now I need to use a legacy version of Ubuntu (14.xx) and

I've found my Python imports the old version of an application(sqlite3),

even after installing some latest version of that.(using sudo apt-get install sqlite3)



How can I "recompile" python to look for a different directory?

(I don't know what recompiling means exactly but googled and found the term to describe my situation)

​

​

Below is how I installed sqlite3 in a way other than "sudo apt-get ... " in order to fix this problem.

`cd /tmp/`

`wget https://sqlite.org/2019/sqlite-autoconf-3290000.tar.gz`

`tar xzvf sqlite-autoconf-3290000.tar.gz`

`cd sqlite-autoconf-3290000`

`./configure`

`make`

`make install`

​

But since I don't understand what the commands mean above, I don't know where it's installed exactly(under /tmp? or /usr/local/lib)

after checking into usr/local/lib, I found sqlite3 files but not sure which version it is.

​

How can I make python include a new version of sqlite3 when importing the module?

Thank you for your help in advance.

/r/Python
https://redd.it/ch4onz
is there an existing framework I can use to develope a buy and sell app for 2nd hand goods?

Hello, the app that I used in our country is no more. Basically, it was an app that allows people to post things that they want to sell.

​

I believe the requirements are super easy, and I would like to develop a replica of it. Is there an existing framework that could help me fast track my development? I read about mezzanine's cartridge but is a complete ecommerce which includes payment transaction and I don't need that. Are there other alternatives?

/r/django
https://redd.it/ch5965
Looking for a good Theme for PyCharm

hey guys im moving from Java to Python and i would love your help in finding a good Theme or Color Scheme for Python (in PyCharm)

​

i love the ReconEyez for java but it not good for Python

​

do you have any recommendations for a Dark and Colorful Theme??

/r/Python
https://redd.it/ch5wna
Message broker or Database for access to run data in web app?

Hi,

I am currently developing a web app with flask. In flask I let the user upload a file and then as soon as it is uploaded I start a background process with an application that works on the uploaded file and generates a data structure that I want to use for displaying plots and graphs to the user in the browser.

Now to make this possible I need to poll the background process for run data so that I can periodically, while my background process is running, output the already processed data with my flask app.

My question is if a Message broker like RQ (Redis Queue) with its job.meta\[\] field is sufficient to access this data, which can get quite big, or if I need a database like MongoDB which my background process constantly fills with already processed data and my flask app just reads the data from the database. I read that that might be a "antipattern" which should be avoided, but because the data I need can be a gigantic dictionary, I don't really know if Redis can handle that efficiently.

Does anyone have some experience with RQ and can help me out here? My plan is to essentially

/r/Python
https://redd.it/ch6qkb
This media is not supported in your browser
VIEW IN TELEGRAM
Lately I got nothing to do so I decided to work on my school project for next year and I’ve made a program that tracks moving objects in a specific area and sends me a picture of the moving object in the discord

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