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 Vs Rails

hi

i am interested in learning a framework for web. i have read that Django is more modern but rails is fast. it is not clear which one i should learn. rails has been around for a while now and people are saying it is dying. is this true?

i would love to know your opinions

/r/django
https://redd.it/8i5b0y
Help with wtforms and socketio/session data

Hi, I’m new to flask and web development. I’m building my first web app with flask and loving it, learning a lot. My web app allows people to join groups and chat with each other on the specific group page. Wondering what is a good way to pass the username back to client with the message? Or should I put the username in the html (I have it as a variable in the view function), and then try to access it in my jquery script?

Also, I have a basic question about wtforms classes. I am currently using the Form class but am interested in the FlaskForm class. It seems from what I’ve read that FlaskForm offers more. Just interested in the difference/benefits of either.

/r/flask
https://redd.it/8gacsp
Air pollution analysis with pandas

Hi,
I have started a project where I try to analyse air pollution data from monitoring sites in Munich, Germany. Anybody knows of publicly accessible air quality analysis using python/pandas? My initial scripts:

https://github.com/jsln/aq-sensor-data-analysis

I want to extract as much information as I can from the samples before attempting to use scikit-learn to:

- Compare the performance of different forecasting models.
- Study correlations between samples at different monitoring stations.

Any work in this area you can point me at, I would appreciate it.

Thanks,
Juan.

/r/pystats
https://redd.it/8i8fhe
[Code Review] I'm working on a vinyl trading API and it's currently WIP but I'd like some feedback.

Link: https://github.com/mabbie/vinylhandelsclub-api

I still have ways to go before the project is complete, mainly security and handling logging in and out users. But so far, how am I doing? I used Flask-RESTful to build the API, and Flask-JWT-Extended for JWT authentication.

/r/flask
https://redd.it/8dzhyb
Is anybody doing qualitative data analysis in Jupyter / IPython?

For R there is the RQDA package and a number of other tools related to qualitative data analysis. There are very few IPython notebooks on the web that deal with qualitative sociological approaches, but most of them are undocumented.

Therefore my question: is anybody doing a qualitative project in a Jupyter notebook? Would you like to present it here and post a short description of what it is about?

/r/IPython
https://redd.it/8i3r72
How to "visit" a page without "visiting" it in Flask?

Okay, so I might just be confused as fuck or something.

When I 'visit' a page that triggers a route on my app, say like '/install', that route executes and redirects to another route, eventually generating an auth code.

Now, I want to run this route, without having to visit the page - so basically, I am trying to run this route so that I can get the auth code in the end.

Now I am calling this route from an external website. I am simply sending a GET request to a function 'load' and in that function there is another function called: get_install(), which contains the below code.

call = requests.get(url_for('install', _external = True, _scheme = "https"))

Now this code works but when I type print (request.args) nothing comes up.

So I am wondering, how do I execute the install route without visiting the {my_app_url}/install route?


/r/flask
https://redd.it/8dyr7z
Custom module not running in Notebook

Hi all,

Say I have the following in my notebook:

// some code
// bunch of other code

It runs perfectly, but if I try to create a bunchofothercode.py file and put // bunch of other code in it, and then:

// some code
import bunchofothercode

This doesn't give any errors, but it doesn't run the code.

I'm sure I am missing something, but I don't know what :)

/r/IPython
https://redd.it/8id40o
How to combine docker instances and Apache web server for django scaling ?

I am having a doubt about scalabilty. Does configuring an Apache web server and running ,multiple instances docker multiply scalabilty ,does it increase max no requests ? What advantage do we get having cluster of computers along with web server ? What is differnce between having a load- balancer and also configuring Apache web server for having max concurrent request ?

Edit: I re frame my question,how to scale django for large web apps like 1 million users,how many simultaneous requests can a django app handle ?,how to configure my django application in such a way.

/r/django
https://redd.it/8iezsb
How to manually use bcrypt?

I followed the [Password management documentation](https://docs.djangoproject.com/en/2.0/topics/auth/passwords/) and managed to download the bcrypt library and use bcrypt as my password hasher. But now additionally to hashing passwords I want to use bcrypt for some other uses and create a few hashes in a python file. How can I import it and use the commands such as bcrypt.gensalt etc?

/r/django
https://redd.it/8iggc6
display certain number of digits

I'm using jupyter and although the following piece of code produce the proper output:

np.set_printoptions(precision=3)
print(np.array([1.123456789]))
>>> 1.123

When I use the following, as it is not a np object, it doesn't take into account the restrictions:

np.set_printoptions(precision=3)
print(1.123456789)
>>> 1.1233456789

I would like to have the same output as for np object.

Thanks in advance



/r/IPython
https://redd.it/8ifuwq