cj
Django has one of the best documentation out there, read it and you'll learn a lot of things
Aditya
I have made the models, created a custom authentication backend for them too, and a singular login view, but where i am stuck is this JWT auth of my models, it's making me rethink the whole design
Aditya
Yeah but i get brownie points for using jwt or keycloak 😐
Aditya
cj
Yeah but i get brownie points for using jwt or keycloak 😐
try with a couples of libraries, if your own auth system works, shouldn't take too much effort to make it work with JWT, as it's a separate layer and only using auth models to authenticate users
the management of the token should rely completely in the JWT lib you're using
Aditya
Aditya
Hmm i might be on to something
Данил
Hi all, I'm new to this chat room. I have a problem. I'm trying to create a shopping cart system in my django project, and I'm implementing it based on a django session.
There is one problem: when I add an item to the cart, nothing is added to the session dictionary, and it return {} (this I checked to print the session dictionary in the terminal).
If you want to help, but you do not have enough information, I'm ready to provide it.
Sebastian
hello community. I have an error loading images in the template on localhost. I'm using django-tenants and the django-tenants media manager
Charly
Sebastian
there is really no error just that it doesn't find the image seun the path. I have followed the documentation.
Sebastian
COMPRESS_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_FINDERS = [ "django_tenants.staticfiles.finders.TenantFileSystemFinder", # Must be first
"django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",]
MULTITENANT_STATICFILES_DIRS = [ os.path.join(BASE_DIR, "tenants/%s/static"),
]STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles/')
STATICFILES_STORAGE = "django_tenants.staticfiles.storage.TenantStaticFilesStorage"MULTITENANT_RELATIVE_STATIC_ROOT = ""
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
MEDIA_URL = '/media/'DEFAULT_FILE_STORAGE = "django_tenants.files.storage.TenantFileSystemStorage"
MULTITENANT_RELATIVE_MEDIA_ROOT = ""
Sebastian
and the path: desde la raiz del proyecto: lola_soft/media/forma colombia/perfil/imagen.jpg
Sebastian
and the html tag: {{ employee.image.url }}
Ali
does pythonanywhere support websocket connection?
Pythonero
Sebastian
Nop
Pythonero
Nop
# Image handling
DEFAULT_FILE_STORAGE = "django_tenants.files.storage.TenantFileSystemStorage"
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MULTITENANT_RELATIVE_MEDIA_ROOT = "%s/Files"
Pythonero
Sebastian
I think I have the configuration and the path of the files correct. It works because it creates the folder by tenant but does not show the images in the localhost template. I already cleared the cache and I have tried any way and it does not work. Could it be a package problem? or in development the configuration does not work. because static files work normally with django-tenants configuration.
Dotenum
Sebastian
No server deploy. Localhost
Сергей
Hello, everyone! Non-latin (non-ASCII?) mail subject turns into gibberish upon receiving, when using send_mail. As if due to some encoding problem.
How can this fixed? Some folks say to add 'u' before subject string to denote unicode, but it's not working.
Doragonsureiyā
Сергей
M. Hossein
I have two models: Question and Answer
Each Question can have many Answer but each Answer is for only one Question
Answer has a BooleanField called is_accepted
Whenever an instance of Answer is saved, I want to check if is_accepted is True, then set is_accepted False for any other Answer for that Question
I have written a signal but whenever call save method on Answer I get RecursionError
This is my signal:
@receiver(post_save, sender=Answer)
def set_accepted_answer(sender, instance, created, **kwargs):
if instance.is_accepted == True:
question = Question.objects.get(pk=instance.question.pk)
answers = question.answer_set.all()
for answer in answers:
print('setting False for answer', answer.body[:10])
answer.is_accepted = False
answer.save()
Tamerlan
how can use this function in websocket
Tamerlan
I use in here StreamingResponse how can i use this response in websocket
Ashish
Hi team I am working on Django framework my credentials are expose from repository, I have created config.ini file where all my credential store what a best approach to secure my credential at repositories as well as production server.pls help me out.
Sagar
Can anyone guide me How to create different log file for different user in django
.
Please help me!! How to insert data into several models in the same time and one request
I have two 2⃣ model A and B, and model A is foreign key to model B.
In serializer I have prepared model serializer for each model, what I want is to insert data into both, model B and through B to model A, and insert the foreign key of A to B. (like nested) more I dont know how to do that .
Any one guid me how to do it, how to handle the create and update method of multiple models
Alexey
.
Anonymous
Hello
Does anyone know of a free Django course?
Afshin👀
Hi there why I get this error in django(import django.urls could not be resolved from source)
José Jorge
José Jorge
The Inspired
Charly
anrays
i need how can deploy django project with channels and nginx?
can anyone help me i have a few questions?
Web developer
anuprash
Looking for docker tutorial with django rest
Doragonsureiyā
Looking for docker tutorial with django rest
These single steps will help you a lot:
Step 1️⃣: Open a browser
Step 2️⃣: Write down https://google.com or https://duck.com and press Enter
Step 3️⃣: In the search box, write down the same words you asked here
Step 4️⃣: Read the first results
x
Hey guys.. I need some help working with Django Guardian
I have a model that has field linked to the Django Group model via fk
I want to give permission to the groups to only be able to access their corresponding objects from that model
(by access I mean to give all CRUD permissions)
LCZ80
Doни
Hello everyone
Doни
NoReverseMatch at /
Reverse for 'add_game' not found. 'add_game' is not a valid view function or pattern name.
Doни
What a mistake?
Mirco
What a mistake?
Wrong url patterns
If you send your code we can help u quickly
Via pastebin.org
Afshin👀
Ab
Can anyone send Group link of Django, to learn from scratch to advanced
Doragonsureiyā
M. Hossein
I have a model called Article
I want to track changes for Article objects
Like
3 days ago admin changed title from A to B
1 year ago admin changed body from X to Y
How should I do this?
I myself want to use generic relationships so that I can track changes for every object
Not only Article
Charly
Elvin
https://github.com/yeshwanthlm/django-on-ec2
Hi all . I have published as shown in this file, but now I have made some changes in my github account. How can I update the final version? you can help
Tim
can i send code here?
Doragonsureiyā
can i send code here?
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Eslam
guys why when i use (docker-compose up) in digitalocean i get ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
Doragonsureiyā
Muhammadqodir
hi everyone
have you ever meet this problem during loading the django from json to postgres:
django.db.utils.DataError: Problem installing fixture '/var/www/turon/project/123test.json': Could not load home.AktUnVagon(pk=1): integer out of range
I can't fix this issue
Hovhannes
Hi there! I am beginner
Please tell me how to implementation
permissions(Django Rest) when i have groups of users
King
https://docs.google.com/forms/d/e/1FAIpQLScmHY6lMPchSare3osRdr8mtU_OeMtXk8FtaNLwLM-7oAI4CQ/viewform
Please fill this form for internship or Full time/Part time job opportunity.  those candidates looking internship or Full time job at pune location.
SzymBuram
i have a problem wiht my app, i deployed it to the aws, and now i want to connect the database(sqlite3) which is on the s3 with my app
Hovhannes
Maks
Hi friends
I need to make dependent drop dawn list of products with Django, but I know that it only possible to do with Ajax and JavaScript
May you tell me where to find how to do that ?
Maks
Thank you 🙏
May be there is a video in YouTube detailed or some text instructions? Me to understand the way
Maks
Nikita
Is anyone knows how to use harshicop vault with django application for password management