How to Use a Postgres Database in Django

  Рет қаралды 105,841

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 107
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
@ekbergpeter6987
@ekbergpeter6987 4 жыл бұрын
Do you not reply questions there either?
@justinyang733
@justinyang733 4 жыл бұрын
I'm a TA for a course and your video helped tons of students including myself. Thanks body
@prettyprinted
@prettyprinted 4 жыл бұрын
You're welcome! I'm glad I could help.
@kunduzkossymbayeva1257
@kunduzkossymbayeva1257 5 жыл бұрын
your Django Database Essentials course is so cool! Thank you!!!
@prettyprinted
@prettyprinted 5 жыл бұрын
I'm glad you like the course!
@_Jordo
@_Jordo 6 жыл бұрын
Great! Was just doing this earlier today. Going to sleep now but I'll be back to watch the video tomorrow.
@NipkowDisk
@NipkowDisk 5 жыл бұрын
Thank you very much for posting this video, I just installed Django and since I use PostgreSQL as my standard DB the information you shared will be immensely helpful!! Thanks again!
@prettyprinted
@prettyprinted 5 жыл бұрын
You're welcome! I'm glad the video was useful for you.
@NipkowDisk
@NipkowDisk 5 жыл бұрын
@@prettyprinted I did find that for whatever reason, on my Linux Mint 19.1 Tessa install on my old laptop required two extra steps. First, I needed to install the client-side library libpq-dev which was hinted at in the terminal. Second, I couldn't get psycopg2 to install normally but running "pip install psycopg2-binary" in my virtual environment did the trick. All systems go for now!!
@Idanmichael2
@Idanmichael2 2 жыл бұрын
Thank you! super helpful and straight to the point
@elgary9074
@elgary9074 2 жыл бұрын
Amazing the best explanation! any recoomendations while running docker compose?
@fernandoferreira5156
@fernandoferreira5156 4 жыл бұрын
Great tutorial, greetings from brazil.
@leetcode_solutions
@leetcode_solutions 4 жыл бұрын
Thanks for the tutorial!! Please create a tutorial for DJango with Redis
@iananeri6255
@iananeri6255 3 жыл бұрын
Thank you. That was just what i was looking for
@nnanyereugoemmanuel8327
@nnanyereugoemmanuel8327 2 жыл бұрын
Thank you for this... Thank you.
@luketrop9431
@luketrop9431 3 жыл бұрын
thanks for the great video
@mukhammedmusa3886
@mukhammedmusa3886 3 жыл бұрын
Thank you very much! It is a really helpful video.
@yakimianandrew712
@yakimianandrew712 3 жыл бұрын
God Bless you brother
@kennyaires7131
@kennyaires7131 4 жыл бұрын
Much easier than I thought... thanks once again Anthony!
@jackiepuppet_5324
@jackiepuppet_5324 5 жыл бұрын
If anyone on macOS is running into 'psycopg2' issues after attempting the initial migration, try doing; pip install psycopg2-binary
@prettyprinted
@prettyprinted 5 жыл бұрын
Thanks!
@erichshan1535
@erichshan1535 4 жыл бұрын
BRO.. I have been stuck on this bug for 2 days and searched everywhere for a solution. I've done so much to try and fix this and your comment was the fix THANK YOU
@user-ox1db4pm7w
@user-ox1db4pm7w 4 жыл бұрын
Thank you T_T
@ximafor
@ximafor 3 жыл бұрын
Same problem was on Windows
@sharvilpednekar5777
@sharvilpednekar5777 4 жыл бұрын
Great Job!
@Mavalliss
@Mavalliss 4 жыл бұрын
MAN, OMG GODDAMN THANKS A LOT!!! It's the most simple and VERY VERY useful video for me! Thanks a lot again! I love you))
@harman8879
@harman8879 4 жыл бұрын
Thanks a lot man...
@dnasredine
@dnasredine 3 жыл бұрын
it's very pedagogy videos about django with postgresql, you go to the essential. Thanks
@deependrasingh1204
@deependrasingh1204 4 жыл бұрын
Ohh man this course is lit🔥🔥
@Riyaz8980.
@Riyaz8980. 4 жыл бұрын
Love you bro
@TheShash1001
@TheShash1001 6 жыл бұрын
Needed this.
@prettyprinted
@prettyprinted 6 жыл бұрын
Glad it helped.
@TheSanAnt0ni0
@TheSanAnt0ni0 5 жыл бұрын
Every guys named "Anthony" are the best ! :D
@TheOriginalShadyPencil
@TheOriginalShadyPencil 4 жыл бұрын
I couldn't stop my self.. Google Anthony Arkwright But this Anthony -- Gotta say man, your videos are awesome!!
@TheSanAnt0ni0
@TheSanAnt0ni0 4 жыл бұрын
@@TheOriginalShadyPencil I didn't precise the best for what. This Anthony Arkwright was the best at killing for sure ^^
@keshavdutta2963
@keshavdutta2963 4 жыл бұрын
Hey, will the admin functionality of inbuilt Django be working with PostgreSQL. I have a doubt so I am asking ??
@renequinones4607
@renequinones4607 5 жыл бұрын
thank you much for creating and posting these videos. Many blessings to you.
@prettyprinted
@prettyprinted 5 жыл бұрын
I'm glad you like them. Thanks for watching my videos!
@adrianenriquemorgadoflores9828
@adrianenriquemorgadoflores9828 5 жыл бұрын
Thanks a lot, very clear and useful. Regards from Chile.
@abdulghaphor
@abdulghaphor 5 жыл бұрын
Thank you Anthony. You were really helpful. God bless.
@ericksonsuarezocumarez2785
@ericksonsuarezocumarez2785 4 жыл бұрын
Great tutorial man. Thank you so much. I got a question : is it mandatory to install psycopg2 in order tu run postgresql in your django project? honestly haven't tried to do so because there is a project i'm working on that I don't want to ruin. Thank you for the answer in advance man.
@shefeeknajeeb9064
@shefeeknajeeb9064 4 жыл бұрын
Yes, psycopg is a PostgreSQL adapter for the Python programming language
@PythonCareerCoach
@PythonCareerCoach 4 жыл бұрын
did you create your admin user and different user accounts ? I am getting and error while creating admin account as "django.contrib.auth.models.DoesNotExist: User matching query does not exist" please help how to create super user to proceed. Excited to learn more. Pls help
@mundoempresarial4879
@mundoempresarial4879 3 жыл бұрын
Where can we get the PORT if it doesn´t apear in the URL?
@michelkant
@michelkant 5 жыл бұрын
Greatly explained!
@prettyprinted
@prettyprinted 5 жыл бұрын
Thanks for watching!
@jobauss
@jobauss 4 жыл бұрын
dude u r awesome, tx!
@vb3039
@vb3039 3 жыл бұрын
Thank you very math from russian :)
@minhhieunguyen1311
@minhhieunguyen1311 6 жыл бұрын
I was wondering about this problem but thanks to my friend I understood
@prettyprinted
@prettyprinted 6 жыл бұрын
Glad I could help.
@stevenkijooma2001
@stevenkijooma2001 6 жыл бұрын
Thanks for the concise video. What tool do you use for running your terminal commands?
@prettyprinted
@prettyprinted 6 жыл бұрын
I use Ubuntu on Windows. Thanks for watching!
@emeraldbright3727
@emeraldbright3727 5 жыл бұрын
Thanks, can you share more video on query of database in Django ?
@prettyprinted
@prettyprinted 5 жыл бұрын
I have a few videos. Just search 'Django models' on my channel.
@danilochantez5654
@danilochantez5654 6 жыл бұрын
Great Video. MySql?
@evans8245
@evans8245 6 жыл бұрын
Bless you man
@אורןכהן-ב7ד
@אורןכהן-ב7ד 4 жыл бұрын
it doesn't work, error message: "\django\db\backends\postgresql\base.py", line 29, in raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: DLL load failed while importing _psycopg: The specified module could not be found."
@daviidon
@daviidon 6 жыл бұрын
What technologies did you use to create your course website? Did you do everything from the ground up?
@OHOTOLEable
@OHOTOLEable 6 жыл бұрын
There is a Chrome Ext. called Wappalyzer which shows technologies being used
@prettyprinted
@prettyprinted 6 жыл бұрын
I use a service called Teachable.com. It's built with Ruby on Rails and Angular.
@what-the-code
@what-the-code 3 жыл бұрын
What is difference between migrate and migrations command?
@josephblessingh2384
@josephblessingh2384 5 жыл бұрын
Is Psycopg2 needed/ not needed? What is it used for?
@prettyprinted
@prettyprinted 5 жыл бұрын
Yeah, Django uses it to interface with the Postgres database. You don't need to deal with it directly, just have it installed and Django will handle the rest.
@josephblessingh2384
@josephblessingh2384 5 жыл бұрын
@@prettyprinted So I have to put psycopg2 in my settings.url? Because you haven't put it in your video but everyone on stack overflow tells to put it
@M1L3Y
@M1L3Y 5 жыл бұрын
@@josephblessingh2384 You don't need to add psycopg2 to URLs. Just pip install, and your ready to go. Don't forget to optimise PostgreSQL's configuration for Django. ALTER ROLE myprojectuser SET client_encoding TO 'utf8'; ALTER ROLE myprojectuser SET default_transaction_isolation TO 'read committed'; ALTER ROLE myprojectuser SET timezone TO 'UTC'; More info here. docs.djangoproject.com/en/1.9/ref/databases/#optimizing-postgresql-s-configuration
@fayzulsuleiman672
@fayzulsuleiman672 2 жыл бұрын
Hey everyone, i’m trying to migrate postgres but it’s tell me that it was can’t find postgres and i should use the pre-installed rdbms
@TamilPuzhavan
@TamilPuzhavan 6 жыл бұрын
hi i need one help on this i created some differnet on similar to this model how to insert a data in postgresql by using I created a table and multitennat also
@fairxz28
@fairxz28 6 жыл бұрын
thank you !
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@sharifahmed1925
@sharifahmed1925 5 жыл бұрын
What if you'd like to create a Django app using tables from a DB where the tables already exist? I'd like to create a dashboard using Django at work. Currently we export data from SQL Server onto Excel to create reports, but using a dashboard we could definitely automate this!
@prettyprinted
@prettyprinted 5 жыл бұрын
This might help you: docs.djangoproject.com/en/2.2/howto/legacy-databases/
@igorkomarov6607
@igorkomarov6607 5 жыл бұрын
U are the best, than U
@prettyprinted
@prettyprinted 5 жыл бұрын
Thanks for watching!
@surbhilodha3797
@surbhilodha3797 2 жыл бұрын
visual studio code is reading settings.py-tpl as txt file. pls help
@mohammedhegdah
@mohammedhegdah 4 жыл бұрын
Am having an error, is the server running on host 'localhost' and accepting tcpip connections on port 5432. Please help
@mkhnuser
@mkhnuser 3 жыл бұрын
Man, it is so abstract issue.
@arshiaariannejad9639
@arshiaariannejad9639 3 жыл бұрын
How can i connect my pgadmin to my elephantsql?
@sightseeer1349
@sightseeer1349 4 жыл бұрын
I get ImproperlyConfigured: Error loading psycopg2 module error when migrating. I installed it with pip and I am not using a virtual environment. Does anybody has a clue what could solve it?
@sightseeer1349
@sightseeer1349 4 жыл бұрын
okay nevermind, I have to install pip stuff with python -m pip install blabla instead of pip install blabla sorry for the waste of time for everyone reading this.
@sanagull116
@sanagull116 5 жыл бұрын
Where did you write python manage.py migrate? mean in which CLI
@prettyprinted
@prettyprinted 5 жыл бұрын
I use Ubuntu on Windows.
@arenmkhoyan
@arenmkhoyan 6 жыл бұрын
thanc you
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome.
@fabian-manzano
@fabian-manzano 6 жыл бұрын
that is great but i am getting error: relation "django_session" does not exist
@spdev3230
@spdev3230 6 жыл бұрын
Hi sir, can I reuqest a tutorial for django multi tenancy with postgresql? Please help
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll see what I can do. Thanks for the idea.
@brotherx6205
@brotherx6205 5 жыл бұрын
Is there a way to migrate an existing SQLite database to Postgres in Django without deleting all of the data in it?
@prettyprinted
@prettyprinted 5 жыл бұрын
You have to export from SQLite and then import to Postgres. Once all the data has been moved, you can update the configuration in your Django app. Maybe this will help: www.quora.com/What-is-the-best-way-to-copy-my-SQLite-database-to-PostgreSQL-so-I-can-deploy-it-to-Heroku
@JonesDTaylor
@JonesDTaylor 6 жыл бұрын
What if we don't use that elephantsql ?? how to get username and all ???
@prettyprinted
@prettyprinted 6 жыл бұрын
It completely depends on what you're using. You'll have to find where that information is.
@DebabrataPatnaik
@DebabrataPatnaik 6 жыл бұрын
It has changed from django.db.backends.postgresql to django.db.backends.postgresql_psycopg2 for postgres. Please confirm if there are any better bacends for Maria DB.
@prettyprinted
@prettyprinted 6 жыл бұрын
You should be able to use the mysql connector for Maria DB.
@robertg2285
@robertg2285 5 жыл бұрын
A+
@protegous
@protegous 5 жыл бұрын
What’s the difference between adding “simple” and “simple.apps.SimpleConfig” to INSTALLED_APPS?
@prettyprinted
@prettyprinted 5 жыл бұрын
It really just depends on how the app is designed. I would consult the documentation.
@dhakshintechi9896
@dhakshintechi9896 6 жыл бұрын
Bro make videos on fb,twitter login api with django
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll cover that eventually.
@madusan1
@madusan1 6 жыл бұрын
By rights, after entering in the port number, it should have a comma... Not critical but best practices
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks!
@shirleychan5649
@shirleychan5649 6 жыл бұрын
this does not look like postgres model in your model.py?
@prettyprinted
@prettyprinted 6 жыл бұрын
How so? The only difference is Django prepends your model name with the app name when creating the table.
@shirleychan5649
@shirleychan5649 6 жыл бұрын
I'm so sorry, I'm new to django and I misunderstood, I got clarification and it makes sense to me now :)
@zhomart3953
@zhomart3953 5 жыл бұрын
3:14 what you open?
@protegous
@protegous 5 жыл бұрын
terminal of the IDE
@Halfrican4111
@Halfrican4111 4 жыл бұрын
you should of just showed us functionality with a local database. This was pretty much useless. But I dunno anything that's why I came to this tutorial. maybe you can only setup postgres database by going to some cookie cutter website and copy and pasting in information. I expected information on the actual database setup locally and how to manipulate data from a self contained environment. This video seemed kinda lazy.
Creating a Weather App in Django Using Python Requests [Part 1]
28:30
Pretty Printed
Рет қаралды 197 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 41 МЛН
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 175 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 31 МЛН
Understanding Django Model Relationships
25:56
Pretty Printed
Рет қаралды 95 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 208 М.
Easiest Way To Connect Django To A Postgres Database
7:28
Dennis Ivy
Рет қаралды 85 М.
Docker | How to Dockerize a Django application (Beginners Guide)
20:08
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 82 М.
Provision a PostgreSQL database on AWS for Django
21:56
Cloud With Django
Рет қаралды 6 М.
Django Models.py - Django Databases #2
20:50
Codemy.com
Рет қаралды 52 М.
PostgreSQL in Python - Crash Course
16:06
NeuralNine
Рет қаралды 80 М.
How to use GeoDjango (import GIS shapefile with Python)
26:09
Tony Teaches Tech
Рет қаралды 7 М.
Watch This Before Using Django With MongoDB
9:18
Dennis Ivy
Рет қаралды 44 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 41 МЛН