How to make a website with Python and Django - TEMPLATES AND ROUTES (E02)

Поділитися
Вставка
  • Опубліковано 8 вер 2024

КОМЕНТАРІ • 36

  • @CarloZappacosta
    @CarloZappacosta 4 роки тому +4

    Great, I need more!
    I "devoured" this video :-)
    These tutorials are wonderful.

  • @FARAHEED
    @FARAHEED 3 роки тому +7

    if your python keeps showing error when typing os then try to import it and it will work

  • @avtourist-surgut
    @avtourist-surgut Рік тому

    Great content !!!

  • @orlandosanchez7271
    @orlandosanchez7271 3 роки тому +2

    Be sure you add this in settings.py
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR , 'db.sqlite3'),
    }
    }

    • @albythekkedan
      @albythekkedan 3 роки тому

      I changed it ,bit odk how to import os into here ,Please help

  • @carioceco2315
    @carioceco2315 3 роки тому

    Thanks for the tutorial, these videos help alot

  • @kichini275
    @kichini275 2 роки тому

    Thanks for the video, how did you generate the code at 6:23 for Base.html?

  • @zorrogamer2587
    @zorrogamer2587 2 роки тому

    how did you create the venv environment last it was pyenv. my environment says pyenv how cam I change to venv?

  • @electronic7979
    @electronic7979 4 роки тому +1

    👍

  • @mubarbianalytics
    @mubarbianalytics 3 роки тому

    How can i add my template directory on windows

  • @albythekkedan
    @albythekkedan 3 роки тому

    When running the server i am getting errors regarding
    1) __init__.py ,at various places,but the file is literally empty after these steps igk what happend
    2)errors or tracebacks there
    Finally the PROJECT_DIR -os error many had,
    So i am using a windows os maybe i can't find an alternative to it
    So pls Help

  • @lamedev1342
    @lamedev1342 3 роки тому

    I re freshed and it said refused to connect after the index.html can someeone help

  • @lamedev1342
    @lamedev1342 3 роки тому

    if statements don't work they just print it directly on the page its so weird for me please someone help

  • @xxgrundxx
    @xxgrundxx 3 роки тому

    when i run the server it tells me there is a syntax error in index.html line 5 ‘block‘ . i wrote it exactly the same way as you did ( 8:58 ). any answers??

  • @oscarsheen3045
    @oscarsheen3045 2 роки тому +1

    I gather one has to know HTML as well in order to make a website in Django and Python?

  • @alexbalak7558
    @alexbalak7558 3 роки тому +3

    os.path.join not working.
    Your video is lacking explanations

    • @andreshyer6283
      @andreshyer6283 3 роки тому +1

      For the path stuff, if you are using a newer version of python (not sure on version number, but 3.9 for me), try using pathlib or just using slashes. See line 15 in settings.py
      # Build paths inside the project like this: BASE_DIR / 'subdir'.
      So the PROJECT_DIR would be
      PROJECT_DIR = BASE_DIR /

    • @marieannabvl
      @marieannabvl 2 роки тому

      You have to import os

  • @BSDOWNZ
    @BSDOWNZ 3 роки тому +1

    PROJECT_DIR = os.join(BASE_DIR, "xxx")
    NameError: name 'os' is not defined

    • @123darth
      @123darth 3 роки тому +1

      you have to import "os" first

    • @kalanakajayasena8540
      @kalanakajayasena8540 3 роки тому

      @@123darth what is the command for it which I should enter in VSC?

    • @Sawmtea.
      @Sawmtea. 3 роки тому

      @@123darth how exactly do i do that.

    • @sriharsha1845
      @sriharsha1845 2 роки тому

      @@Sawmtea. import os

    • @marieannabvl
      @marieannabvl 2 роки тому +1

      Yes you have to import "os" but instead of calling directly os.join you have to call "os.path.join(BASE_DIR, "xxx").

  • @damygeebo
    @damygeebo 3 роки тому +2

    Django... a CMS framework so powerful, you'll spend 99% of your time working in code. 😂

  • @loganmay2105
    @loganmay2105 3 роки тому

    Your views file should contain a class not a function

    • @hackershack
      @hackershack  3 роки тому

      That’s one way to do it. Not the only way.

    • @loganmay2105
      @loganmay2105 3 роки тому

      @@hackershack True, I think the Django docs favor an OOP approach tho. Anyways thanks for this series it's been very good.

  • @kichini275
    @kichini275 2 роки тому

    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    ^
    SyntaxError: invalid syntax
    Please help

    • @kichini275
      @kichini275 2 роки тому

      I keep getting the above error on the settings file, even when I have copied it exactly as dispalyed. - Line 57/58. Please help

  • @zorrogamer2587
    @zorrogamer2587 2 роки тому

    how did you create the venv environment last it was pyenv. my environment says pyenv how cam I change to venv?