SQLAlchemy ORM Tutorial for Python Developers
https://auth0.com/blog/sqlalchemy-orm-tutorial-for-python-developers?utm_source=reddit&utm_medium=sc&utm_campaign=sqlalchemy_python
/r/Python
https://redd.it/7bujvf
https://auth0.com/blog/sqlalchemy-orm-tutorial-for-python-developers?utm_source=reddit&utm_medium=sc&utm_campaign=sqlalchemy_python
/r/Python
https://redd.it/7bujvf
Auth0 - Blog
SQLAlchemy ORM Tutorial for Python Developers
Let's learn how to use SQLAlchemy ORM to persist and query data on Python applications.
Concerned about using Django
Hi,
My background is in PHP (It serves me well) and I use it primarily at work, however I've been learning Python and Django at home and am really enjoying using them and would like to start using them for work, but I just have a few concerns about deployment.
My main concern is portability I suppose. For example if I created a CRM system that could be distributed like WordPress this would be fairly simple in PHP as almost every host supports it and if a client already pays for hosting on servers my company doesn't use then I can just upload the files and the application would work. Is this ease of use doable with a Django application? From what I gather there is a lot of additional configuration required, and as I say if the final environment is out of my hands then I'd rather use something that I know will work.
I have considered just using PHP for work and Django for my own side projects, but I'm really like the Python language and the Django framework so if I could use them on projects at work that would be really cool.
Thanks in advance.
/r/django
https://redd.it/7bvo4g
Hi,
My background is in PHP (It serves me well) and I use it primarily at work, however I've been learning Python and Django at home and am really enjoying using them and would like to start using them for work, but I just have a few concerns about deployment.
My main concern is portability I suppose. For example if I created a CRM system that could be distributed like WordPress this would be fairly simple in PHP as almost every host supports it and if a client already pays for hosting on servers my company doesn't use then I can just upload the files and the application would work. Is this ease of use doable with a Django application? From what I gather there is a lot of additional configuration required, and as I say if the final environment is out of my hands then I'd rather use something that I know will work.
I have considered just using PHP for work and Django for my own side projects, but I'm really like the Python language and the Django framework so if I could use them on projects at work that would be really cool.
Thanks in advance.
/r/django
https://redd.it/7bvo4g
reddit
Concerned about using Django • r/django
Hi, My background is in PHP (It serves me well) and I use it primarily at work, however I've been learning Python and Django at home and am...
Python extension for VSCode updated, now brought to you by Microsoft. (crosspost from /r/vscode)
https://www.reddit.com/r/vscode/comments/7burdg/python_extension_for_vscode_updated_now_brought/
/r/Python
https://redd.it/7buxom
https://www.reddit.com/r/vscode/comments/7burdg/python_extension_for_vscode_updated_now_brought/
/r/Python
https://redd.it/7buxom
reddit
Python extension for VSCode updated, now brought to you... • r/vscode
I'm partial to using VSCode to code in Python. I updated the Python extension by Don Jayamanne (version 0.7.0), and it now seems to be maintained...
[AF] Performance penalty for jinja_env.globals? Any other reason not to do it?
I occasionally run into situations where Jinja is missing a few import Python functions, like len(), or even some of my own. So I've been making liberal use of jinja_env.globals to sneak some of those functions into my templates.
Is there any reason I shouldn't do that? It feels like cheating and it is rubbing my Catholic childhood wrong. Anything this quick and easy must be bad, and will surely damn me for eternity.
/r/flask
https://redd.it/7bvxnl
I occasionally run into situations where Jinja is missing a few import Python functions, like len(), or even some of my own. So I've been making liberal use of jinja_env.globals to sneak some of those functions into my templates.
Is there any reason I shouldn't do that? It feels like cheating and it is rubbing my Catholic childhood wrong. Anything this quick and easy must be bad, and will surely damn me for eternity.
/r/flask
https://redd.it/7bvxnl
reddit
[AF] Performance penalty for jinja_env.globals? Any... • r/flask
I occasionally run into situations where Jinja is missing a few import Python functions, like len(), or even some of my own. So I've been making...
Django best practices to pass user groups to client side
Hey Django devs!
I'm fairly new to django, I'm currently building an app that has users that belong to different groups, the client side app has different behavior depending on the user groups, so all the scripts on the site should be able to figure out to what groups the user belongs to. I'm currently dynamically adding the groups to a script with a global scope so that all other scripts can access the groups, but I feel like there has to be a better way to do this, any ideas? Any way to store those values in a cookie from django and then accesing it with the js?
/r/django
https://redd.it/7bucao
Hey Django devs!
I'm fairly new to django, I'm currently building an app that has users that belong to different groups, the client side app has different behavior depending on the user groups, so all the scripts on the site should be able to figure out to what groups the user belongs to. I'm currently dynamically adding the groups to a script with a global scope so that all other scripts can access the groups, but I feel like there has to be a better way to do this, any ideas? Any way to store those values in a cookie from django and then accesing it with the js?
/r/django
https://redd.it/7bucao
reddit
Django best practices to pass user groups to client side • r/django
Hey Django devs! I'm fairly new to django, I'm currently building an app that has users that belong to different groups, the client side...
Settings.py for sending emails
Rather new to programming. I want to set up a simple form which will send it's content to an admin's email. What I'm failing to understand is what happens in settings.py. I have:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'name@gmail.com'
EMAIL_HOST_PASSWORD = 'password' #
EMAIL_PORT = 587
EMAIL_USE_TLS = True
My questions are:
1. Is EMAIL_HOST_USER referring to the admin's email?
2. In EMAIL_HOST_PASSWORD should I write the password with which the admin connects to his email (related to this, I've found a suggestion for gmail accounts to use [DisplayUnlockCaptcha](https://accounts.google.com/DisplayUnlockCaptcha), added a new app, and a code was generated. Must that be copy-pasted at EMAIL_HOST_PASSWORD?)
3. What's with the EMAIL_PORT? How do I know which one works for me?
/r/djangolearning
https://redd.it/7bh60t
Rather new to programming. I want to set up a simple form which will send it's content to an admin's email. What I'm failing to understand is what happens in settings.py. I have:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'name@gmail.com'
EMAIL_HOST_PASSWORD = 'password' #
EMAIL_PORT = 587
EMAIL_USE_TLS = True
My questions are:
1. Is EMAIL_HOST_USER referring to the admin's email?
2. In EMAIL_HOST_PASSWORD should I write the password with which the admin connects to his email (related to this, I've found a suggestion for gmail accounts to use [DisplayUnlockCaptcha](https://accounts.google.com/DisplayUnlockCaptcha), added a new app, and a code was generated. Must that be copy-pasted at EMAIL_HOST_PASSWORD?)
3. What's with the EMAIL_PORT? How do I know which one works for me?
/r/djangolearning
https://redd.it/7bh60t
reddit
Settings.py for sending emails • r/djangolearning
Rather new to programming. I want to set up a simple form which will send it's content to an admin's email. What I'm failing to understand is what...
Start Getting and Working with Data with "Data Acquisition and Manipulation with Python"
https://ntguardian.wordpress.com/2017/11/09/start-getting-and-working-with-data-with-data-acquisition-and-manipulation-with-python/
/r/pystats
https://redd.it/7bxw50
https://ntguardian.wordpress.com/2017/11/09/start-getting-and-working-with-data-with-data-acquisition-and-manipulation-with-python/
/r/pystats
https://redd.it/7bxw50
Curtis Miller's Personal Website
Start Getting and Working with Data with “Data Acquisition and Manipulation with Python”
I announce my video course Data Acquisition and Manipulation with Python.
Exploring Line Lengths in Python Packages, Pythonic Perambulations, Jake Vanderplas
http://jakevdp.github.io/blog/2017/11/09/exploring-line-lengths-in-python-packages/
/r/Python
https://redd.it/7byr3j
http://jakevdp.github.io/blog/2017/11/09/exploring-line-lengths-in-python-packages/
/r/Python
https://redd.it/7byr3j
reddit
Exploring Line Lengths in Python Packages, Pythonic... • r/Python
66 points and 3 comments so far on reddit
Machine Learning With Python – Introduction
http://devarea.com/machine-learning-with-python-introduction/
/r/Python
https://redd.it/7c01v3
http://devarea.com/machine-learning-with-python-introduction/
/r/Python
https://redd.it/7c01v3
I eventually want to port my Django web site/app over to mobile. Is it necessary that I incorporate DRF ASAP?
It'll be for both the browser and mobile.
I decided browser first, though, since I've already invested quite a bit of time into it.
From my understanding, adding an API using DRF would *not* mean a complete rewrite of my current class-based-view django app. Instead, it only means an addition of new code--"api" folder, serializers, new url routes, etc.
Is this actually the case? Can I freely continue working on the browser version and simply add DRF for mobile later down the line?
If so, how does this change if I decide to add a frontend framework to my browser such as React?
React may also be frontend framework of choice for mobile given React Native.
But if this isn't the case, should I have started with DRF? What considerations should I make now to ensure that the eventual browser-mobile porting works out?
/r/django
https://redd.it/7bz6vc
It'll be for both the browser and mobile.
I decided browser first, though, since I've already invested quite a bit of time into it.
From my understanding, adding an API using DRF would *not* mean a complete rewrite of my current class-based-view django app. Instead, it only means an addition of new code--"api" folder, serializers, new url routes, etc.
Is this actually the case? Can I freely continue working on the browser version and simply add DRF for mobile later down the line?
If so, how does this change if I decide to add a frontend framework to my browser such as React?
React may also be frontend framework of choice for mobile given React Native.
But if this isn't the case, should I have started with DRF? What considerations should I make now to ensure that the eventual browser-mobile porting works out?
/r/django
https://redd.it/7bz6vc
reddit
I eventually want to port my Django web site/app over... • r/django
It'll be for both the browser and mobile. I decided browser first, though, since I've already invested quite a bit of time into it. From my...
Django UnboundLocalError when submitting an empty form
Hello, I'm new to django and I'm trying to build something. I made a form for users to comment on a post and it works well but when I tried to submit the form without any content there was a big error on the screen which says I've referenced a local variable before assignment. Can anybody tell me how to fix that?? I'll be very thankful.
/r/djangolearning
https://redd.it/7c00ry
Hello, I'm new to django and I'm trying to build something. I made a form for users to comment on a post and it works well but when I tried to submit the form without any content there was a big error on the screen which says I've referenced a local variable before assignment. Can anybody tell me how to fix that?? I'll be very thankful.
/r/djangolearning
https://redd.it/7c00ry
reddit
Django UnboundLocalError when submitting an... • r/djangolearning
Hello, I'm new to django and I'm trying to build something. I made a form for users to comment on a post and it works well but when I tried to...
A Python library for particle swarm optimization
Hi! Few months ago I shared a very simple project in this sub, and thanks to your suggestions and comments, I learned a lot and was able to transform (or "overhaul") it into a full package. First off, thank you very much!
I would like to present [PySwarms](https://github.com/ljvmiranda921/pyswarms), a Python library for particle swarm optimization. Aside from performing basic optimization, you can inspect the behavior of your swarm and even look for the best hyper-parameters to control swarm behavior. Moreover, the base classes here can be used to rapidly prototype swarm variants. Check it out!
/r/Python
https://redd.it/7c0ju0
Hi! Few months ago I shared a very simple project in this sub, and thanks to your suggestions and comments, I learned a lot and was able to transform (or "overhaul") it into a full package. First off, thank you very much!
I would like to present [PySwarms](https://github.com/ljvmiranda921/pyswarms), a Python library for particle swarm optimization. Aside from performing basic optimization, you can inspect the behavior of your swarm and even look for the best hyper-parameters to control swarm behavior. Moreover, the base classes here can be used to rapidly prototype swarm variants. Check it out!
/r/Python
https://redd.it/7c0ju0
GitHub
GitHub - ljvmiranda921/pyswarms: A research toolkit for particle swarm optimization in Python
A research toolkit for particle swarm optimization in Python - GitHub - ljvmiranda921/pyswarms: A research toolkit for particle swarm optimization in Python
Trying to plot a Fourier transform.
I have to plot y = (4/np.pi) * sum((np.sin(n*x))/(n)) where I sum over x. I have shown attempt below, my problem is that is sums over x and n. I don't know how to fix this.
n = np.linspace(1, 11, 11)
x = np.arange(101)
y = (4/np.pi) * np.sum((np.sin(n*x))/(n))
plt.plot(x,y)
/r/Python
https://redd.it/7c1i52
I have to plot y = (4/np.pi) * sum((np.sin(n*x))/(n)) where I sum over x. I have shown attempt below, my problem is that is sums over x and n. I don't know how to fix this.
n = np.linspace(1, 11, 11)
x = np.arange(101)
y = (4/np.pi) * np.sum((np.sin(n*x))/(n))
plt.plot(x,y)
/r/Python
https://redd.it/7c1i52
reddit
Trying to plot a Fourier transform. • r/Python
I have to plot y = (4/np.pi) * sum((np.sin(n*x))/(n)) where I sum over x. I have shown attempt below, my problem is that is sums over x and n. I...
Python Entry job
HI,
im self learning Python for a bout 8 months now, and i think i am intermediate level, but i have a long and solid background as hardware technician, and help desk. i wanna ask 2 questions, first: considering my experience in hardware and IT in general and my age 41! which road i should choose in python? i mean what is most beneficial field that fits to my own work. second: for some one with my understanding of python, what kind a job i can get as an entry level programming? thanks guys
/r/Python
https://redd.it/7c2fie
HI,
im self learning Python for a bout 8 months now, and i think i am intermediate level, but i have a long and solid background as hardware technician, and help desk. i wanna ask 2 questions, first: considering my experience in hardware and IT in general and my age 41! which road i should choose in python? i mean what is most beneficial field that fits to my own work. second: for some one with my understanding of python, what kind a job i can get as an entry level programming? thanks guys
/r/Python
https://redd.it/7c2fie
reddit
Python Entry job • r/Python
HI, im self learning Python for a bout 8 months now, and i think i am intermediate level, but i have a long and solid background as hardware...
Nominations for the Malcolm Tredinnick Memorial Prize 2017
https://www.djangoproject.com/weblog/2017/nov/10/nominations-malcolm-prize-2017/
/r/django
https://redd.it/7c2fjy
https://www.djangoproject.com/weblog/2017/nov/10/nominations-malcolm-prize-2017/
/r/django
https://redd.it/7c2fjy
reddit
Nominations for the Malcolm Tredinnick Memorial Prize 2017 • r/django
4 points and 0 comments so far on reddit
Following my last post, I am writing the next post in my compilers series. This week is about writing the lexer in python!
http://yoseph.tech/completely-useless-fun-project-parts-of-the-compiler/
/r/Python
https://redd.it/7c44h3
http://yoseph.tech/completely-useless-fun-project-parts-of-the-compiler/
/r/Python
https://redd.it/7c44h3
yoseph.tech
Completely Useless Fun Project: Parts Of The Compiler - Yoseph.TECH | All things Tech
This week I am talking about the parts of the compiler, doing a deep dive into the Lexer and Parser and showing how to build the Lexer and Parser in Python. At the end of this post, we should have a working lexer and parser.
Emacs as a Django IDE. What's the best way to do this these days?
**tl;dr: There hasn't been a discussion about this on this sub in over a year and I'm curious what tools there are available to configure Emacs as an effective "cloud-based" (over SSH) IDE for Django.**
I've been going through various text editors and IDEs and while I've found some I like, I'd really like to centrally host it myself instead of having synced environments between multiple machines and operating systems. Enter cloud-based IDEs. I want to self-host it so that immediately rules out the bulk of the options out there. The self-hosted options I've found haven't been terribly impressive. Then I remembered since I never bothered to learn Emacs or Vim, I had no idea what people who insisted on using them as IDEs were on about. After some research, I decided to try Emacs first.
So my first trial is going to be Emacs hosted in an LXD container that I just SSH into for development. While I'm not comfortable navigating it without a cheatsheet yet I very much like the layout and working in the terminal. My question is how best to configure it for modern versions of Django and Python development?
I found [this page on the wiki](https://code.djangoproject.com/wiki/Emacs) but it appears to be a bit outdated so I'd like to know if there are any other options I should try (and possibly add to the wiki). The first tool, python-django.el hasn't been updated in over two years and the intro link is dead. Pony Mode looks actively maintained and I intend to try it. New django-mode claims to be the newest and best but there's zero documentation and it doesn't look very actively maintained.
Anything else I should be looking into?
/r/django
https://redd.it/7c2pza
**tl;dr: There hasn't been a discussion about this on this sub in over a year and I'm curious what tools there are available to configure Emacs as an effective "cloud-based" (over SSH) IDE for Django.**
I've been going through various text editors and IDEs and while I've found some I like, I'd really like to centrally host it myself instead of having synced environments between multiple machines and operating systems. Enter cloud-based IDEs. I want to self-host it so that immediately rules out the bulk of the options out there. The self-hosted options I've found haven't been terribly impressive. Then I remembered since I never bothered to learn Emacs or Vim, I had no idea what people who insisted on using them as IDEs were on about. After some research, I decided to try Emacs first.
So my first trial is going to be Emacs hosted in an LXD container that I just SSH into for development. While I'm not comfortable navigating it without a cheatsheet yet I very much like the layout and working in the terminal. My question is how best to configure it for modern versions of Django and Python development?
I found [this page on the wiki](https://code.djangoproject.com/wiki/Emacs) but it appears to be a bit outdated so I'd like to know if there are any other options I should try (and possibly add to the wiki). The first tool, python-django.el hasn't been updated in over two years and the intro link is dead. Pony Mode looks actively maintained and I intend to try it. New django-mode claims to be the newest and best but there's zero documentation and it doesn't look very actively maintained.
Anything else I should be looking into?
/r/django
https://redd.it/7c2pza
Large file upload to S3
https://www.codingforentrepreneurs.com/blog/large-file-uploads-with-amazon-s3-django/
/r/django
https://redd.it/7c51bp
https://www.codingforentrepreneurs.com/blog/large-file-uploads-with-amazon-s3-django/
/r/django
https://redd.it/7c51bp
Coding for Entrepreneurs
Large File Uploads with Amazon S3 + Django - Blog - Coding for Entrepreneurs
Handling large file uploads can be a challenge. In this one, we aim to make it …
[AF] Explanation of `pip install --editable .`
The current [Flask documentation shows](http://flask.pocoo.org/docs/0.12/tutorial/packaging/) that flask apps should be created as a package. That includes a `setup.py` and `MANIFEST.in`.
If I'm not distributing my app for someone else to use, why would I do this?
If I didn't want to go through this setup, how would I configure my app so I could follow the example? e.g.
export FLASK_APP=flaskr
export FLASK_DEBUG=true
flask run
/r/flask
https://redd.it/7bz93o
The current [Flask documentation shows](http://flask.pocoo.org/docs/0.12/tutorial/packaging/) that flask apps should be created as a package. That includes a `setup.py` and `MANIFEST.in`.
If I'm not distributing my app for someone else to use, why would I do this?
If I didn't want to go through this setup, how would I configure my app so I could follow the example? e.g.
export FLASK_APP=flaskr
export FLASK_DEBUG=true
flask run
/r/flask
https://redd.it/7bz93o
[N] Tile: A New Language for Machine Learning
http://vertex.ai/blog/tile-a-new-language-for-machine-learning#
/r/MachineLearning
https://redd.it/7c3vul
http://vertex.ai/blog/tile-a-new-language-for-machine-learning#
/r/MachineLearning
https://redd.it/7c3vul
reddit
[N] Tile: A New Language for Machine Learning • r/MachineLearning
63 points and 20 comments so far on reddit