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




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


23 responses to “Django 1.9 Tutorial – 3. How To Setup Your Database With Django 1.9”

  1. 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. 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.

  3. 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

  4. 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?

  5. 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.

  6. 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!

  7. 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?

  8. 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!

  9. 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)

Leave a Reply