Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-08 Thread NB DEV
Thanks a lot!!!

My apologies, It is just because it is the first time for me in this Google 
forum, so I didn't replay asap.

My apologies again for not being clear enough! 


So the fact that I got that error was just because the template folder was 
outside my main project and that the endless hierarchy of folders and files 
in a single Django project can be real pain. That is one reason, another 
one is that because of VS Code not having a clearer view of the files view 
browser. This is what confused me!
On Friday, March 5, 2021 at 11:15:03 PM UTC+3 gabriela...@gmail.com wrote:

> Kasper is right, we need more clear.
> But anyway, here is one example. In settings.py:
>
> from pathlib import Path
> import os
>
> ROOT_URLCONF = 'sclub.urls'  
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': ['sclub/appsclub/templates'],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> sclub is my project and appsclub is my App
>
>
>
>
>
> Gabriel Araya Garcia
> GMI - Desarrollo de Sistemas Informáticos
>
>
>
>
> El vie, 5 mar 2021 a las 11:16, NB DEV () escribió:
>
>>
>> Environment:
>>
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>>
>> Django Version: 3.1.7
>> Python Version: 3.9.1
>> Installed Applications:
>> ['django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'pages.apps.PagesConfig']
>> Installed Middleware:
>> ['django.middleware.security.SecurityMiddleware',
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>>
>> Template loader postmortem
>> Django tried loading these templates, in this order:
>>
>> Using engine django:
>> * django.template.loaders.filesystem.Loader: 
>> C:\Users\napil\Desktop\dev\btre_project\templates\pages\index.html (Source 
>> does not exist)
>> * django.template.loaders.app_directories.Loader: 
>> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\admin\templates\pages\index.html
>>  
>> (Source does not exist)
>> * django.template.loaders.app_directories.Loader: 
>> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\auth\templates\pages\index.html
>>  
>> (Source does not exist)
>>
>>
>>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\exception.py",
>>  
>> line 47, in inner
>> response = get_response(request)
>>   File 
>> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\base.py",
>>  
>> line 181, in _get_response
>> response = wrapped_callback(request, *callback_args, 
>> **callback_kwargs)
>>   File "C:\Users\napil\Desktop\dev\btre_project\pages\views.py", line 6, 
>> in index
>> return render(request, 'pages/index.html')
>>   File 
>> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\shortcuts.py",
>>  
>> line 19, in render
>> content = loader.render_to_string(template_name, context, request, 
>> using=using)
>>   File 
>> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
>>  
>> line 61, in render_to_string
>> template = get_template(template_name, using=using)
>>   File 
>> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
>>  
>> line 19, in get_template
>> raise TemplateDoesNotExist(template_name, chain=chain)
>>
>> Exception Type: TemplateDoesNotExist at /
>> Exception Value: pages/index.html
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9f6202d4-5ab8-4c58-a7c6-1d55a9d2fb7an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Gabriel Araya Garcia
Kasper is right, we need more clear.
But anyway, here is one example. In settings.py:

from pathlib import Path
import os

ROOT_URLCONF = 'sclub.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['sclub/appsclub/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

sclub is my project and appsclub is my App





Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




El vie, 5 mar 2021 a las 11:16, NB DEV () escribió:

>
> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
>
> Django Version: 3.1.7
> Python Version: 3.9.1
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'pages.apps.PagesConfig']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
> Template loader postmortem
> Django tried loading these templates, in this order:
>
> Using engine django:
> * django.template.loaders.filesystem.Loader:
> C:\Users\napil\Desktop\dev\btre_project\templates\pages\index.html (Source
> does not exist)
> * django.template.loaders.app_directories.Loader:
> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\admin\templates\pages\index.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\auth\templates\pages\index.html
> (Source does not exist)
>
>
>
> Traceback (most recent call last):
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\exception.py",
> line 47, in inner
> response = get_response(request)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\base.py",
> line 181, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "C:\Users\napil\Desktop\dev\btre_project\pages\views.py", line 6,
> in index
> return render(request, 'pages/index.html')
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\shortcuts.py",
> line 19, in render
> content = loader.render_to_string(template_name, context, request,
> using=using)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
> line 61, in render_to_string
> template = get_template(template_name, using=using)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
> line 19, in get_template
> raise TemplateDoesNotExist(template_name, chain=chain)
>
> Exception Type: TemplateDoesNotExist at /
> Exception Value: pages/index.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9f6202d4-5ab8-4c58-a7c6-1d55a9d2fb7an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKVvSDBqY555Y4sUxTXnVQp5SibfPbjrLb0acr35HMkwozxwEw%40mail.gmail.com.


Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Mohammad Anarul
[image: Screenshot_7.png]

On Fri, Mar 5, 2021 at 9:36 PM Kasper Laudrup  wrote:

> If you want someone to help you, please do take the time to write a
> proper question.
>
> Just posting an error message and screaming for help will most likely
> not get you a lot of help.
>
> Learning how to communicate with other people is an important part of
> being a developer.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0eefd4d6-2d23-ce61-f694-f07b30c9a4ed%40stacktrace.dk
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE59x8d6ob666k13D_V05LkSwbXNjsvyp4xqjZeVgh9h_a%3D7qg%40mail.gmail.com.


Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Kasper Laudrup
If you want someone to help you, please do take the time to write a 
proper question.


Just posting an error message and screaming for help will most likely 
not get you a lot of help.


Learning how to communicate with other people is an important part of 
being a developer.


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0eefd4d6-2d23-ce61-f694-f07b30c9a4ed%40stacktrace.dk.