django-taggit vs PostgreSQL ArrayField - I know the differences, but what are the technical implications
Hey guys.
I'm currently working with django-taggit for my "Tag" fields, because for quick prototyping I just use sqlite. However now I'm almost done and I have to work on a more serious setup. I will be using PostgreSQL as my main production (and dev) database. And I like to use as few external third-party packages as possible. That includes django-taggit. I would like to replace this with a Postgres ArrayField. Since django-taggit uses a `form.save_m2m()` it looks like it just uses a ManyToMany Field. And I understand that also.
But I don't have enough in-depth knowledge. What are the actual technical implications? Are ArrayFields significantly faster? Are there any up/down-sides I'm not seeing for either of the two? Is there even any significant difference between the two?
Thanks so much in advance. I hope this is of interest to others as well.
/r/django
https://redd.it/and0gd
Hey guys.
I'm currently working with django-taggit for my "Tag" fields, because for quick prototyping I just use sqlite. However now I'm almost done and I have to work on a more serious setup. I will be using PostgreSQL as my main production (and dev) database. And I like to use as few external third-party packages as possible. That includes django-taggit. I would like to replace this with a Postgres ArrayField. Since django-taggit uses a `form.save_m2m()` it looks like it just uses a ManyToMany Field. And I understand that also.
But I don't have enough in-depth knowledge. What are the actual technical implications? Are ArrayFields significantly faster? Are there any up/down-sides I'm not seeing for either of the two? Is there even any significant difference between the two?
Thanks so much in advance. I hope this is of interest to others as well.
/r/django
https://redd.it/and0gd
reddit
r/django - django-taggit vs PostgreSQL ArrayField - I know the differences, but what are the technical implications
4 votes and 1 comment so far on Reddit
[D] Sharing my personal resource list for deep learning comprehension
Since I always like to have some theoretical knowledge (often shallow) of modern techniques, I complied this list of (free) courses, textbooks and references for an educational approach to deep learning and neural nets.
* [Deep Learning (CS 1470)](http://cs.brown.edu/courses/cs1470/index.html)
* [Deep Learning Book](https://www.deeplearningbook.org/) [\[GitHub\]](https://github.com/janishar/mit-deep-learning-book-pdf) [\[tutorial\]](http://www.iro.umontreal.ca/~bengioy/talks/lisbon-mlss-19juillet2015.pdf) [\[videos\]](https://www.youtube.com/channel/UCF9O8Vj-FEbRDA5DcDGz-Pg/videos)
* [Dive into Deep Learning](https://d2l.ai/) [\[GitHub\]](https://github.com/d2l-ai/d2l-en) [\[pdf\]](https://en.d2l.ai/d2l-en.pdf) [\[STAT 157\]](http://courses.d2l.ai/berkeley-stat-157/index.html)
* [Neural Network Design](http://hagan.okstate.edu/nnd.html) [\[pdf\]](http://hagan.okstate.edu/NNDesign.pdf)
* [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/) [\[GitHub\]](https://github.com/mnielsen/neural-networks-and-deep-learning) [\[pdf\]](http://static.latexstudio.net/article/2018/0912/neuralnetworksanddeeplearning.pdf) [\[solutions\]](https://github.com/reachtarunhere/nndl/blob/master/2016-11-22-ch1-sigmoid-2.md)
* [Theories of Deep Learning (STATS 385)](https://stats385.github.io/) [\[videos\]](https://www.researchgate.net/project/Theories-of-Deep-Learning)
* [Theoretical Principles for Deep Learning (IFT 6085)](http://mitliagkas.github.io/ift6085-dl-theory-class-2019/)
Do with it, as you will. Any new books/updates that I'm missing here?
/r/MachineLearning
https://redd.it/anrams
Since I always like to have some theoretical knowledge (often shallow) of modern techniques, I complied this list of (free) courses, textbooks and references for an educational approach to deep learning and neural nets.
* [Deep Learning (CS 1470)](http://cs.brown.edu/courses/cs1470/index.html)
* [Deep Learning Book](https://www.deeplearningbook.org/) [\[GitHub\]](https://github.com/janishar/mit-deep-learning-book-pdf) [\[tutorial\]](http://www.iro.umontreal.ca/~bengioy/talks/lisbon-mlss-19juillet2015.pdf) [\[videos\]](https://www.youtube.com/channel/UCF9O8Vj-FEbRDA5DcDGz-Pg/videos)
* [Dive into Deep Learning](https://d2l.ai/) [\[GitHub\]](https://github.com/d2l-ai/d2l-en) [\[pdf\]](https://en.d2l.ai/d2l-en.pdf) [\[STAT 157\]](http://courses.d2l.ai/berkeley-stat-157/index.html)
* [Neural Network Design](http://hagan.okstate.edu/nnd.html) [\[pdf\]](http://hagan.okstate.edu/NNDesign.pdf)
* [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/) [\[GitHub\]](https://github.com/mnielsen/neural-networks-and-deep-learning) [\[pdf\]](http://static.latexstudio.net/article/2018/0912/neuralnetworksanddeeplearning.pdf) [\[solutions\]](https://github.com/reachtarunhere/nndl/blob/master/2016-11-22-ch1-sigmoid-2.md)
* [Theories of Deep Learning (STATS 385)](https://stats385.github.io/) [\[videos\]](https://www.researchgate.net/project/Theories-of-Deep-Learning)
* [Theoretical Principles for Deep Learning (IFT 6085)](http://mitliagkas.github.io/ift6085-dl-theory-class-2019/)
Do with it, as you will. Any new books/updates that I'm missing here?
/r/MachineLearning
https://redd.it/anrams
GitHub
GitHub - janishar/mit-deep-learning-book-pdf: MIT Deep Learning Book in PDF format (complete and parts) by Ian Goodfellow, Yoshua…
MIT Deep Learning Book in PDF format (complete and parts) by Ian Goodfellow, Yoshua Bengio and Aaron Courville - janishar/mit-deep-learning-book-pdf
Looking for some Django buddies
Hello everyone!
I started learning web development last year somewhere around January and I've noticed that more I learn, less people are interested when I talk about web stuff. Lately all I get are headnods and "mhm" replies. It kinda sucks because I really enjoy learning these things and would like to share with someone, but my family and friends have zero interest in this stuff.
I've been following this community for a while now and I can see that there are a lot of skilled people that share the same interest as me, so if there's someone who would like to talk with me from time to time, whether you're a guy or a girl, expert or beginner like me, just let me know! :)
I'm from Slovakia, so I'm looking for someone who's preferably from Europe, can speak English, Slovak or Czech language and is at least 18 years old (since I'm 26 and feel like I don't belong in the teen category anymore)..
I'm using Discord for communication, so just message me your Discord tag and I will add you right away. :D
​
Thank you!
​
​
/r/django
https://redd.it/anttdx
Hello everyone!
I started learning web development last year somewhere around January and I've noticed that more I learn, less people are interested when I talk about web stuff. Lately all I get are headnods and "mhm" replies. It kinda sucks because I really enjoy learning these things and would like to share with someone, but my family and friends have zero interest in this stuff.
I've been following this community for a while now and I can see that there are a lot of skilled people that share the same interest as me, so if there's someone who would like to talk with me from time to time, whether you're a guy or a girl, expert or beginner like me, just let me know! :)
I'm from Slovakia, so I'm looking for someone who's preferably from Europe, can speak English, Slovak or Czech language and is at least 18 years old (since I'm 26 and feel like I don't belong in the teen category anymore)..
I'm using Discord for communication, so just message me your Discord tag and I will add you right away. :D
​
Thank you!
​
​
/r/django
https://redd.it/anttdx
reddit
r/django - Looking for some Django buddies
13 votes and 10 comments so far on Reddit
Question about * instead of a line number
Good Afternoon - Really sorry about posting a thread about this but i'm at my wits end here trying to figure this out.
I'm working in Jupyter (new to python) and am simply trying to run any code... at all. I have been unsuccessful. When i put any code in and hit run, an asterisk shows up instead of a line number and Jupyter creates a new line. So i'm expecting \[1\], \[2\], etc and instead i get \[\*\] for any and all types of code i try to run. I haven't been able to run one line of code in Jupyter using either the play button or hotkeys.
Obvi i am a beginner but i've been working with R for a little and wanted to try Python out. Ran across Jupyter from the IBM Coursera program. Anyone know how to fix this? i can't seem to find an answer for this anywhere and its probably something super simple and i'll feel stupid but please help anyone lol......
/r/IPython
https://redd.it/anvisy
Good Afternoon - Really sorry about posting a thread about this but i'm at my wits end here trying to figure this out.
I'm working in Jupyter (new to python) and am simply trying to run any code... at all. I have been unsuccessful. When i put any code in and hit run, an asterisk shows up instead of a line number and Jupyter creates a new line. So i'm expecting \[1\], \[2\], etc and instead i get \[\*\] for any and all types of code i try to run. I haven't been able to run one line of code in Jupyter using either the play button or hotkeys.
Obvi i am a beginner but i've been working with R for a little and wanted to try Python out. Ran across Jupyter from the IBM Coursera program. Anyone know how to fix this? i can't seem to find an answer for this anywhere and its probably something super simple and i'll feel stupid but please help anyone lol......
/r/IPython
https://redd.it/anvisy
reddit
r/IPython - Question about * instead of a line number
1 vote and 0 comments so far on Reddit
Proper way to host user images with Django?
I’m looking for some information on how to keep user uploaded images with Django. It doesn’t seem like I should just keep them in the media folder. What’s the proper way to do it in a production environment with a lot of users? Any links to teach this would be appreciated.
/r/djangolearning
https://redd.it/anvw12
I’m looking for some information on how to keep user uploaded images with Django. It doesn’t seem like I should just keep them in the media folder. What’s the proper way to do it in a production environment with a lot of users? Any links to teach this would be appreciated.
/r/djangolearning
https://redd.it/anvw12
reddit
r/djangolearning - Proper way to host user images with Django?
0 votes and 1 comment so far on Reddit
Full Stack React & Django [1] - Basic REST API
https://www.youtube.com/watch?v=Uyei2iDA4Hs
/r/djangolearning
https://redd.it/anwopu
https://www.youtube.com/watch?v=Uyei2iDA4Hs
/r/djangolearning
https://redd.it/anwopu
YouTube
Full Stack React & Django [1] - Basic REST API
In part 1 of this series we will setup a Django app and create a REST API with the Django Rest Framework. We will use Postman for API testing.
Sponsor: DevMountain Bootcamp
https://goo.gl/6q0dEa
Code:
https://github.com/bradtraversy/lead_manager_react_django…
Sponsor: DevMountain Bootcamp
https://goo.gl/6q0dEa
Code:
https://github.com/bradtraversy/lead_manager_react_django…
Al Sweigart, author of many python books is now streaming on Twitch!
https://www.twitch.tv/alsweigart
/r/Python
https://redd.it/ao0bxg
https://www.twitch.tv/alsweigart
/r/Python
https://redd.it/ao0bxg
Twitch
AlSweigart - Twitch
Software developer and author of "Automate the Boring Stuff with Python" and other programming books. Last name rhymes w/ "why dirt". Atheist. Anti-fascist. Mostly harmless. He/Him.
Cookies vs. Sessions
When a decision has to be made when it comes utilizing a cookie or a session what factors are taken into account? Essentially I'm looking for commonly used practices between the two concepts.
/r/flask
https://redd.it/ao0np5
When a decision has to be made when it comes utilizing a cookie or a session what factors are taken into account? Essentially I'm looking for commonly used practices between the two concepts.
/r/flask
https://redd.it/ao0np5
reddit
r/flask - Cookies vs. Sessions
8 votes and 11 comments so far on Reddit
Try out the walrus operator in Python 3.8
https://medium.com/hultner/try-out-walrus-operator-in-python-3-8-d030ce0ce601
/r/Python
https://redd.it/ao5e8y
https://medium.com/hultner/try-out-walrus-operator-in-python-3-8-d030ce0ce601
/r/Python
https://redd.it/ao5e8y
Medium
Try out walrus operator in Python 3.8
Get started with Python 3.8 alpha 1
What is Python? Why Python? Why has it become so popular in so little time? Do you also have these questions in your mind? Do watch this video to learn more about this awesome programming language. #IntroductionToPython #PythonBasics #PythonForBeginners
http://intellipaat-youtube.clickable.cards/card/HBAZAc
/r/IPython
https://redd.it/ao7378
http://intellipaat-youtube.clickable.cards/card/HBAZAc
/r/IPython
https://redd.it/ao7378
YouTube
Introduction to Python | Python Basics | Python For Beginners | Why Python Programming | Intellipaat
This Introduction to Python video will help you learn Python from scratch where you will understand Python basics, what is Python, who invented Python, why P...
[P] How to use BERT in Kaggle Competitions - A tutorial on fine-tuning and model adaptations
A step-by-step tutorial on how to adapt and finetune BERT for a Kaggle Challenge classification task: The [Kaggle Toxic Comment Classification Challenge](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge).
This post covers pretty much everything from data processing to model modifications with code examples for each part.
Results are in the top-10% of this $35.000 competition with a single model modified in 30 lines of code.
Link: [https://medium.com/huggingface/multi-label-text-classification-using-bert-the-mighty-transformer-69714fa3fb3d](https://medium.com/huggingface/multi-label-text-classification-using-bert-the-mighty-transformer-69714fa3fb3d)
/r/MachineLearning
https://redd.it/ao23cp
A step-by-step tutorial on how to adapt and finetune BERT for a Kaggle Challenge classification task: The [Kaggle Toxic Comment Classification Challenge](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge).
This post covers pretty much everything from data processing to model modifications with code examples for each part.
Results are in the top-10% of this $35.000 competition with a single model modified in 30 lines of code.
Link: [https://medium.com/huggingface/multi-label-text-classification-using-bert-the-mighty-transformer-69714fa3fb3d](https://medium.com/huggingface/multi-label-text-classification-using-bert-the-mighty-transformer-69714fa3fb3d)
/r/MachineLearning
https://redd.it/ao23cp
Kaggle
Toxic Comment Classification Challenge
Identify and classify toxic online comments
Flask has overtaken Django according to the 2018 JetBrains Developer Survey
https://www.jetbrains.com/research/python-developers-survey-2018/
/r/Python
https://redd.it/ao5dml
https://www.jetbrains.com/research/python-developers-survey-2018/
/r/Python
https://redd.it/ao5dml
JetBrains
Python Developers Survey 2018 Results
Results of the official Python Developers Survey 2018 by Python Software Foundation and JetBrains: more than 20k responses from more than 150 countries.
Python packages for writing better code
It would be interesting to curate a list of tools that help us write better Python code and save us time. With the exception of the version control tools, everything below is a Python package.
​
**Testing**
Writing and running tests makes it easier to develop robust code.
* [pytest](https://docs.pytest.org/en/latest/) (3,594 stars) - Popular testing framework, can run doctests too.
* [hypothesis](https://hypothesis.readthedocs.io/en/latest/) (3,223 stars) - Property-based testing, e.g. testing `f(a, b) = f(b, a)` for every `a, b`.
**Code linting and and formatting**
Code linting alerts of style violations, while a code formatter also automatically fixes the code.
* [flake8](http://flake8.pycqa.org/en/latest/) (497 stars) - Checks the code for PEP8 violations.
* [black](https://github.com/ambv/black) (7,552 stars) - Automatically formats code, saving you time.
**Documentation**
Tools for documentation, which automate the documentation process.
* [sphinx](http://www.sphinx-doc.org/en/master/) (2,376 stars) - Build docs to html, pdf and other formats. Automatically generate docs from code.
**Version control**
Version control allows going back to checkpoints, creating development branches, cooperating, etc.
* [git](https://git-scm.com/downloads) \- Popular version control tool.
* [github](https://github.com/) \- A platform for projects under git source control. Cooperation and community.
​
​
The above are tools that make my life easier when writing code. There are probably many tools that I do not know about, which could potentially save me even more time and make my code
/r/Python
https://redd.it/ao52qn
It would be interesting to curate a list of tools that help us write better Python code and save us time. With the exception of the version control tools, everything below is a Python package.
​
**Testing**
Writing and running tests makes it easier to develop robust code.
* [pytest](https://docs.pytest.org/en/latest/) (3,594 stars) - Popular testing framework, can run doctests too.
* [hypothesis](https://hypothesis.readthedocs.io/en/latest/) (3,223 stars) - Property-based testing, e.g. testing `f(a, b) = f(b, a)` for every `a, b`.
**Code linting and and formatting**
Code linting alerts of style violations, while a code formatter also automatically fixes the code.
* [flake8](http://flake8.pycqa.org/en/latest/) (497 stars) - Checks the code for PEP8 violations.
* [black](https://github.com/ambv/black) (7,552 stars) - Automatically formats code, saving you time.
**Documentation**
Tools for documentation, which automate the documentation process.
* [sphinx](http://www.sphinx-doc.org/en/master/) (2,376 stars) - Build docs to html, pdf and other formats. Automatically generate docs from code.
**Version control**
Version control allows going back to checkpoints, creating development branches, cooperating, etc.
* [git](https://git-scm.com/downloads) \- Popular version control tool.
* [github](https://github.com/) \- A platform for projects under git source control. Cooperation and community.
​
​
The above are tools that make my life easier when writing code. There are probably many tools that I do not know about, which could potentially save me even more time and make my code
/r/Python
https://redd.it/ao52qn
GitHub
GitHub - psf/black: The uncompromising Python code formatter
The uncompromising Python code formatter. Contribute to psf/black development by creating an account on GitHub.
Wrote a python script to convert video to ascii videos (with audio)
https://youtu.be/Uh2_dVDH9s4
/r/Python
https://redd.it/aoc0t7
https://youtu.be/Uh2_dVDH9s4
/r/Python
https://redd.it/aoc0t7
YouTube
Ascii-vengers: EndGame (with audio)
Looking for help with a process.
I have a variable in the form:
y = m[i]*t + b[i]
where I have values for m and b stored in lists. I'm interested in using a loop (or any other suggestion) to have the variable expand, similar to a summation.
y = m[0]*t + b[0] + m[1]*t + b[1] + ... + m[n]*t + b[n]
I would like to have the code accomplish the expansion for me as the goal is to have the number n determined by a user. It's similar to Fourier coefficients.
I greatly appreciate any tips, help or suggestions in this matter. Sorry if I committed any faux-pas up to this point as well.
/r/Python
https://redd.it/aoczku
I have a variable in the form:
y = m[i]*t + b[i]
where I have values for m and b stored in lists. I'm interested in using a loop (or any other suggestion) to have the variable expand, similar to a summation.
y = m[0]*t + b[0] + m[1]*t + b[1] + ... + m[n]*t + b[n]
I would like to have the code accomplish the expansion for me as the goal is to have the number n determined by a user. It's similar to Fourier coefficients.
I greatly appreciate any tips, help or suggestions in this matter. Sorry if I committed any faux-pas up to this point as well.
/r/Python
https://redd.it/aoczku
reddit
r/Python - Looking for help with a process.
3 votes and 1 comment so far on Reddit
How a production ready Dockerfile for Django projcet should look like?
It is clear that Docker is a buzzword for developers and I want to use it for my Django projects. The problem is that I can't find any material to learn how to correctly write a production ready Dockerfile for a Django project. Almost in every tutorial I see something like this in Dockerfile they write: **command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"**
And they call it "Production ready Dockerfile". What the f\*ck?! You don't run your server with [manage.py](https://manage.py) runserver command in production. Who the hell does?! I am freaking out that how it is possible that everyone loves Docker, everyone uses it, but no one teaches it correctly. So I need your help people to, get out this f\*cking situation. Thanks in advance.
/r/django
https://redd.it/aobpp8
It is clear that Docker is a buzzword for developers and I want to use it for my Django projects. The problem is that I can't find any material to learn how to correctly write a production ready Dockerfile for a Django project. Almost in every tutorial I see something like this in Dockerfile they write: **command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"**
And they call it "Production ready Dockerfile". What the f\*ck?! You don't run your server with [manage.py](https://manage.py) runserver command in production. Who the hell does?! I am freaking out that how it is possible that everyone loves Docker, everyone uses it, but no one teaches it correctly. So I need your help people to, get out this f\*cking situation. Thanks in advance.
/r/django
https://redd.it/aobpp8
Gita: a command-line tool to manage multiple repositories
I wrote a command-line tool to manage multiple repositories called [gita](https://github.com/nosarthur/gita). It can do two things
* display the status of multiple git repos such as branch, modification, commit message side by side
* delegate git commands/aliases from any working directory
[screenshot](https://raw.githubusercontent.com/nosarthur/gita/master/screenshot.png)
The color coding represents the relationship between local and remote branches, and the extra symbols (+, \*, and \_) denote the dirtyness of edits.
To install, simply run `pip3 install -U gita`
/r/Python
https://redd.it/aodcvh
I wrote a command-line tool to manage multiple repositories called [gita](https://github.com/nosarthur/gita). It can do two things
* display the status of multiple git repos such as branch, modification, commit message side by side
* delegate git commands/aliases from any working directory
[screenshot](https://raw.githubusercontent.com/nosarthur/gita/master/screenshot.png)
The color coding represents the relationship between local and remote branches, and the extra symbols (+, \*, and \_) denote the dirtyness of edits.
To install, simply run `pip3 install -U gita`
/r/Python
https://redd.it/aodcvh
GitHub
GitHub - nosarthur/gita: Manage many git repos with sanity 从容管理多个git库
Manage many git repos with sanity 从容管理多个git库. Contribute to nosarthur/gita development by creating an account on GitHub.
Flask has overtaken Django according to the 2018 JetBrains Developer Survey
https://www.reddit.com/r/Python/comments/ao5dml/flask_has_overtaken_django_according_to_the_2018/
/r/flask
https://redd.it/aoeflq
https://www.reddit.com/r/Python/comments/ao5dml/flask_has_overtaken_django_according_to_the_2018/
/r/flask
https://redd.it/aoeflq
reddit
Flask has overtaken Django according to the 2018 JetBrains...
Posted in r/Python by u/pastorhudson • 873 points and 227 comments
IntegrityError: Duplicate Primary Key issue with postgres
Hi,
The database has a few entries that were removed which leaves a gap in the Primary Keys. When testing backup and restore on my dev server, the Primary Key was reset to 1, fine, this is to be expected. However, running:
python manage.py sqlsequencereset microblog
Resets it to the next free number, This is no good, as the ID sequence in the current test db is:
1,2,7,10,12,13,14,17,23,24,25,26
so resetting to 3, just means this will fail in 4 database entries time. I have also tried:
psql
SELECT setval('microblog_blog_id_seq', (SELECT MAX(id) FROM microblog_blog)+1);
Whilst it returns the correct number in the console, and I am able to add another post, looking at the database table in pgAdmin, shows that it has picked the number 3 again, not 27 which is what I want it to do. Literally, I want it to treat any number < max as a no go value.
How can I do this? and if anyone knows why this is not the default behaviour I would be interested to know the reason why?
​
/r/django
https://redd.it/aofxtc
Hi,
The database has a few entries that were removed which leaves a gap in the Primary Keys. When testing backup and restore on my dev server, the Primary Key was reset to 1, fine, this is to be expected. However, running:
python manage.py sqlsequencereset microblog
Resets it to the next free number, This is no good, as the ID sequence in the current test db is:
1,2,7,10,12,13,14,17,23,24,25,26
so resetting to 3, just means this will fail in 4 database entries time. I have also tried:
psql
SELECT setval('microblog_blog_id_seq', (SELECT MAX(id) FROM microblog_blog)+1);
Whilst it returns the correct number in the console, and I am able to add another post, looking at the database table in pgAdmin, shows that it has picked the number 3 again, not 27 which is what I want it to do. Literally, I want it to treat any number < max as a no go value.
How can I do this? and if anyone knows why this is not the default behaviour I would be interested to know the reason why?
​
/r/django
https://redd.it/aofxtc
reddit
r/django - IntegrityError: Duplicate Primary Key issue with postgres
1 vote and 0 comments so far on Reddit