How to handle file uploads in Django Rest Framework?
Hello!
I'm currently working on a Django API in the Django Rest Framework. The API needs to be able to support ( and I suspect - a lot ) of file uploads more or less simultaneously. The file sizes may vary wildly. The application needs to analyse and then destroy the files.
I'm having trouble with the research for this issue, as there doesn't really seem to be a production ready solution out there.
In Flask I would probably use some sort of multi upload and maybe something like Celery. Does Django have it's own "worker" implementation? What would be the most optimal way to handle a lot of "analyse this file for me" requests?
/r/django
https://redd.it/iu4rf1
Hello!
I'm currently working on a Django API in the Django Rest Framework. The API needs to be able to support ( and I suspect - a lot ) of file uploads more or less simultaneously. The file sizes may vary wildly. The application needs to analyse and then destroy the files.
I'm having trouble with the research for this issue, as there doesn't really seem to be a production ready solution out there.
In Flask I would probably use some sort of multi upload and maybe something like Celery. Does Django have it's own "worker" implementation? What would be the most optimal way to handle a lot of "analyse this file for me" requests?
/r/django
https://redd.it/iu4rf1
reddit
How to handle file uploads in Django Rest Framework?
Hello! I'm currently working on a Django API in the Django Rest Framework. The API needs to be able to support ( and I suspect - a lot ) of file...
Build a web app in 20 minutes
Beset by pandemic, smoke and 2020 in general, I have found solace in creating a generator that creates multi-table, multi-form apps for sqlalchemy databases. It enables you to build an app in 10 minutes.
It’s based on Flask AppBuilder, itself based on Flask and SqlAlchemy.
Check it out on github: [https://github.com/valhuber/fab-quick-start](https://github.com/valhuber/fab-quick-start)
/r/Python
https://redd.it/iubkx2
Beset by pandemic, smoke and 2020 in general, I have found solace in creating a generator that creates multi-table, multi-form apps for sqlalchemy databases. It enables you to build an app in 10 minutes.
It’s based on Flask AppBuilder, itself based on Flask and SqlAlchemy.
Check it out on github: [https://github.com/valhuber/fab-quick-start](https://github.com/valhuber/fab-quick-start)
/r/Python
https://redd.it/iubkx2
GitHub
valhuber/fab-quick-start
fab-quick-start utility to generate FAB AppBuilder views.py, and FAB Quick Start Guide (wiki) - valhuber/fab-quick-start
Anyone doing Monolithic Django?
Printing a hello world over kubernetes cluster is an overkill, so are multiple microservices when you do not need them. I loved monolithic django, but with the advent of microservices architecture and modern JS libraries react, vue, and the likes, here is what you got to do
​
1. Create a DRF Backend
2. Take care of authentication at both ends
3. Build your SPA in a modern JS framework.
The good is modularity, maintainability, better UX controls, super interactive UIs, and the likes, the bad is you need to write more code. In simple cases the good old django templates is good enough. Is anyone still doing them? I love the organised new age FE framework code, the imports that come with ES6.
​
Is anyone still doing monolith with django template and ES6. If so, mind sharing your workflow, and libraries?
/r/django
https://redd.it/iudzvz
Printing a hello world over kubernetes cluster is an overkill, so are multiple microservices when you do not need them. I loved monolithic django, but with the advent of microservices architecture and modern JS libraries react, vue, and the likes, here is what you got to do
​
1. Create a DRF Backend
2. Take care of authentication at both ends
3. Build your SPA in a modern JS framework.
The good is modularity, maintainability, better UX controls, super interactive UIs, and the likes, the bad is you need to write more code. In simple cases the good old django templates is good enough. Is anyone still doing them? I love the organised new age FE framework code, the imports that come with ES6.
​
Is anyone still doing monolith with django template and ES6. If so, mind sharing your workflow, and libraries?
/r/django
https://redd.it/iudzvz
reddit
Anyone doing Monolithic Django?
Printing a hello world over kubernetes cluster is an overkill, so are multiple microservices when you do not need them. I loved monolithic django,...
The Zen of Python: As Related by Masters
https://dev.to/abdurrahmaanj/the-zen-of-python-as-related-by-masters-1p9i
/r/Python
https://redd.it/iud7n2
https://dev.to/abdurrahmaanj/the-zen-of-python-as-related-by-masters-1p9i
/r/Python
https://redd.it/iud7n2
DEV Community
The Zen of Python: As Related by Masters
Kissing the soul of Python
I made a bot that will randomly generate videos and upload them to youtube
[https://www.youtube.com/channel/UCDANaYKjOBTH4TsczbBj9KQ](https://www.youtube.com/channel/UCDANaYKjOBTH4TsczbBj9KQ)
​
using moviepy to compose the images and youtube api to upload,
/r/Python
https://redd.it/iudmic
[https://www.youtube.com/channel/UCDANaYKjOBTH4TsczbBj9KQ](https://www.youtube.com/channel/UCDANaYKjOBTH4TsczbBj9KQ)
​
using moviepy to compose the images and youtube api to upload,
/r/Python
https://redd.it/iudmic
YouTube
Randomly Generated Videos
This channel is a programming project written in python using moviePy. The bot will randomly generate a video (at the moment every 8 hours) and upload it to ...
Django ORM
I am developing with Django for a couple years now. The documentation is great but I don‘t seem to get many concepts of advanced querying. Can you recommend any resources that take a deep dive into the topic with explanations and examples?
/r/django
https://redd.it/iugo97
I am developing with Django for a couple years now. The documentation is great but I don‘t seem to get many concepts of advanced querying. Can you recommend any resources that take a deep dive into the topic with explanations and examples?
/r/django
https://redd.it/iugo97
reddit
Django ORM
I am developing with Django for a couple years now. The documentation is great but I don‘t seem to get many concepts of advanced querying. Can you...
Call for survey + user testing: "Please help us improve pip!"
https://discuss.python.org/t/please-help-us-improve-pip/5228
/r/Python
https://redd.it/iuh0sh
https://discuss.python.org/t/please-help-us-improve-pip/5228
/r/Python
https://redd.it/iuh0sh
Discussions on Python.org
Please help us improve pip!
Hi folks! My name is Nicole - I’m a UX researcher and designer working on Python packaging. At the moment I am helping the pip team to improve the way that pip works for all users. As part of this work, I’ve just published a “buy a feature” game, where…
Problem in Deployment of hobby projects.
I’m currently building a simple hobby project which uses allauth with sendgrid integration. I’m still using sqlite3 since I can easily switch to other DB by changing settings.py
I want to deploy the project for free. I’ve tried PythonAnywhere so far, but the problem is it won’t allow for smtp requests. So I cannot send emails. Is there any fix for this?
Is there any other free deployment services for hobby projects that I can use!
/r/djangolearning
https://redd.it/iuge9w
I’m currently building a simple hobby project which uses allauth with sendgrid integration. I’m still using sqlite3 since I can easily switch to other DB by changing settings.py
I want to deploy the project for free. I’ve tried PythonAnywhere so far, but the problem is it won’t allow for smtp requests. So I cannot send emails. Is there any fix for this?
Is there any other free deployment services for hobby projects that I can use!
/r/djangolearning
https://redd.it/iuge9w
reddit
Problem in Deployment of hobby projects.
I’m currently building a simple hobby project which uses allauth with sendgrid integration. I’m still using sqlite3 since I can easily switch to...
What is the equivalent of home and clear in iPython?
Hi, I am using iPython through xterm on Mac. I tried to clear the screen and move the cursor on the top left using "home" but it does not work. What command can I use? Also, if I want to clear all the variables and values I created in iPython, what command should I use? Thank you
/r/IPython
https://redd.it/iunaf2
Hi, I am using iPython through xterm on Mac. I tried to clear the screen and move the cursor on the top left using "home" but it does not work. What command can I use? Also, if I want to clear all the variables and values I created in iPython, what command should I use? Thank you
/r/IPython
https://redd.it/iunaf2
reddit
What is the equivalent of home and clear in iPython?
Hi, I am using iPython through xterm on Mac. I tried to clear the screen and move the cursor on the top left using "home" but it does not work....
Django Riffs 8 - Administering Your App
https://www.mattlayman.com/django-riffs/administering-your-app/
/r/django
https://redd.it/iuj24x
https://www.mattlayman.com/django-riffs/administering-your-app/
/r/django
https://redd.it/iuj24x
Matt Layman
Episode 8 - Administering Your App
On this episode, we will focus on the built-in Django administrator's site. We'll see what it is, how you can configure it, and how you can customize it to serve your needs.
spark context times out
When in jupyter notebook, after some time my spark context times out and I have to reload my cells all over again. Is there a way to stop this from happening? Or to have it auto reload by itself without any manual intervention.
/r/JupyterNotebooks
https://redd.it/iuq72t
When in jupyter notebook, after some time my spark context times out and I have to reload my cells all over again. Is there a way to stop this from happening? Or to have it auto reload by itself without any manual intervention.
/r/JupyterNotebooks
https://redd.it/iuq72t
reddit
spark context times out
When in jupyter notebook, after some time my spark context times out and I have to reload my cells all over again. Is there a way to stop this...
Flask-AWSCognito Client Question
I have a question if anyone here has used Flask-AWSCognito before. In the documentation page section for Client is very vague and I'm still very new at python web development so how would I get a client to remember the access token and present it to each request to the flask endpoints?
/r/flask
https://redd.it/iuu96b
I have a question if anyone here has used Flask-AWSCognito before. In the documentation page section for Client is very vague and I'm still very new at python web development so how would I get a client to remember the access token and present it to each request to the flask endpoints?
/r/flask
https://redd.it/iuu96b
reddit
Flask-AWSCognito Client Question
I have a question if anyone here has used Flask-AWSCognito before. In the documentation page section for Client is very vague and I'm still very...
Continuous graph when time resets
Hello! I'm trying to graph data, but when the time resets to 0, the graph goes back to the start and I get overlapping data in my graph. How can I make it such that the graph keeps going without overlapping? Example: let's say that time resets after 30 minutes, at which time the clock resets back to 0, but I want the graph to keep going forward instead of going back to the beginning and drawing over the old data.
I am using Matplotlib.pyplot in a jupyter notebook. Sorry for not saying that earlier.
/r/IPython
https://redd.it/iu5ghu
Hello! I'm trying to graph data, but when the time resets to 0, the graph goes back to the start and I get overlapping data in my graph. How can I make it such that the graph keeps going without overlapping? Example: let's say that time resets after 30 minutes, at which time the clock resets back to 0, but I want the graph to keep going forward instead of going back to the beginning and drawing over the old data.
I am using Matplotlib.pyplot in a jupyter notebook. Sorry for not saying that earlier.
/r/IPython
https://redd.it/iu5ghu
reddit
Continuous graph when time resets
Hello! I'm trying to graph data, but when the time resets to 0, the graph goes back to the start and I get overlapping data in my graph. How can I...
Django 3.0 and above on a Raspberry Pi. Is it possible?
I'm learning Django and my development server is a Raspberry Pi 4, has anyone got Django 3.0 or above installed and working on a Raspberry Pi?
Or am I going to have to ditch Raspberry Pi OS and install Ubuntu Server on my Pi?
EDIT: OK, so [onosendi](https://www.reddit.com/user/onosendi/) suggested pip3...
So I ran:
**pip3 install django==3.1.1**
And it appeared to install, but I am unable to confirm the version by running:
**django-admin --version**
But if I go into:
**Python3**
..and then:
**import django**
**print(django.get\_version())**
I get:
**3.1.1**
Result! :)
/r/django
https://redd.it/ius2to
I'm learning Django and my development server is a Raspberry Pi 4, has anyone got Django 3.0 or above installed and working on a Raspberry Pi?
Or am I going to have to ditch Raspberry Pi OS and install Ubuntu Server on my Pi?
EDIT: OK, so [onosendi](https://www.reddit.com/user/onosendi/) suggested pip3...
So I ran:
**pip3 install django==3.1.1**
And it appeared to install, but I am unable to confirm the version by running:
**django-admin --version**
But if I go into:
**Python3**
..and then:
**import django**
**print(django.get\_version())**
I get:
**3.1.1**
Result! :)
/r/django
https://redd.it/ius2to
Reddit
overview for onosendi
Day Trader - Full stack web developer - Competitive Shooter - Fitness Enthusiast.
Friday megathread: Free chat Friday!
Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!
/r/Python
https://redd.it/iuveug
Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!
/r/Python
https://redd.it/iuveug
reddit
Friday megathread: Free chat Friday!
Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!
Open .ipynb files directly with terminal automatically (OS X)
Hey guys,
This post is for jupyter users in OSX. Sorry for Linux/Windows users.
I have been using Jupyter Notebooks for a while and I thought that opening the terminal, typing "jupyter notebook path_to_file.ipynb" was a pain, so I created an Apple script with automator that does this directly.
Do you think it's useful?
Are there any alternatives to do this more easily?
Here is the [link](https://github.com/alexisgaziello/JupyterNotebookTerminalOpen) to the repo.
Please feel free to install it and let me know if it's useful/useless.
Cheers
/r/JupyterNotebooks
https://redd.it/iu3cnj
Hey guys,
This post is for jupyter users in OSX. Sorry for Linux/Windows users.
I have been using Jupyter Notebooks for a while and I thought that opening the terminal, typing "jupyter notebook path_to_file.ipynb" was a pain, so I created an Apple script with automator that does this directly.
Do you think it's useful?
Are there any alternatives to do this more easily?
Here is the [link](https://github.com/alexisgaziello/JupyterNotebookTerminalOpen) to the repo.
Please feel free to install it and let me know if it's useful/useless.
Cheers
/r/JupyterNotebooks
https://redd.it/iu3cnj
GitHub
alexisgaziello/JupyterNotebookTerminalOpen
Contribute to alexisgaziello/JupyterNotebookTerminalOpen development by creating an account on GitHub.
Flask app requires restart to display new database records on the page
I'm a bit new to flask and have run into an issue that I haven't been able to remedy.I've got a form in one my templates that allows the user to enter a URL and an accompanying label. Submitting this adds a record to my database for the new link. I have a for loop in my template that loops through the records in the database and displays them on the page. Everything is working correctly, but when I submit the link it does not display on my page even after reloading the page. Instead, I have to close my flask app an re-run it in order to see the newly added links on my page. The same goes for editing or deleting these links, which I also have actions for.
In summary, database changes are not seen on my page until I reload my flask app.
If my sql app/templates/static files are needed in order to help let me know. Thanks!
App code -
***https://www.ppaste.org/JOTQf88vj***
/r/flask
https://redd.it/iuv3zx
I'm a bit new to flask and have run into an issue that I haven't been able to remedy.I've got a form in one my templates that allows the user to enter a URL and an accompanying label. Submitting this adds a record to my database for the new link. I have a for loop in my template that loops through the records in the database and displays them on the page. Everything is working correctly, but when I submit the link it does not display on my page even after reloading the page. Instead, I have to close my flask app an re-run it in order to see the newly added links on my page. The same goes for editing or deleting these links, which I also have actions for.
In summary, database changes are not seen on my page until I reload my flask app.
If my sql app/templates/static files are needed in order to help let me know. Thanks!
App code -
***https://www.ppaste.org/JOTQf88vj***
/r/flask
https://redd.it/iuv3zx
Paint with Machine Learning: a Semantic Image Synthesis Demo
[Paint with Machine Learning](http://paintwith.spell.ml/) is a semantic image synthesis (or image-to-image translation) demo application I built as a consulting project. Hand-drawn semantic segmentation maps go in, [GauGAN](https://arxiv.org/abs/1903.07291) generated images ([NVLab/SPADE](https://github.com/NVlabs/SPADE)) come out.
I trained the model on [ADE20K](https://www.kaggle.com/residentmario/ade20k-outdoors) and fine-tuned it on [a dataset of Bob Ross paintings I hand-labelled](https://www.kaggle.com/residentmario/segmented-bob-ross-images). The model generates [some nice-looking results](https://i.imgur.com/wGwNAh6.png), considering I had just 250 paintings to work with, albeit at a very low resolution, just 256 by 256 pixels.
The application and model code is in [a public GH repo](https://github.com/spellml/paint-with-ml).
/r/Python
https://redd.it/iumcxq
[Paint with Machine Learning](http://paintwith.spell.ml/) is a semantic image synthesis (or image-to-image translation) demo application I built as a consulting project. Hand-drawn semantic segmentation maps go in, [GauGAN](https://arxiv.org/abs/1903.07291) generated images ([NVLab/SPADE](https://github.com/NVlabs/SPADE)) come out.
I trained the model on [ADE20K](https://www.kaggle.com/residentmario/ade20k-outdoors) and fine-tuned it on [a dataset of Bob Ross paintings I hand-labelled](https://www.kaggle.com/residentmario/segmented-bob-ross-images). The model generates [some nice-looking results](https://i.imgur.com/wGwNAh6.png), considering I had just 250 paintings to work with, albeit at a very low resolution, just 256 by 256 pixels.
The application and model code is in [a public GH repo](https://github.com/spellml/paint-with-ml).
/r/Python
https://redd.it/iumcxq
paintwith.spell.ml
Paint with Machine Learning
Create a landscape painting in the style of Bob Ross using machine learning.
App with 2 ports. One port needs to be private, how to accomplish?
An application has a costumer side which is publicly available, in development is running on port 5000. Now we want an admin panel that is online but not accessible to the general public only admin staff as with this panel you can modify directly the database and make big changes. It's running on port 5001
Im exploring 3 possibilities.
\+ One involves making a username and password plus using MFA like the guy in this [video](https://www.youtube.com/watch?v=kMTXL5FUHGM&ab_channel=MiguelGrinberg). to access the admin panel.
\+ The second is adding admins via invitation, which is somewhat similar like the above and my question is how to add the first admin user to send invitations. (same question applies to the first option).
\+ The third one someone at work mention SSH tunnelling, Im yet to look into this one deeply but wonder if anyone here has any opinion about it and it's ease of implementation.
If anyone has any tips or better potential solutions I'd love to hear about it.
(Bonus question) The admin panel is running in port5001 so we have [app.py](https://app.py) and [app2.py](https://app2.py) in one project. But in order to run it in parallel I used threading and that disabled
/r/flask
https://redd.it/iv0pl2
An application has a costumer side which is publicly available, in development is running on port 5000. Now we want an admin panel that is online but not accessible to the general public only admin staff as with this panel you can modify directly the database and make big changes. It's running on port 5001
Im exploring 3 possibilities.
\+ One involves making a username and password plus using MFA like the guy in this [video](https://www.youtube.com/watch?v=kMTXL5FUHGM&ab_channel=MiguelGrinberg). to access the admin panel.
\+ The second is adding admins via invitation, which is somewhat similar like the above and my question is how to add the first admin user to send invitations. (same question applies to the first option).
\+ The third one someone at work mention SSH tunnelling, Im yet to look into this one deeply but wonder if anyone here has any opinion about it and it's ease of implementation.
If anyone has any tips or better potential solutions I'd love to hear about it.
(Bonus question) The admin panel is running in port5001 so we have [app.py](https://app.py) and [app2.py](https://app2.py) in one project. But in order to run it in parallel I used threading and that disabled
/r/flask
https://redd.it/iv0pl2
YouTube
Two Factor Authentication with Flask
In this video I demonstrate an example two factor authentication application using the Flask microframework. For details on the implementation, see my blog article: http://blog.miguelgrinberg.com/post/two-factor-authentication-with-flask.
The source code…
The source code…
Is there a program to help you document Python functions?
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that will scan your code for functions that don't have a doc-string and then interactively ask you to:
* describe the function
* document each parameter
* document the return value
It would then create a doc-string for you that you could simply copy/paste into your code.
Thanks.
/r/Python
https://redd.it/iuoxt0
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that will scan your code for functions that don't have a doc-string and then interactively ask you to:
* describe the function
* document each parameter
* document the return value
It would then create a doc-string for you that you could simply copy/paste into your code.
Thanks.
/r/Python
https://redd.it/iuoxt0
reddit
Is there a program to help you document Python functions?
I just finished a Python project and now want to go back and document each function while it is still fresh in my head. Is there a program that...