William
Nah
Is your dropdown empty?
Anonymous
Hi, I wanted to know your opinion about a piece of code of mine
Anonymous
def get_req_ip(request): ip = None x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip_sets = x_forwarded_for.split(',') while (len(ip_sets) and ip_sets[0].startswith(PRIVATE_IPS_PREFIX)): ip_sets.pop(0) if len(ip_sets): ip = ip_sets[0] if not ip: ip = request.META.get('REMOTE_ADDR') return ip
GOPINATH
I am creating a student management app
GOPINATH
In that I need to login as two different role one as student and one as teacher excluding admin
GOPINATH
In django can anyone please help me how to create two different user
GOPINATH
Whewther we can create both using usercreation form
Pratik
Can anyone guide me How to allow users to enter database connection details and display sample data from the selected table
Red
I am creating a student management app
me Too, But it is very confusing, specially when you try to create different user types like: Student, Parent, Teacher, HoD, ... . anyway in youtube search for supercoders channel he did a tutorial on a School-Management-System project with 3 user types. you can check it and customize it based on your demands.
....
Guys .. The django templates is not working on my app folder's html file. . I think in the settings i defined well . in settings BASE_DIR /"templates " I am new in django . So start doing with a tutorial . I am done same as the tutorial ,. But get the problem to me. Pls help me. . Lot of time searched . Talked to some people. .No one have answer Pls help me to solve that.
Red
Guys .. The django templates is not working on my app folder's html file. . I think in the settings i defined well . in settings BASE_DIR /"templates " I am new in django . So start doing with a tutorial . I am done same as the tutorial ,. But get the problem to me. Pls help me. . Lot of time searched . Talked to some people. .No one have answer Pls help me to solve that.
It is more cleaner if you create a "templates" folder in the root directory (project folder) then create a sub-folder with the name of your app then create your .html files there and in the settings.py do: 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', ], }, }, ]
Null Boy
i can help you.
Thanks . What should i do?
Nil
In that I need to login as two different role one as student and one as teacher excluding admin
https://www.botreetechnologies.com/blog/supporting-multiple-roles-using-djangos-user-model/
マクスイム • グセブ
Hello! I'm looking for anyone who knows how to generate documentation for your Django project using Sphinx. I've never used Sphinx so I'm confused about documentating model fields and adding links to Django documentation using Intersphinx
Rushabh
Salary : - send email to user using taskqueue - if any product is out of stock, mentione in email other products is ready to dispatch How can I do this two task specially 2 one.
Anonymous
From where I can learn Numpy fastly. Please share any references
Anonymous
Okay
GOPINATH
Anyone help me in multiple user login system in django
GOPINATH
I was stunck in that for a very long time I could not process my project without completing that
Rahul
You cheaked stackoverflow?
GOPINATH
Yes
Mahdi
Add a type field to the user model
coder
ModuleNotFoundError: No module named 'allauth'
coder
ModuleNotFoundError: No module named 'allauth'
ModuleNotFoundError: No module named 'allauth' i added settings.py why error occur?
Mirco
ModuleNotFoundError: No module named 'allauth' i added settings.py why error occur?
https://django-allauth.readthedocs.io/en/latest/installation.html Did you follow it ?
LIBIN
Class works(serializer.ModelSerializer) : Class meta: model=model_name fields=['created'] Heyy how can i pull that created field
Mirco
Yes did
So what does it tell you pip show django-allauth ?
Mirco
you can do correct as your method either use —all—
__all__ is not suggested as best practice
Mirco
I want to get the field
You will get that field inside your API response Only that field
Mirco
installed that package
What does it show you ? Exactly.
LIBIN
You will get that field inside your API response Only that field
Basically it's a time field so i needed to remove the time stamp before putting to the api
coder
What does it show you ? Exactly.
Requirement already satisfied: django-allauth ( Installed)
Mirco
coder
Share your settings file with pastebin
INSTALLED_APPS = [ 'allauth', 'allauth.account', 'rest_auth.registration', 'rest_framework.authtoken',]
LIBIN
how to append an extra field to an serialised data
coder
Kenechi
I have an issue with my Django cofe Help please
Kenechi
Code I mean
Doragonsureiyā
I have an issue with my Django cofe Help please
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Mirco
can i paste pm?
No you have to use code sharing tools here like everyone
Doragonsureiyā
settings.py Long code of line
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Kenechi
In my Django blog project. The link for the related blog posts in the post detail page isn't working fine as it is supposed to take me to the exact post it was assigned to,, but instead it opens both the detail post link and the next link together making it not to work... For instance I am in a post detail The url is 127.0.0.1:8000/5/fire The related post in that post should take me to a post with the url: 127.0.0.1:8000/10/water, but instead it does this: 127.0.0.1:8000/5/fire/10/water. My url pattern is: <str:pk>/<slug:slug_text>/ And in HTML related posts section it is a for loop with {{related_posts.id}}/{{related_posts.slug}} What's wrong
coder
!paste
https://dpaste.org/J5po
coder
Mirco
any mistake ?
Settings look good
coder
Settings look good
what is the error occur?
Doragonsureiyā
Any ideas please
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work. Have a nice day 😊
Ahmed
Does telethon support payments?
Deleted
guys pls help, distinct could not accept parameter in mysql: https://stackoverflow.com/questions/67995309/get-distinct-title-in-mysql-in-django
coder
guys who can help to rectify for ModuleNotFoundError: No module named 'allauth'
Javi
guys pls help, distinct could not accept parameter in mysql: https://stackoverflow.com/questions/67995309/get-distinct-title-in-mysql-in-django
Try https://cscheng.info/2020/02/27/how-to-exclude-duplicates-using-a-subquery-with-django-and-mysql.html
Anonymous
How do I deploy my django project to ubuntu server in VM using gunicorn
Doragonsureiyā
How do I deploy my django project to ubuntu server in VM using gunicorn
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
coder
try to reinstall
I did that; still same