Be sure you add this in settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR , 'db.sqlite3'), } }
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
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??
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 /
Great, I need more!
I "devoured" this video :-)
These tutorials are wonderful.
if your python keeps showing error when typing os then try to import it and it will work
how to do it? help pls
Great content !!!
Be sure you add this in settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR , 'db.sqlite3'),
}
}
I changed it ,bit odk how to import os into here ,Please help
Thanks for the tutorial, these videos help alot
Thanks for the video, how did you generate the code at 6:23 for Base.html?
how did you create the venv environment last it was pyenv. my environment says pyenv how cam I change to venv?
👍
How can i add my template directory on windows
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
I re freshed and it said refused to connect after the index.html can someeone help
if statements don't work they just print it directly on the page its so weird for me please someone help
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??
please be more specific
I gather one has to know HTML as well in order to make a website in Django and Python?
os.path.join not working.
Your video is lacking explanations
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 /
You have to import os
PROJECT_DIR = os.join(BASE_DIR, "xxx")
NameError: name 'os' is not defined
you have to import "os" first
@@123darth what is the command for it which I should enter in VSC?
@@123darth how exactly do i do that.
@@Sawmtea. import os
Yes you have to import "os" but instead of calling directly os.join you have to call "os.path.join(BASE_DIR, "xxx").
Django... a CMS framework so powerful, you'll spend 99% of your time working in code. 😂
Your views file should contain a class not a function
That’s one way to do it. Not the only way.
@@hackershack True, I think the Django docs favor an OOP approach tho. Anyways thanks for this series it's been very good.
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'BACKEND': 'django.template.backends.django.DjangoTemplates',
^
SyntaxError: invalid syntax
Please help
I keep getting the above error on the settings file, even when I have copied it exactly as dispalyed. - Line 57/58. Please help
how did you create the venv environment last it was pyenv. my environment says pyenv how cam I change to venv?