[AF][SQLAlchemy] Custom method for order_by when filtering
I'm working on a project where the user inputs a location (latitude and longitude) and the system searches the database for the closest entries by distance. However, I am unsure of how to pass a custom function (in this case, a function that calculates the distance to the provided lat/long) to the order_by method rather than by one of the fields in the database. I thought this would be a fairly common thing to implement, but I couldn't find anything helpful on StackOverflow, etc. Any help would be appreciated!
/r/flask
https://redd.it/6vwwv0
I'm working on a project where the user inputs a location (latitude and longitude) and the system searches the database for the closest entries by distance. However, I am unsure of how to pass a custom function (in this case, a function that calculates the distance to the provided lat/long) to the order_by method rather than by one of the fields in the database. I thought this would be a fairly common thing to implement, but I couldn't find anything helpful on StackOverflow, etc. Any help would be appreciated!
/r/flask
https://redd.it/6vwwv0
reddit
[AF][SQLAlchemy] Custom method for order_by when filtering • r/flask
I'm working on a project where the user inputs a location (latitude and longitude) and the system searches the database for the closest entries by...
[P] Fashion-MNIST a MNIST-like fashion product dataset under MIT
https://github.com/zalandoresearch/fashion-mnist
/r/MachineLearning
https://redd.it/6vzch9
https://github.com/zalandoresearch/fashion-mnist
/r/MachineLearning
https://redd.it/6vzch9
GitHub
GitHub - zalandoresearch/fashion-mnist: A MNIST-like fashion product database. Benchmark
A MNIST-like fashion product database. Benchmark :point_down: - GitHub - zalandoresearch/fashion-mnist: A MNIST-like fashion product database. Benchmark
Would anyone be interested in an Electronics for Programmers book? If yes, what topics?
With an Electronics background, I sometimes struggle with software paradigms. There are a few python for engineers courses/books out there that I am looking at.
I was wondering if anyone would be interested in the opposite as well. An Electronics for CS/Programmers book/course. And if yes, what are the key areas/topics that confuse you.
Thanks.
/r/Python
https://redd.it/6w1x4z
With an Electronics background, I sometimes struggle with software paradigms. There are a few python for engineers courses/books out there that I am looking at.
I was wondering if anyone would be interested in the opposite as well. An Electronics for CS/Programmers book/course. And if yes, what are the key areas/topics that confuse you.
Thanks.
/r/Python
https://redd.it/6w1x4z
reddit
Would anyone be interested in an Electronics for... • r/Python
With an Electronics background, I sometimes struggle with software paradigms. There are a few python for engineers courses/books out there that I...
Looking for open source Django+DRF projects that follow best practices.
The larger the project, the better. If you know of any, please give a link.
/r/django
https://redd.it/6w0hc9
The larger the project, the better. If you know of any, please give a link.
/r/django
https://redd.it/6w0hc9
reddit
Looking for open source Django+DRF projects that follow... • r/django
The larger the project, the better. If you know of any, please give a link.
Python refuses to recognize library I am almost certain exists
(i am just copying this from the stackoverflow thread that its not letting me post)
I have no idea why this is so frustrating, but I have literally pulled out a few clumps of hair in rage because this just refuses to work and I honestly do not have the slighest clue on what to do. I am trying to use the winshell module for a quick python programming I am using. I am new to python and just started trying it today. I have tried to install the library manually, and through pip. pip claims the module is downloaded, and I can see it in the `lib` folder. No matter what I do I get this error when I try to run my code:
import winshell
ModuleNotFoundError: No module named 'winshell'
what on earth must I do to get this to work I am at my wits end here and I feel like I'm going to break something
/r/Python
https://redd.it/6w4fb6
(i am just copying this from the stackoverflow thread that its not letting me post)
I have no idea why this is so frustrating, but I have literally pulled out a few clumps of hair in rage because this just refuses to work and I honestly do not have the slighest clue on what to do. I am trying to use the winshell module for a quick python programming I am using. I am new to python and just started trying it today. I have tried to install the library manually, and through pip. pip claims the module is downloaded, and I can see it in the `lib` folder. No matter what I do I get this error when I try to run my code:
import winshell
ModuleNotFoundError: No module named 'winshell'
what on earth must I do to get this to work I am at my wits end here and I feel like I'm going to break something
/r/Python
https://redd.it/6w4fb6
reddit
Python refuses to recognize library I am almost certain... • r/Python
(i am just copying this from the stackoverflow thread that its not letting me post) I have no idea why this is so frustrating, but I have...
ImportError: No module named 'flask_login'
SOLVED:
My flask application isn't using the env but local machine packages, thanks guys!
/r/flask
https://redd.it/6w85r3
SOLVED:
My flask application isn't using the env but local machine packages, thanks guys!
/r/flask
https://redd.it/6w85r3
reddit
ImportError: No module named 'flask_login' • r/flask
SOLVED: My flask application isn't using the env but local machine packages, thanks guys!
[P] Deep Learning Neural Networks Play Path of Exile
https://youtu.be/UrrZOswJaow
/r/MachineLearning
https://redd.it/6w5zyo
https://youtu.be/UrrZOswJaow
/r/MachineLearning
https://redd.it/6w5zyo
YouTube
Deep Learning Neural Networks Play Path of Exile
Four deep learning neural networks work together simultaneously to play the game Path of Exile only using visual input from the game. Project summary video with over 4 minutes of real footage of the AI playing the game.
Blog Series:
https://nicholastsmi…
Blog Series:
https://nicholastsmi…
Auto creating URLs from user entries?
I have a website I am working on in which users can submit comments, blog entries and such. However, if a URL gets posted, it gets presented as regular text (and thus is not clickable) when the entry is posted. Is there anyway to make Django automatically make links like these clickable?
/r/djangolearning
https://redd.it/6w0p91
I have a website I am working on in which users can submit comments, blog entries and such. However, if a URL gets posted, it gets presented as regular text (and thus is not clickable) when the entry is posted. Is there anyway to make Django automatically make links like these clickable?
/r/djangolearning
https://redd.it/6w0p91
reddit
Auto creating URLs from user entries? • r/djangolearning
I have a website I am working on in which users can submit comments, blog entries and such. However, if a URL gets posted, it gets presented as...
[R] Squeeze-and-Excitation Networks Caffe Implementation (ILSVRC 2017 winner)
https://github.com/hujie-frank/SENet
/r/MachineLearning
https://redd.it/6w8xex
https://github.com/hujie-frank/SENet
/r/MachineLearning
https://redd.it/6w8xex
GitHub
GitHub - hujie-frank/SENet: Squeeze-and-Excitation Networks
Squeeze-and-Excitation Networks. Contribute to hujie-frank/SENet development by creating an account on GitHub.
Anyone running a subscription site using Django and dj-stripe?
Hello!
So I've got a pretty hefty web app which is currently free and I have a bunch of people happily beta testing it. Simultaneously I've created a dev version and have implemented Stripe on it via dj-stripe. I've got it so I have plans created in Stripe, and created a plans template and view, and attached the form button for one of the plans on the plans page to the "[custom](https://stripe.com/docs/checkout#integration-custom)" implementation of Stripe Checkout. When a user clicks the button, it gives the standard Stripe Checkout pop up and the user can fill in all their data, and on the Stripe end they are attached to a subscription plan and the card is charged (test data of course for now).
Now I'm not sure where to go from here. I assume I need to somehow associate the username in the Django users database with that Stripe plan and then adjust their access accordingly but I'm not sure where to really start with this portion. The Stripe Checkout works great, but I'm not sure how to restrict user access based on which Stripe plan they're associated with. I'm sure this is going to require me to get more involved with the Django database which I am thus far unfamiliar with but I'm ready to learn!
Does anyone have any advice or could someone point me to any info that might help me get started?
Thank you!
/r/django
https://redd.it/6w7vxn
Hello!
So I've got a pretty hefty web app which is currently free and I have a bunch of people happily beta testing it. Simultaneously I've created a dev version and have implemented Stripe on it via dj-stripe. I've got it so I have plans created in Stripe, and created a plans template and view, and attached the form button for one of the plans on the plans page to the "[custom](https://stripe.com/docs/checkout#integration-custom)" implementation of Stripe Checkout. When a user clicks the button, it gives the standard Stripe Checkout pop up and the user can fill in all their data, and on the Stripe end they are attached to a subscription plan and the card is charged (test data of course for now).
Now I'm not sure where to go from here. I assume I need to somehow associate the username in the Django users database with that Stripe plan and then adjust their access accordingly but I'm not sure where to really start with this portion. The Stripe Checkout works great, but I'm not sure how to restrict user access based on which Stripe plan they're associated with. I'm sure this is going to require me to get more involved with the Django database which I am thus far unfamiliar with but I'm ready to learn!
Does anyone have any advice or could someone point me to any info that might help me get started?
Thank you!
/r/django
https://redd.it/6w7vxn
Stripe
Stripe Checkout
Build a low-code payment form and embed it on your site or host it on Stripe.
[D] I'm interested in using machine learning to solve process optimization tasks, but I'm really not sure where to look at or where to begin
Title is pretty self-explanatory, I'd like to learn how I can use machine learning for process optimization(tuning a bunch of parameters to get the most optimal output). I'm really just a beginner who doesn't know much more than the basics and I've recently started getting into deep learning etc. but I'd like to apply this for optimization purposes.
/r/MachineLearning
https://redd.it/6wassi
Title is pretty self-explanatory, I'd like to learn how I can use machine learning for process optimization(tuning a bunch of parameters to get the most optimal output). I'm really just a beginner who doesn't know much more than the basics and I've recently started getting into deep learning etc. but I'd like to apply this for optimization purposes.
/r/MachineLearning
https://redd.it/6wassi
reddit
[D] I'm interested in using machine learning... • r/MachineLearning
Title is pretty self-explanatory, I'd like to learn how I can use machine learning for process optimization(tuning a bunch of parameters to get...
cachelper - A lightweight library of cache helpers
https://github.com/suzaku/cachelper
/r/Python
https://redd.it/6wbynt
https://github.com/suzaku/cachelper
/r/Python
https://redd.it/6wbynt
GitHub
suzaku/cachelper
Contribute to cachelper development by creating an account on GitHub.
Is templating on <script></script> an acceptable practice in the Django community?
I haven't worked enough with a Django project built by someone else so I can't tell.
There are situations where it is mandatory that javascript must handle information from the server, but in my opinion, performing an AJAX to retrieve this information is too expensive when one could simply put this information in a template.
For instance, when I needed user information to be passed to JS, I did this:
<script>
{% if request.user.is_authenticated %}
const user = {
name: "{{ request.user.first_name }} {{ request.user.last_name }}",
id: {{ request.user.id }}
};
const csrf = "{{ csrf_token }}";
{% else %}
const user = null;
{% endif %}
</script>
The solution works, and I got what I wanted, but it felt too hacky. Is this an acceptable practice or must I look for a better solution? Is this a common thing in Django projects?
/r/django
https://redd.it/6wbki2
I haven't worked enough with a Django project built by someone else so I can't tell.
There are situations where it is mandatory that javascript must handle information from the server, but in my opinion, performing an AJAX to retrieve this information is too expensive when one could simply put this information in a template.
For instance, when I needed user information to be passed to JS, I did this:
<script>
{% if request.user.is_authenticated %}
const user = {
name: "{{ request.user.first_name }} {{ request.user.last_name }}",
id: {{ request.user.id }}
};
const csrf = "{{ csrf_token }}";
{% else %}
const user = null;
{% endif %}
</script>
The solution works, and I got what I wanted, but it felt too hacky. Is this an acceptable practice or must I look for a better solution? Is this a common thing in Django projects?
/r/django
https://redd.it/6wbki2
reddit
Is templating on an acceptable... • r/django
I haven't worked enough with a Django project built by someone else so I can't tell. There are situations where it is mandatory that javascript...
Django lookup in new tab/window
Hi guys,
I've been lurking around for quite some time now. I finally decided that I make django application by myself. I am trying to create music library for saving your fav music. I have a form where you can search (its django-autocomplete-light plugin) for music than add some notes and save it. I have more than 250k songs in my database. Now I need your help with search. How could I implement something like a lookup i.e. in form you click on search button that opens new window or tab, then you search for song and when you click it you it closes that window/tab and inserts in form.
I appreciate any help.
/r/django
https://redd.it/6wbxkv
Hi guys,
I've been lurking around for quite some time now. I finally decided that I make django application by myself. I am trying to create music library for saving your fav music. I have a form where you can search (its django-autocomplete-light plugin) for music than add some notes and save it. I have more than 250k songs in my database. Now I need your help with search. How could I implement something like a lookup i.e. in form you click on search button that opens new window or tab, then you search for song and when you click it you it closes that window/tab and inserts in form.
I appreciate any help.
/r/django
https://redd.it/6wbxkv
reddit
Django lookup in new tab/window • r/django
Hi guys, I've been lurking around for quite some time now. I finally decided that I make django application by myself. I am trying to create...
Renaming Django's Auth User and App
http://evennia.blogspot.se/2017/08/renaming-djangos-auth-user-and-app.html
/r/Python
https://redd.it/6wb5ay
http://evennia.blogspot.se/2017/08/renaming-djangos-auth-user-and-app.html
/r/Python
https://redd.it/6wb5ay
evennia.blogspot.co.uk
Renaming Django's Auth User and App
N ow that Evennia's devel branch (what will become Evennia 0.7) is slowly approaching completion, I thought I'd try to document an aspect...
Proper docs and packages for mongodb on django?
i recently started messing around with django, definitely really interesting but im a big mongodb fan and cant seem to find any recent packages, the last django nonrel that i see is 1.6? hopefully im just in the wrong section but i went to the deprecated page and then traversed to the non deprecated(what i hope is non deprecated) and that uninstalled my django 1.11.4 to 1.6 or something around there(i fixed it back to current, the mongodb site is actually kind of off as well, i understand python mainly does better with relational db). sorry exited the shell forgot exact version. if you happen to know/find UP-TO-DATE packages please post a link, thanks in advance
/r/django
https://redd.it/6wf3iz
i recently started messing around with django, definitely really interesting but im a big mongodb fan and cant seem to find any recent packages, the last django nonrel that i see is 1.6? hopefully im just in the wrong section but i went to the deprecated page and then traversed to the non deprecated(what i hope is non deprecated) and that uninstalled my django 1.11.4 to 1.6 or something around there(i fixed it back to current, the mongodb site is actually kind of off as well, i understand python mainly does better with relational db). sorry exited the shell forgot exact version. if you happen to know/find UP-TO-DATE packages please post a link, thanks in advance
/r/django
https://redd.it/6wf3iz
reddit
Proper docs and packages for mongodb on django? • r/django
i recently started messing around with django, definitely really interesting but im a big mongodb fan and cant seem to find any recent packages,...
GraphQL and Django in 5 minutes
https://joaorafaelm.github.io/blog/graphql-and-django-in-5-minutes
/r/Python
https://redd.it/6wf95q
https://joaorafaelm.github.io/blog/graphql-and-django-in-5-minutes
/r/Python
https://redd.it/6wf95q
Snippets are unofficial and unmaintained.
http://flask.pocoo.org/snippets/
/r/flask
https://redd.it/6wen7j
http://flask.pocoo.org/snippets/
/r/flask
https://redd.it/6wen7j
reddit
Snippets are unofficial and unmaintained. • r/flask
4 points and 3 comments so far on reddit