• Thursday , 2 April 2020

Django 1.9 Tutorial – 3. How To Setup Your Database With Django 1.9

Code Canyon



THIS VIDEO IS SPONSORED BY ————– The Tech Academy http://ow.ly/RAMO30fE7Oc HipsterCode (my website) https://www.hipstercode.com/ JOIN MY SLACK CHANNEL https://www.patreon.com…

Original source

3d Ocean

Related Posts

23 Comments

  1. Nick
    March 12, 2018 at 18:23

    I got up to 12:30 in the video when talked about doing a migration for the sites and auth. Is that still the case with python 3.6? I wouldnt take my python manage.py migrate sites

    If anyone can clear that up for me it would be greatly appreciated. Thanks

  2. chris mahn
    March 12, 2018 at 18:23

    Hi chris. im having a hard time getting Django-MySQL package in Pycharm to work. i am still very new to Python and Django and its getting overwhelming any tips.

  3. Lucas C
    March 12, 2018 at 18:23

    i hate visual studio, same here waiting forever for the setup 🙂

  4. Amirreza Zarepour
    March 12, 2018 at 18:23

    thank u for such this good videos

  5. Ndirangu Muchiri
    March 12, 2018 at 18:23

    so helpful,thanks a bunch.

  6. Don Pislik
    March 12, 2018 at 18:23

    Yo Chris, I must say you're one of the few dudes who have provided a well explained tutorial. But I'm kinda having issues with the admin even after following your tutorial to create a demo project. Check out my issues below:

    TemplateDoesNotExist at /admin/login/
    admin/login.html
    Request Method: GET
    Request URL: http://127.0.0.1:8000/admin/login/?next=/admin/
    Django Version: 1.10.6
    Exception Type: TemplateDoesNotExist
    Exception Value:
    admin/login.html
    Exception Location: c:Usersbanjodocumentsvisual studio 2015Projectsdemodemoenvlibsite-packagesdjangotemplateloader.py in get_template, line 25
    Python Executable: c:Usersbanjodocumentsvisual studio 2015ProjectsdemodemoenvScriptspython.exe
    Python Version: 3.5.3
    Python Path:
    ['c:\Users\banjo\documents\visual studio 2015\Projects\demo\demo',
    'c:\Users\banjo\documents\visual studio '
    '2015\Projects\demo\demo\env\Scripts\python35.zip',
    'C:\Users\banjo\AppData\Local\Programs\Python\Python35-32\DLLs',
    'C:\Users\banjo\AppData\Local\Programs\Python\Python35-32\lib',
    'C:\Users\banjo\AppData\Local\Programs\Python\Python35-32',
    'c:\Users\banjo\documents\visual studio 2015\Projects\demo\demo\env',
    'c:\Users\banjo\documents\visual studio '
    '2015\Projects\demo\demo\env\lib\site-packages']
    Server time: Sun, 5 Mar 2017 10:28:30 -0500
    Template-loader postmortem

    Django tried loading these templates, in this order:

    Using engine :
    This engine did not provide a list of tried templates.

  7. yamen xena
    March 12, 2018 at 18:23

    Hey Chris, I'm at 13:14 of the video, psycopg2-2.6.2 was successfully installed but with a message "you are using version 7.1.2 however version 9.01.0 is available consider upgrading via … blabla" . then I followed by typing python manage.py createsuperuser, then migrate sites- but __" at the end of the message it says from django.conf.urls import patterns , include , url import error: cannot import name 'patterns" "!! can you explain to me what's happening ? thanks

  8. Dean Vollebregt
    March 12, 2018 at 18:23

    Hey I'm following along from home without Visual Studio. I downloaded Django 1.9 in a virtual environment and the code looks heaps different to the code generated by Visual Studio. I can get the site running but cant get to the admin page, I read online that virtualenv needs to be enabled in Django. Does anyone know how to do this?

  9. Lee Chess
    March 12, 2018 at 18:23

    I have a question I'm not entirely sure, but what if you run python manage.py migrate first instead of running python manage.py migrate auth and then with sites. I wonder if it would've been the same result. I'm new to django and python so, sorry if i asked something stupid or typed something wrong since english is not my first language.

  10. hteig
    March 12, 2018 at 18:23

    What's this movies2 folder? did i miss u create it?

  11. Shivashriganesh Mahato
    March 12, 2018 at 18:23

    So you have to put the password there in plain text? And it has to be there the entire time?

  12. Priom Chowdhury
    March 12, 2018 at 18:23

    Just decided not to use python3 anymore..!!.waste of countless hours fixing stupid bugs!!!

    BTW great tut and this is exactly I was looking for, any chance u going to show how to use mongo in Django. Thanks. Keep it up!

  13. Yermek Sakiyev
    March 12, 2018 at 18:23

    Hi, I followed the tutorial and getting error when trying to run the server from visual studio. It points me to execute_from_command_line(sys.argv) line in manage.py. Any ideas?

  14. Dhawal Panchal
    March 12, 2018 at 18:23

    +Chrise Hawkes
    i'm not able to create superuser.
    m getting a django.db.utils.OperationalError: fe_sendauth: no password supplied
    Can anyone help me out?
    Thanks

  15. Joe Diragi
    March 12, 2018 at 18:23

    on linux at around 9:30 you need to install python3-dev to fix the psycopg2 errors. on ubuntu that's 'sudo apt install python3-dev' or 'python-dev' if for some reason you're still on python 2

  16. meet patibandha
    March 12, 2018 at 18:23

    its really helpful Chris. But I stuck here I have python 27 virtualenv, I install exactly as u have shown in the video but still I get the error "No module named psycopg2" help me if you can……

  17. Chris Kavanagh
    March 12, 2018 at 18:23

    Chris, I wanted to thank you for another great django tutorial. I really needed this one, as I've been wanting to try out Postgres for a while. . .

    I noticed in the (django) docs there were some differences between Postgres and other databases as far as code. I can't remember exactly what the differences were, but have you noticed any differences in writing Models or doing queries with Postgres?

  18. Chris Kavanagh
    March 12, 2018 at 18:23

    Im using Python 2.7 and Django 1.9.4, and I got that error at 12:56 or so, also Chris. I thought it was related too a 3rd party app I'm using (django-authtools) which replaces the AUTH-USER-MODEL, so I did a Migration and that corrected it.

    I had no idea it was a new(er) django problem. I used 1.9.3 last Project and didn't have that problem, so it's weird. Anyways, thanks again!

  19. Chris Kavanagh
    March 12, 2018 at 18:23

    Are you working with 1.9 Chris? The reason I ask is I noticed my settings don't have what your have as far as the Database part. It just has a place for Engine and Name, and a link to the docs for database settings.

    In the docs it says that what you're using (django.db.backends.postgresql_psycopg2) is old and deprecated. The new way is ('django.db.backends.postgresql').

    It also says "Changed in 1.9 The django.db.backends.postgresql backend is named
    django.db.backends.postgresql_psycopg2 in older releases. For backwards
    compatibility, the old name still works in newer versions."

    So, I'm a little confused about what you're using, and what I should be using in settings for Postgres. I'm assuming you don't need psycopg2 anymore (for >1.9)

  20. Naveen Kumar
    March 12, 2018 at 18:23

    I'm gettng an error fatal database "<c:UsersProjectsmovies2movie>does not exist
    when i ran command createsuperuser or migrate sites or migrate could you please help me out

  21. Karan Thakkar
    March 12, 2018 at 18:23

    I m using django and postgres as database
    can i configure in a way so that my project works with already built database ??
    Like integrating already built tables in django ??
    If yes How??

  22. MrBelzeboss666
    March 12, 2018 at 18:23

    good job man!, anyway you can type for example psyco and click tab and it will autofill 🙂

  23. Chris CK
    March 12, 2018 at 18:23

    Maybe use python-bundled-sqlite for tutorial purposes?

Leave A Comment

You must be logged in to post a comment.