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
How do I set a redirect URL to be localhost if debug is true or the production URL if debug is false?

I remember stumbling across an SO post about this but I can't find it anymore. :(

I remember seeing there was a way to at least code in a way to serve static files via local or S3 depending on the value of debug. Anyone know how to do this?

/r/flask
https://redd.it/8a5k8t
LOGGING not writing to file

I'm trying to set up logging in my app and I can't seem to get it to write to a file, am I missing something obvious?

Let's assume my applications is named myApp and that i have `debug.log` there

thanks in advance!


LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},

'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
'file': {
'level': 'INFO',
'class': 'logging.FileHandler',
'filename': 'debug.log',
},
},
'loggers': {
'myApp': {
'handlers': ['file'],
'propagate': True,
},
'myApp.request': {
'handlers': ['console', 'file'],
'level': 'ERROR',
'propagate': False,
},
}
}

/r/djangolearning
https://redd.it/8a4vu2
Job Opening

Would this be the best subreddit to find a Senior Django developer for a three month contract job? Any other subreddits that this is more appropriate?


/r/django
https://redd.it/8a67iy
[AF] associating a hyperlink with a python function

How does one associate a link with a python function? I'm trying to make an application that will graph different datasets in matplotlib and display them accordingly. Essentially, when the link is clicked, I want the function to graph the according dataset, output it to an image and then display it on the webpage.

Full disclosure: I'm an absolute noob when it comes to Flask but I know some python and html/css. I'm mainly trying to make a gui for a python app I'm writing but I couldn't figure out Kivy with the amount of time I have and figured this might be a better option.

Thanks in advance

/r/flask
https://redd.it/8a0k3g
Don't you wish it were this easy? [Lupin III Part V]

/r/Python
https://redd.it/8a555u
Change the Jupyter Notebook font to Comic Sans

I know this might not be the place to ask this question, but I am a TA and I want to annoy my students. I found this guy [jupyter themes](https://github.com/dunovank/jupyter-themes) who changes the theme for the notebook, but to my chagrin, the themes available do not have comic sans. Would like to hear from you guys soon. Thank you!

/r/Python
https://redd.it/8a8jb8
Stream real-time data into Excel with Python!

Hi again /r/Python!

We're [Gridarrow](https://www.gridarrow.com/), a small startup from Amsterdam. [A few months ago](https://www.reddit.com/r/Python/comments/6u9psy/stream_realtime_data_into_excel_with_python/) we've announced our product here - a platform for streaming real-time data into Excel using Python scripts.

We're happy to let you know that we're open for Beta signups now! You can join us using a form on [our website](https://www.gridarrow.com/).

[Here's how the platform works](https://www.gridarrow.com/docs/getting-started/). Also go ahead a check out [our blog](https://www.gridarrow.com/blog/) where we showcase a couple of cool things you can do with Gridarrow.

For example:

- [Streaming real-time stock prices into Excel](https://www.gridarrow.com/blog/streaming-realtime-stock-prices-into-excel/)
- [Live news sentiment analysis using pysentiment](https://www.gridarrow.com/blog/financial-news-sentiment-analysis-using-xignite-and-pysentiment/)
- [Real-time Twitter map in your spreadsheet](https://www.gridarrow.com/blog/creating-a-realtime-twitter-map/)

We're really curious to hear your feedback!

Cheers!
The Gridarrow Team

/r/Python
https://redd.it/8a97gs
Its out!

/r/flask
https://redd.it/8abz4y
How can I make urls.py recognized as python file again? This way I can't use autocomplete and syntax helps

/r/django
https://redd.it/8acsvo