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
URL not found

Hey!

I've just started my first problem and I've run into a problem. I get a 404 when trying to run the given code with the given template. Does anyone see the issue?

https://preview.redd.it/0uprbg4e2kk51.png?width=434&format=png&auto=webp&s=0dcfe3ed359fb97248e1d960d849585ab02e6273

https://preview.redd.it/7fmbxk4e2kk51.png?width=545&format=png&auto=webp&s=96227087d1981dce3b99d92a09eba237e65b8678

The issue occured when I added {content} (i have no idea how this is called) in the html file.

/r/flask
https://redd.it/ikn4z3
HW help

Hey there,

I'm taking a programming class (zero experience with programming) as an elective and ran into some difficultly. My professor is asking to me to use the quadratic formula by plunging in the values given. For some context, leading up to this assignment we have discussed f strings, different types of print functions, and conversion functions. I'm not asking for someone to just give me the necessary code language, but rather hints and clues so I can figure it out on my own. I find programming really interesting and I want to be able to nail the fundamentals.

/r/IPython
https://redd.it/ikwww2
Class 'builtins.list' is not mapped

@seller_bp.route('/dashboard/products/', methods=['GET'])
def product_page():
return render_template('/seller/products.html', message=get_flashed_messages(), products=Products().queryProducts('sellerID', current_user.get_id()))

@seller_bp.route('/dashboard/delete/product/<productID>', methods=['GET'])
def delete_product(productID):
Products().delete(productID)
ProductDelivery().delete(productID)

flash('Product Deleted')
return redirect(url_for('seller_bp.product_page'))

def delete(self, productID):
query = self.query.filter_by(productID=productID).all()
for item in query:
db.session.delete(query)
db.session.commit()

It deletes the product(s) from the database. However it returns an error of:

`sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.NoneType' is not mapped`

I can't figure out what is causing this error

/r/flask
https://redd.it/ikmy45
Wednesday megathread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

/r/Python
https://redd.it/ikw1d1
installed pillow but still get ( users.Profile.image: (fields.E210) Cannot use ImageField because Pillow is not installed) eror

&#x200B;

https://preview.redd.it/9qqa6blxjnk51.png?width=1366&format=png&auto=webp&s=5e77546028639cfdaf901d8f53500dfce42987de

for makemigrations it needed to install pillow ( for ImageFiled) and i installed but i get the same eror , anyone knows solution?

&#x200B;

&#x200B;

EDIT : i solved it myself . apparently pillow didn't isntalled so i used comamnd and ran cmd and i installed it there .

/r/django
https://redd.it/ikz51w
[D] Machine Learning - WAYR (What Are You Reading) - Week 94

This is a place to share machine learning research papers, journals, and articles that you're reading this week. If it relates to what you're researching, by all means elaborate and give us your insight, otherwise it could just be an interesting paper you've read.

Please try to provide some insight from your understanding and please don't post things which are present in wiki.

Preferably you should link the arxiv page (not the PDF, you can easily access the PDF from the summary page but not the other way around) or any other pertinent links.

Previous weeks :

