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
[AF} Are mostly integration tests "acceptable"?

Most tests that I've seen rely on integration tests with very few, if any unit tests. I haven't seen any mocks. Is this normal practice for Flask (and/or Django) projects? I'm trying to learn the best practices but I can't figure that out. Right now, I'm writing integration tests for my routes (using sqllite db) with few unit tests.

/r/flask
https://redd.it/89f2nz
Is there any recent app to keep track of transactions / account balances?

Hello there! Diggin' in Google i just found two:

The oscar's accounts app:
https://github.com/django-oscar/django-oscar-accounts
(This requires Oscar, which i don't need)

And this fork of the same project:
https://github.com/carver/django-account-balances
(Which is not updated, and doesn't work with recent Django versions)

I think i'll have to download the last one and try to upgrade it myself. I didn't want to make my own system off the ground mainly because of being afraid of transaction bugs, i would rather leave it to people that know better than me. Thank you very much!

/r/django
https://redd.it/89tbxn
LDAP auth in view (not system)

Hey all,

I'm trying to manually authenticate LDAP users through a view. All search results seem to focus on using LDAP for Django users, which I don't want.

In essence, I want to receive a user/pass combination as POST parameters, and connect to the LDAP server in the view, send the data, and process the result. Is there a library for this?

/r/django
https://redd.it/89scxu
What are the 'secrets' that should be kept secret?

Newbie here, I have read on guides and articles that when using version control and during deployment, there are stuff that should be kept secret.

1. Is this only necessary when the project involves multiple devs? Is it still required if it is a personal project and I keep the repo private?

2. The only secret variables that I know of are SECRET_KEY and DATABASES variables. Are there anything else that should be kept secret?

/r/django
https://redd.it/89rq18
Python Libraries for ETL Data Validation?

I am looking for a python library to validate the output of etl jobs that use sql statement and an expected value. Then if the tests fail there are callbacks I can use, or possibly a dashboard that is updated with the failed tests. Anyone aware of anything that fits the bill?

/r/Python
https://redd.it/89vr6a
Suggestions on how to mimic this visualization in Python?

/r/Python
https://redd.it/89wogl
JQery pretty much the only way to call Function without reloading page?

Still pretty new to Django but I've gotten to a point with my website where I want the user to press a button which calls a python function, return the values and then replace various bits of html needed WITHOUT reloading the entire page.

So far my searching has mostly come up with these kind of [solutions](https://stackoverflow.com/questions/17599035/django-how-can-i-call-a-view-function-from-template)... I assumed Django had a "Django Way" for doing this kind of thing.. maybe using jinja or something, but I can't seem to find it.. or atleast can't find what I assume I am looking for.

What is the proper way of doing what I am talking about?

/r/djangolearning
https://redd.it/89svb6
Questions from a beginner about hosting a Django website

I'm new to webdev in general and pretty much finished my first django project but I'm not sure about a few things when it comes to hosting, would really appreciate it if someone could help me out here:

1.Right now I'm using a DigitalOcean one click app to host my site and it works fine, but is this still a good option when the amount
of traffic for example is increasing?

2.So I've seen that you can host the database (MySQL) on the server it's self or using a 3rd party service which I'm doing right now
just cause it's easier, is there a reason I would have to run my DB on my server at some point (again e.g more trafic)?


/r/django
https://redd.it/89yo3p
Need help with Javascript and Django

I currently have a very small Javascript application that has a input field and then searches the OMDB API to get results for the entered keyword. I was to dramatically expand the application and for that I need a backend. I’m going to use Django because I have experience with it, but there is one thing I’m not sure about. Should I keep using Javascript to request information from the API, or should i use Django to do it instead? I don’t know which way is the “more correct” way of doing it. Thanks in advance!

/r/djangolearning
https://redd.it/8a0qse
MatchIt in python

Do we have something similar to R 'MatchIt' package in python. In order to match study and control items using different methods ( propensity score might be one of them)? I came across CasualInference (http://causalinferenceinpython.org/causalinference.core.html), but it seems somewhat limited to only propensity score.

/r/pystats
https://redd.it/8a20hz