Muflone
click the link on the third line
Driptamine
is that it? https://github.com/django/django/tree/main/django/conf/project_template
Muflone
yeah
Driptamine
bless you
Muflone
😀
Driptamine
i will find a way to thank you
~Ronnie
I'm writing unit tests for Django REST APIs I have developed that I'm planning to integrate to a CI/CD pipeline which will rebuild a docker instance running on production to update the codebase with new changes. I'm using pytest to write the unit test. The API endpoints require an access token for the APIClient to test the endpoints. I'm creating a test user and storing the access token as a global variable to be used by other test functions to authenticate.
~Ronnie
SInce I can't send a snapshot, anyone with leads on how I can ensure the access token is added to authenticate each request accordingly so that the tests run fine, kindly send tips or a solution I could use to solve the error I'm having.
Jimmies San
Jimmies San
Prashant
TemplateDoesNotExist at /
index.html
Request Method: GET
Request URL: *************#i am hiding this detail
Django Version: 4.1.7
Exception Type: TemplateDoesNotExist
Exception Value:
index.html
Exception Location: /var/www/Verantes_site/mb/lib/python3.10/site-packages/django/template/loader.py, line 19, in get_template
Raised during: Showcase.views.home
Python Executable: /var/www/Verantes_site/mb/bin/python
Python Version: 3.10.12
Python Path:
['/var/www/Verantes_site',
'/usr/lib/python310.zip',
'/usr/lib/python3.10',
'/usr/lib/python3.10/lib-dynload',
'/var/www/Verantes_site/mb/lib/python3.10/site-packages']
Server time: Wed, 03 Jan 2024 13:08:21 +0530
Prashant
this error is giving in live production
Prashant
can someone please help me out
Prashant
is there compulsorily we have to make index.html instead of home.html file in template?
Charly
Rutya
Charly
Prashant
can i make it?
Prashant
okay
Prashant
any other soln?
Rutya
And setting file add template
Prashant
Charly
any other soln?
Why youw ant another solution when you havent tried the solution that works?
Rutya
So you can check your view file properly redirect html
Prashant
Prashant
TemplateDoesNotExist at /
index.html
Request Method: GET
Request URL: *************#i am hiding this detail
Django Version: 4.1.7
Exception Type: TemplateDoesNotExist
Exception Value:
index.html
Exception Location: /var/www/Verantes_site/mb/lib/python3.10/site-packages/django/template/loader.py, line 19, in get_template
Raised during: Showcase.views.home
Python Executable: /var/www/Verantes_site/mb/bin/python
Python Version: 3.10.12
Python Path:
['/var/www/Verantes_site',
'/usr/lib/python310.zip',
'/usr/lib/python3.10',
'/usr/lib/python3.10/lib-dynload',
'/var/www/Verantes_site/mb/lib/python3.10/site-packages']
Server time: Wed, 03 Jan 2024 13:08:21 +0530
Prashant
admin design-gallery.html js.html otppage.html wordrobe.html
barkitchen.html footer.html login.html signup.html
contact.html header.html loginotp.html thanku.html
css.html index.html modular-kitchen.html vanity-units.html
Prashant
this is my all templates
Believe
Check your path to the templates
Prashant
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR,'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',
],
},
},
]
Prashant
is this correct?
Danish
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR,'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',
],
},
},
]
'DIRS' : [BASE_DIR/'templates']
Prashant
okay i'm trying this
Prashant
and then let you know
Prashant
Prashant
Thanks boss
Danish
👍
Ibrokhim
~Ronnie
~Ronnie
Alma
Hey guys! Someone knows why in Chrome I have csrf forbidden problem
Максим
Anurag K
I want to perform automatic logout of the user when the admin block the user from the admin side django
please anybody help
Muflone
Believe
Believe
And check if user is inactive log out him
Mahan
hello guys i learned drf and i created a api for blog how to send this api for front? how to make json for front?
Zion
Muflone
Zion
you mean how to consume the api endpoint by the front? its not the place
Mahan
Mahan
i know bakend must send data for front with api but i dont know how?
Muflone
Mahan
Muflone
well how?
this is a Django group
learn html and js and you'll learn how to do requests to your backend
Mahan
tanks all
Zion
backend is just a prettier way to handle data using interfaces without touching to the data source, you need to study more about your frontend framework, and you will understand quickly.
Mahmuod
Hi I wanted to know how I can structure api with django
Mahmuod
Any guide’s??
Mahmuod
Mirco
Becky
Hi guys how can I link my Django model to the react app and map in it
Mirco
Becky
And is thet the right way
Becky
Danish
Becky
Do you have a pdf
Doragonsureiyā
Do you have a pdf
Are you looking for Django REST Framework documentation?
Here you have it: https://www.django-rest-framework.org/
Becky
Thank you 😊
_untold_._mystery_
How to create Database based django admin for multiple database with same model
Mirco
Yeah
_untold_._mystery_
What to do