|1-10|11-20|21-30|31-40|41-50|51-60|61-70|71-80|81-90|91-100|
|----|-----|-----|-----|-----|-----|-----|-----|-----|------|
|[Week 1](https://www.reddit.com/4qyjiq)|[Week 11](https://www.reddit.com/57xw56)|[Week 21](https://www.reddit.com/60ildf)|[Week 31](https://www.reddit.com/6s0k1u)|[Week 41](https://www.reddit.com/7tn2ax)|[Week 51](https://reddit.com/9s9el5)|[Week 61](https://reddit.com/bfsx4z)|[Week 71](https://reddit.com/d7vno3)|[Week 81](https://reddit.com/f1f0iq)|[Week 91](https://reddit.com/hlt38o)||||||||
|[Week 2](https://www.reddit.com/4s2xqm)|[Week 12](https://www.reddit.com/5acb1t)|[Week 22](https://www.reddit.com/64jwde)|[Week 32](https://www.reddit.com/72ab5y)|[Week 42](https://www.reddit.com/7wvjfk)|[Week 52](https://reddit.com/a4opot)|[Week 62](https://reddit.com/bl29ov)|[Week 72](https://reddit.com/de8h48)|[Week 82](https://reddit.com/f8fs6z)|[Week 92](https://reddit.com/hu6zq9)||
|[Week 3](https://www.reddit.com/4t7mqm)|[Week 13](https://www.reddit.com/5cwfb6)|[Week 23](https://www.reddit.com/674331)|[Week 33](https://www.reddit.com/75405d)|[Week 43](https://www.reddit.com/807ex4)|[Week 53](https://reddit.com/a8yaro)|[Week 63](https://reddit.com/bqlb3v)|[Week 73](https://reddit.com/dkox1s)|[Week 83](https://reddit.com/ffi41b)|[Week 93](https://reddit.com/iaz892)||
|[Week 4](https://www.reddit.com/4ub2kw)|[Week 14](https://www.reddit.com/5fc5mh)|[Week 24](https://www.reddit.com/68hhhb)|[Week 34](https://www.reddit.com/782js9)|[Week 44](https://reddit.com/8aluhs)|[Week 54](https://reddit.com/ad9ssz)|[Week 64](https://reddit.com/bw1jm7)|[Week 74](https://reddit.com/dr6nca)|[Week 84](https://reddit.com/fn62r1)||
|[Week 5](https://www.reddit.com/4xomf7)|[Week 15](https://www.reddit.com/5hy4ur)|[Week 25](https://www.reddit.com/69teiz)|[Week 35](https://www.reddit.com/7b0av0)|[Week 45](https://reddit.com/8tnnez)|[Week 55](https://reddit.com/ai29gi)|[Week 65](https://reddit.com/c7itkk)|[Week 75](https://reddit.com/dxshkg)|[Week 85](https://reddit.com/fvk7j6)||
|[Week 6](https://www.reddit.com/4zcyvk)|[Week 16](https://www.reddit.com/5kd6vd)|[Week 26](https://www.reddit.com/6d7nb1)|[Week 36](https://www.reddit.com/7e3fx6)|[Week 46](https://reddit.com/8x48oj)|[Week 56](https://reddit.com/ap8ctk)|[Week 66](https://reddit.com/cd7gko)|[Week 76](https://reddit.com/e4nmyk)|[Week 86](https://reddit.com/g4eavg)||
|[Week 7](https://www.reddit.com/52t6mo)|[Week 17](https://www.reddit.com/5ob7dx)|[Week 27](https://www.reddit.com/6gngwc)|[Week 37](https://www.reddit.com/7hcc2c)|[Week 47](https://reddit.com/910jmh)|[Week 57](https://reddit.com/auci7c)|[Week 67](https://reddit.com/cj0kyc)|[Week 77](https://reddit.com/eb4lxk)|[Week 87](https://reddit.com/gcx3uf)||
|[Week 8](https://www.reddit.com/53heol)|[Week 18](https://www.reddit.com/5r14yd)|[Week 28](https://www.reddit.com/6jgdva)|[Week 38](https://www.reddit.com/7kgcqr)|[Week 48](https://reddit.com/94up0g)|[Week 58](https://reddit.com/azjoht)|[Week 68](https://reddit.com/cp1jex)|[Week 78](https://reddit.com/ehbfst)|[Week 88](https://reddit.com/glm6sv)||
|[Week 9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)|[Week 59](https://reddit.com/b50r5y)|[Week 69](https://reddit.com/cvde5a)|[Week 79](https://reddit.com/entcxy)|[Week 89](https://reddit.com/gu5t0d)||
|[Week 10](https://www.reddit.com/56s2oa)|[Week
PostgreSQL with Flask-SQLAlchemy Security - '?' Sign

So in a databases like SQlite3 we use the following to avoid SQL Injection

`select * from database WHERE column = ?`

What is the equivalent for it while using SQLAlchemy?

Is something like this acceptable while using PostgreSQL with SQLAlchemy?

`table.query.filter_by(column = ?)`

/r/flask
https://redd.it/ikox1t
All You Need to Know about WSGI

Hi!

Here is a [screencast](https://www.youtube.com/watch?v=UklcIDgHtwQ) \- Titled All You Need to Know about WSGI. It is my informal way of explaining what is WSGI. This screencast used to be paid, but I will release all PRO lessons for free, since I am busy with my main project - [Papermerge](https://www.papermerge.com) (<- Django based free and open source document management system).

Thank you Django community for fantastic support, I really love Python, Django and your community in general!

/r/django
https://redd.it/il2qfw
Editing Unicode text in a notebook

I am currently transcribing a lot of audio files which are in a remote server. I use IPython audio to listen to them in the browser and loop over them

I want to be able to see and edit the text on that notebook too. I installed a keyboard for my local language on my computer.
Is there a better method instead of using an input method, more like a built-in text editor so I can do editing in the browser?

It's a huge hassle to switch between screens and I want to do it all in a browser.

Edit: It has to support Unicode.

Thank you!

/r/IPython
https://redd.it/ikmpmt
Is there a full on boilerplate for flask development?

I’m been working on a project where I done most of the front end but can’t seem to really optimize the backend as I’m new and still getting into flask. Is there a possibility that a boilerplate exists and I can just plug everything in? The only hard part in my website is receiving data from a form and storing it in SQLite, other than that everything else is static and super simple! Thanks in advance guys.

/r/flask
https://redd.it/il31va
ALT key Menu commands

Hi, do ALT key menu commands work somehow? For example, ALT+F for the "File" menu, ALT+E for the "Edit" menu, and so on.
I've searched to no avail, so I just want to make sure I'm not missing something easy. Thanks!

/r/JupyterNotebooks
https://redd.it/il6u5c
How to deal with compromised user accounts?

Hi guys,

I'm taking care of a Django applications. It's a fairly large application, it's a social network. The application staff reported compromised user accounts posting porn spam. There are at least 1100 accounts posting spam.

I'm getting this kind of messages on the comment comments section:

¡Las chicas jóvenes y hermosas quieren conocerte! El mejor sitio de citas sexuales gratis! entra y únete http://sexdating.webjx.site

How to deal with this kind of problem?

/r/django
https://redd.it/il8ph4
Accessing Windows located Firebird Database from Docker contained Django

I am trying to access Firebird Database files located in C:/ drive from Docker Contained Django Application.
I am using Python fdb package for accessing this.

self.conn = fdb.connect( host='192.168.0.108', port=3050, database='/FIREBIRD_DB/TEST.FDB', user=usr, password=pswd
)

It generates error:
Exception: The location of Firebird Client Library could not be determined.


Deseperately looking for help on how can i access the firebird database. Thanks in advance

/r/django
https://redd.it/ilcyv0
For those who are self-taught, exactly what topics did you learn to get your job?

Im a 100% self-taught, beginner in learning python, and this is my first ever brush with anything computer science-related. I would love to become a jr software developer in the next 1-2 years (preferably back-end but am obviously willing to try anything), but im lost on what to learn. I understand the best way to learn is writing code aka doing projects, but what do i LEARN first to get to that point?

Right now, im still in the middle of Automate the Boring Stuff. I do practice problems the book has as i learn each topic (practice projects). Some have advised me to learn data structures next. Im lost on what to learn after data structures, and what to learn after that. What topics should I be studying next to at least get my foot in the door for an interview in the future?

&#x200B;

Does anyone have advice on general roadmap of topics to learn that would help me have a solid understanding? Each topic/skill i do, i will be creating mini projects as i learn, but my main issue is, what do i learn? For those who started a job as jr developer or even internship, what

/r/Python
https://redd.it/ilcqhq
Possible syntax issue with app routes and variables

/r/flask
https://redd.it/ileg73
[D] ECCV 2020: paper summaries and highlights (blog post)

Hi;

I thought I write a blog post where I highlight some of the things that caught my attention while browsing this year's ECCV conference. The blog post contains summaries of some papers (and the mention of some) that I thought were nice (note: this is just a sample, I certainly missed a lot of cool ones).

The post might be helpful to get a general feel of this year's conference quickly since the number of papers (>1.3K) can be overwhelming at times. Check it out!

Blog post: https://yassouali.github.io/ml-blog/eccv2020/

/r/MachineLearning
https://redd.it/il94f4
[P] Vulkan as an alternative to CUDA in scientific simulation software - computational magnetism

This is a continuation post to the [VkFFT announcement](https://www.reddit.com/r/MachineLearning/comments/ia6gv1/p_new_vulkan_fft_library_vkfft_opensource/). Here I present an example of scientific application, that outperforms its CUDA counterpart, has no proprietary code behind it and is crossplatform - [Vulkan Spirit](https://github.com/DTolm/spirit). This is a fully GPU version of the computational magnetism package Spirit, developed at FZ Jülich. I hope this post can motivate other scientists (including machine learning researchers) to explore the world of Vulkan for scientific GPU computing, as right now it is heavily dominated by CUDA.

From mathematical point of view, simulation of a magnetic system in micromagnetics can be described as a system of differential equations ([LLG](https://en.wikipedia.org/wiki/Landau%E2%80%93Lifshitz%E2%80%93Gilbert_equation)) on a finite-difference mesh. Each cell's position is influenced by positions of its neighbors, material parameters, external effects and many other things. Successful iterative integration of the LLG system can yield time dynamics, resembling experimentally observed evolutuon of magnetics.

From the programming point of view, simulation software is simpler than the one that has to communicate with the user during runtime. There are no calculations performed on the CPU during the execution, so it is only used to create a command buffer before launch, which is not modified afterwards. Combining multiple iterations in a single command buffer significantly

/r/MachineLearning
https://redd.it/ilcw2f