Django models
What is the use of models if I am not storing any data in the database? I am purely getting data from the database to display on the template.
/r/django
https://redd.it/cbbdhc
What is the use of models if I am not storing any data in the database? I am purely getting data from the database to display on the template.
/r/django
https://redd.it/cbbdhc
reddit
r/django - Django models
1 vote and 3 comments so far on Reddit
Flask Restful API
Hey,
I want to master creating APIs in flask for big applications using flask Restful and blueprints which documentation should i follow to be a pro in this.
Any suggestion will be appreciated.
/r/flask
https://redd.it/cbdu5m
Hey,
I want to master creating APIs in flask for big applications using flask Restful and blueprints which documentation should i follow to be a pro in this.
Any suggestion will be appreciated.
/r/flask
https://redd.it/cbdu5m
reddit
r/flask - Flask Restful API
0 votes and 0 comments so far on Reddit
Can anybody pls pls pls help me
I have this statement to fetch data from database posts=Posts.query.filter_by().all(). So, my question is posts is class and query is attribute and after query there is function filter_by so why we put attribute before query I want to know how it's work. And one more thing after function filter_by()another function .all(). So,how these function and attribute works from under the hood
/r/flask
https://redd.it/cbc1c1
I have this statement to fetch data from database posts=Posts.query.filter_by().all(). So, my question is posts is class and query is attribute and after query there is function filter_by so why we put attribute before query I want to know how it's work. And one more thing after function filter_by()another function .all(). So,how these function and attribute works from under the hood
/r/flask
https://redd.it/cbc1c1
reddit
r/flask - Can anybody pls pls pls help me
0 votes and 2 comments so far on Reddit
Video | List Files in a Directory | 1:44
https://www.youtube.com/watch?v=EbHgUA4Sgq4
/r/Python
https://redd.it/cbf28o
https://www.youtube.com/watch?v=EbHgUA4Sgq4
/r/Python
https://redd.it/cbf28o
YouTube
Python | List Files in a Directory
In this video we look into how to list the files and the directory of current path or a specific path using the os library and the glob library. The os library's list dir allows for easy and simple listing of directory of current and specific path, while…
Help finding it hard to memorize all the functions and operating languages. Is there a cheatsheet or anything so i don't have to remember all of this?
It doesnt have to be super indepth. Just need something for the basics, strings and whatnot.
/r/Python
https://redd.it/cbfkfm
It doesnt have to be super indepth. Just need something for the basics, strings and whatnot.
/r/Python
https://redd.it/cbfkfm
reddit
r/Python - Help finding it hard to memorize all the functions and operating languages. Is there a cheatsheet or anything so i don't…
0 votes and 8 comments so far on Reddit
Python consumes too much memory, or how to reduce the size of objects
https://habr.com/en/post/458518/
/r/Python
https://redd.it/cbfs1s
https://habr.com/en/post/458518/
/r/Python
https://redd.it/cbfs1s
Habr
Python consumes a lot of memory or how to reduce the size of objects?
A memory problem may arise when a large number of objects are active in RAM during the execution of a program, especially if there are restrictions on the total...
[D] Controversial Theories in ML/AI?
As we know, Deep Learning faces certain issues (e.g., generalizability, data hunger, etc.). If we want to speculate, which controversial theories do you have in your sights you think that it is worth to look nowadays?
So far, I've come across 3 interesting ones:
1. Cognitive science approach by Tenenbaum: [Building machines that learn and think like people](https://arxiv.org/abs/1604.00289). It portrays the problem as an architecture problem.
2. Capsule Networks by Hinton: [Transforming Autoencoders](https://www.cs.toronto.edu/~hinton/absps/transauto6.pdf). More generalizable DL.
3. Neuroscience approach by Hawkins: [The Thousand Brains Theory](https://numenta.com/neuroscience-research/research-publications/papers/a-framework-for-intelligence-and-cortical-function-based-on-grid-cells-in-the-neocortex/). Inspired by the neocortex.
What are your thoughts about those 3 theories or do you have other theories that catch your attention?
/r/MachineLearning
https://redd.it/cbgizh
As we know, Deep Learning faces certain issues (e.g., generalizability, data hunger, etc.). If we want to speculate, which controversial theories do you have in your sights you think that it is worth to look nowadays?
So far, I've come across 3 interesting ones:
1. Cognitive science approach by Tenenbaum: [Building machines that learn and think like people](https://arxiv.org/abs/1604.00289). It portrays the problem as an architecture problem.
2. Capsule Networks by Hinton: [Transforming Autoencoders](https://www.cs.toronto.edu/~hinton/absps/transauto6.pdf). More generalizable DL.
3. Neuroscience approach by Hawkins: [The Thousand Brains Theory](https://numenta.com/neuroscience-research/research-publications/papers/a-framework-for-intelligence-and-cortical-function-based-on-grid-cells-in-the-neocortex/). Inspired by the neocortex.
What are your thoughts about those 3 theories or do you have other theories that catch your attention?
/r/MachineLearning
https://redd.it/cbgizh
arXiv.org
Building Machines That Learn and Think Like People
Recent progress in artificial intelligence (AI) has renewed interest in building systems that learn and think like people. Many advances have come from using deep neural networks trained...
I made a Django app to integrate with Xero. All feedback is welcome!
https://github.com/toyg/django-xero
/r/django
https://redd.it/cbi00c
https://github.com/toyg/django-xero
/r/django
https://redd.it/cbi00c
GitHub
GitHub - toyg/django-xero: Xero integration for Django
Xero integration for Django. Contribute to toyg/django-xero development by creating an account on GitHub.
Lost Phone
Has anyone on this sub lost a phone on Alnmouth beach Northumberland? We can’t ring the contact who text the phone but there was a notification from this sub.
Edit: The phone was found on the beach between Alnmouth and Warkworth
/r/Python
https://redd.it/cbgpqu
Has anyone on this sub lost a phone on Alnmouth beach Northumberland? We can’t ring the contact who text the phone but there was a notification from this sub.
Edit: The phone was found on the beach between Alnmouth and Warkworth
/r/Python
https://redd.it/cbgpqu
reddit
r/Python - Lost Phone
368 votes and 34 comments so far on Reddit
This media is not supported in your browser
VIEW IN TELEGRAM
I made a program which encrypts the RGB value of each pixel using an 8 bit key and xor encryption that i learnt in school. Not sure if there is a real usecase for this however i find it pretty cool
/r/Python
https://redd.it/cbhenw
/r/Python
https://redd.it/cbhenw
Best practice on ATOMIC_REQUESTS
It looks like ATOMIC\_REQUESTS is off by default in Django, but I've talked to a lot of people who turn it on. I agree that it does help reason about requests (since a request can complete fully or not at all), but to me it also creates potential hazards. For instance, what if, as a side-effect, I send a user an alert or something, then end up rolling back the transaction? I could always put that in an "on\_commit" call but that seems tedious.
​
What do people usually do?
/r/django
https://redd.it/cbmehj
It looks like ATOMIC\_REQUESTS is off by default in Django, but I've talked to a lot of people who turn it on. I agree that it does help reason about requests (since a request can complete fully or not at all), but to me it also creates potential hazards. For instance, what if, as a side-effect, I send a user an alert or something, then end up rolling back the transaction? I could always put that in an "on\_commit" call but that seems tedious.
​
What do people usually do?
/r/django
https://redd.it/cbmehj
reddit
r/django - Best practice on ATOMIC_REQUESTS
3 votes and 2 comments so far on Reddit
Learning Python as a blind person, any advice?
So, I've diligently been trying to learn Python on my own, as I've heard there are many advantages to how easy the syntax is. I even tried to make an interest calculator from scratch.
I believe that the only way to learn programming is to type the commands out yourself, even if you have them right in front of you. This enforces true conceptual learning and makes it easier to memorize. I did this with both JS and HTML 5, and they worked. I'm getting my tutorials straight from python.org.
With all of this said, It's really difficult to judge how much white space I need before every line, thus I keep getting syntax errors based on this one simple problem.
As the post title states, I am indeed fully blind, as in can't see at all. So, it's really difficult to judge the amount of white space required for this reason, and Idol is not exactly screen reader friendly either. Unfortunately, as I know that Idol is what comes with Python when you get it. I'm currently running Python 3.7.
With all of this info, do any of you Python programmers have any advice as to which editors are
/r/Python
https://redd.it/cbpcw6
So, I've diligently been trying to learn Python on my own, as I've heard there are many advantages to how easy the syntax is. I even tried to make an interest calculator from scratch.
I believe that the only way to learn programming is to type the commands out yourself, even if you have them right in front of you. This enforces true conceptual learning and makes it easier to memorize. I did this with both JS and HTML 5, and they worked. I'm getting my tutorials straight from python.org.
With all of this said, It's really difficult to judge how much white space I need before every line, thus I keep getting syntax errors based on this one simple problem.
As the post title states, I am indeed fully blind, as in can't see at all. So, it's really difficult to judge the amount of white space required for this reason, and Idol is not exactly screen reader friendly either. Unfortunately, as I know that Idol is what comes with Python when you get it. I'm currently running Python 3.7.
With all of this info, do any of you Python programmers have any advice as to which editors are
/r/Python
https://redd.it/cbpcw6
reddit
r/Python - Learning Python as a blind person, any advice?
8 votes and 14 comments so far on Reddit
Best way to have free and paid member groups.
So I'm working on an app and there will be two tiers: Free and Paid.
Currently I have it working where users who are a part of the "Free User" group can upload 5 files. After that when they try to access the app's upload page, they are returned to a page that says they must be a paid member.
User's in the "Gold Member" (paid member) group can upload unlimited files.
What would be the best process for integrating payment with this? I guess I will use stripe since it seems to be the new paypal.
​
But should I have members be automatically assigned to the free group when they sign up, then give an option to pay later?
​
How would this work? Is there some sort of API integration with stripe where after a payment is submitted, I can do something in django language that changes a user's group?
​
It seems like I should give users the option to become paid straight from signup. Maybe through a checkbox / boolean field? For example after the standard username password and email fields, present:
​
Select Your Membership Level:
Free . . .
/r/django
https://redd.it/cbr8do
So I'm working on an app and there will be two tiers: Free and Paid.
Currently I have it working where users who are a part of the "Free User" group can upload 5 files. After that when they try to access the app's upload page, they are returned to a page that says they must be a paid member.
User's in the "Gold Member" (paid member) group can upload unlimited files.
What would be the best process for integrating payment with this? I guess I will use stripe since it seems to be the new paypal.
​
But should I have members be automatically assigned to the free group when they sign up, then give an option to pay later?
​
How would this work? Is there some sort of API integration with stripe where after a payment is submitted, I can do something in django language that changes a user's group?
​
It seems like I should give users the option to become paid straight from signup. Maybe through a checkbox / boolean field? For example after the standard username password and email fields, present:
​
Select Your Membership Level:
Free . . .
/r/django
https://redd.it/cbr8do
reddit
r/django - Best way to have free and paid member groups.
0 votes and 4 comments so far on Reddit
Crated a fun script to search a particular username on almost every social platform.
https://github.com/7rillionaire/Search4
/r/Python
https://redd.it/cbslog
https://github.com/7rillionaire/Search4
/r/Python
https://redd.it/cbslog
GitHub
0xknown/Search4
Search people on the Internet. Contribute to 0xknown/Search4 development by creating an account on GitHub.
Angular + Python Flask REST API MongoDB CRUD Example - Roy Tutorials
https://www.roytuts.com/angular-python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/cbta5p
https://www.roytuts.com/angular-python-flask-rest-api-mongodb-crud-example/
/r/flask
https://redd.it/cbta5p
reddit
r/flask - Angular + Python Flask REST API MongoDB CRUD Example - Roy Tutorials
0 votes and 0 comments so far on Reddit
What non-Python tech do you use with Django?
As the title says, what non-Python tech do you use with Django? For example, Docker, Travis CI, etc
/r/django
https://redd.it/cbsfm4
As the title says, what non-Python tech do you use with Django? For example, Docker, Travis CI, etc
/r/django
https://redd.it/cbsfm4
reddit
r/django - What non-Python tech do you use with Django?
3 votes and 8 comments so far on Reddit
Server Issues
Tl/dr: What pip installs to get flask working do I need?
Hi! I've just finished creating a small website using python flask and decided it was time to upload it to a hosting server for the world to see. However this has not gone according to plan and I've had to rethink my whole project.
The hosting service I have access to is a2 hosting, they have no documentation on deploying Flask and after asking a member of staff for help I was left hanging.
So, after a few hours of googling around, reading about passenger_wsgi and how it helps apache servers understand python apps I've came to a dead-end.
I've managed to get a basic helloWorld.py file working on the homepage, however when I move to the second page and try to render a template I receive an Internal Server Issue.
I ssh'd into the server to install flask, njinx, jinja2 etc however none of these have fixed my issues. Are there other pip installs I'll need for this to work?
www.jamfish.co.uk
The second url is assigned to '/second'
Thanks for your time today, any help would be amazing. If I figure out how to fix this I'll update the post.
/r/flask
https://redd.it/cbu7qt
Tl/dr: What pip installs to get flask working do I need?
Hi! I've just finished creating a small website using python flask and decided it was time to upload it to a hosting server for the world to see. However this has not gone according to plan and I've had to rethink my whole project.
The hosting service I have access to is a2 hosting, they have no documentation on deploying Flask and after asking a member of staff for help I was left hanging.
So, after a few hours of googling around, reading about passenger_wsgi and how it helps apache servers understand python apps I've came to a dead-end.
I've managed to get a basic helloWorld.py file working on the homepage, however when I move to the second page and try to render a template I receive an Internal Server Issue.
I ssh'd into the server to install flask, njinx, jinja2 etc however none of these have fixed my issues. Are there other pip installs I'll need for this to work?
www.jamfish.co.uk
The second url is assigned to '/second'
Thanks for your time today, any help would be amazing. If I figure out how to fix this I'll update the post.
/r/flask
https://redd.it/cbu7qt
reddit
r/flask - Server Issues
0 votes and 2 comments so far on Reddit
Tuples versus Lists in Python
https://adamj.eu/tech/2019/07/05/tuples-versus-lists-in-python/
/r/django
https://redd.it/cbsq4m
https://adamj.eu/tech/2019/07/05/tuples-versus-lists-in-python/
/r/django
https://redd.it/cbsq4m
adamj.eu
Tuples versus Lists in Python - Adam Johnson
One thing I often ask for in code review is conversion of tuples to lists. For example, imagine we had this Django admin class:
Attempting to import a .xlsx file, receiving an error for invalid date
Hello. I am attempting to import a .xlsx file using django-import-export. But I'm receiving an error when I am importing the file:
RELEASDATEJP
Enter a valid date
​
Here is what the first line of my .xlsx file looks like:
[https://i.imgur.com/gcgylvA.jpg](https://i.imgur.com/gcgylvA.jpg)
https://i.redd.it/gea0scndvk931.jpg
​
My [settings.py](https://settings.py) file has:
DATE\_INPUT\_FORMATS = \['%d/%b/%Y'\]
​
my [models.py](https://models.py) file:
releaseDateJP = models.DateField(null=True,blank=True)
releaseDatePAL = models.DateField(null=True,blank=True)
releaseDateNA = models.DateField(null=True,blank=True)
/r/django
https://redd.it/cbpj3p
Hello. I am attempting to import a .xlsx file using django-import-export. But I'm receiving an error when I am importing the file:
RELEASDATEJP
Enter a valid date
​
Here is what the first line of my .xlsx file looks like:
[https://i.imgur.com/gcgylvA.jpg](https://i.imgur.com/gcgylvA.jpg)
https://i.redd.it/gea0scndvk931.jpg
​
My [settings.py](https://settings.py) file has:
DATE\_INPUT\_FORMATS = \['%d/%b/%Y'\]
​
my [models.py](https://models.py) file:
releaseDateJP = models.DateField(null=True,blank=True)
releaseDatePAL = models.DateField(null=True,blank=True)
releaseDateNA = models.DateField(null=True,blank=True)
/r/django
https://redd.it/cbpj3p