Unknown
Any other option?
url template tag
Bunty chhatri wala..
url template tag
{% url 'accounts/login' %} This one?
Unknown
{% url 'accounts/login' %} This one?
syntax is incorrect but yes i am talking about this tag
Unknown
syntax is incorrect but yes i am talking about this tag
I mean value inside ' ' must match the name of the url and not the path
Mani
{% 'accounts/login' %}
Mani
Try this
Anonymous
Any way Use this /accounts/login Or {% url “accounts/login” %}
Mani
Or send me screenshot
Bunty chhatri wala..
Bunty chhatri wala..
Mani
Not working
Screenshot send me
Unknown
Example please?
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Nmn
How?
path('login/', views.login, name ='login') something like this
Nmn
Then use thr name in {% url 'login'%}
محمد دلشاد
a very basic question whats different in path('login/', views.login, name ='login') and path(r'login/', views.login, name ='login')
محمد دلشاد
محمد دلشاد
and cant figure out whats difference
Cheap
i am trying to capture ip with REMOTE_ADDR, but sometimes i get IPv4 and sometimes i get IPv6, how can i get both(if both are available)?
Anonymous
Hey
Anonymous
How can I do this:- If user is on cart page the user shouldn't see cart option on navbar
Angel
a very basic question whats different in path('login/', views.login, name ='login') and path(r'login/', views.login, name ='login')
Python raw string is created by prefixing a string literal with ‘r’ or ‘R’. Python raw string treats backslash (\) as a literal character. This is useful when we want to have a string that contains backslash and don’t want it to be treated as an escape character.
Angel
Source = https://www.journaldev.com/23598/python-raw-string
Angel
r' is used when we are going to have a string that contains backslash and dont want it to be treadted as an escape character.
Angel
Clear?
محمد دلشاد
yup
Danilo
Good afternoon guys, i’m trying to filter in my url by piece of email but it doesn't always work brings everything, only filters if I inform the entire email, is there how to filter an email by a piece in a url? The url I am informing thus: 127.0.0.1:8000/user/?email__contains=meuemail@ I am using the ModelFilterSet from the django-url-filter package, any other field in my model can I search for a piece of the string except the email?
Oddwings
Hey Guys I am I MCA and have to create one project on Django Can anyone suggest me some definition
Doragonsureiyā
Hey Guys I am I MCA and have to create one project on Django Can anyone suggest me some definition
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
kancharla
Mrng geeks,I am developing a project where I have to let the users to upload images and I have to store them Could any one help me to do this I am using python:3.8 MySql:8.0
The
add field to models.py
The
with upload_to = ""
The
I think you have to install one package for this using pip
The
you have to modify settings.py
refer django documentation
kancharla
Thank you for your suggestion brother
MJ
I think you have to install one package for this using pip
here's the package link https://pypi.org/project/Pillow/2.2.1/
Anonymous
https://www.youtube.com/playlist?list=PLZlOLwawMDAuNeyqtJ4Gl8se1WMhDArwb
kancharla
Tnq guys
N
Any flask developer here
Doragonsureiyā
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With a very high amount of people here the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
cj
Any flask developer here
This is a Django group, just in case
Anuj
Can anyone tell me what is the use of manager
Anuj
It's little bit confusing
Anuj
Please help me
Shreehari
Can anyone tell me what is the use of manager
https://docs.djangoproject.com/en/3.0/topics/db/managers/#managers This gives you better understanding of manager.
Anuj
Ok thanks
raven
Manager gives us an interface through which we can access database . Default manager is objects thats why you use Model.objects.query
Anuj
https://hedgehoglab.com/blog/django-model-managers
Anuj
Good explanation for manager
Prasanthari
How can I do this:- If user is on cart page the user shouldn't see cart option on navbar
U should write cond to show nav bar without cart when user in cart page in html
master-mn
Hello everyone I do mail activation during registration, use sendgrid in settings all settings are ok Yesterday a couple of letters with a link to activate mail came Today I started the project, I try to register an error pops up: TimeoutError: [WinError 10060] The attempt to establish a connection was unsuccessful, because the required response was not received from another computer in the required time, or an already established connection was disconnected due to an incorrect response from an already connected computer [03 / Jun / 2020 09:42:46] "POST / register / HTTP / 1.1" 500 175714 I look in the database, there is a user, mail with the status activated = false, everything seems to be fine. I think the problem with the sandgrid service! Does anyone have experience with this service?
Anonymous
Guys I made this production ready docker compose for django check it out https://github.com/IamStefin/dockerizing-django
CodeTechDeveloper
Hello friends ,how to add a new coloum in Django model
MJ
Hello friends ,how to add a new coloum in Django model
use the dbshell : python manage.py dbshell and alter your table : ALTER TABLE <table_name> ADD column .....
MJ
Hello friends ,how to add a new coloum in Django model
dont forget to add your new column in the models.py and to migrate after
Prasanthari
@PrasanThari
If the cart value is gt than 1 don't show that in nav else show it
Prasanthari
@PrasanThari
{% if cart.value ==1 %} <nav>hide</nav> {% else %} <nav>show</nav> {% End if %} Likewise
Damon
Any free pdf on Django tutorials?
Doragonsureiyā
Any free pdf on Django tutorials?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Prasanthari
Any free pdf on Django tutorials?
U can refer official doc and download it as pdf
Prasanthari
Can you please explain or show the code
Anonymous
Heyy Thier I need help entity_market_item = EntityMarketItem.objects.using("live_marketplace").all().values_list('entity_id',flat=True) when I try to pass entity_market_item in my below query EntityFileAssoc.objects.using("boxer_entities").filter(Q(entity__in=entity_market_item) & (Q(entity_file__file_name__icontains=".png") | Q(entity_file__file_name __icontains=".jpg"))).values_list("entity_file_assoc_id",flat=True) getting error like "Subqueries aren't allowed across different databases. Force the inner query to be evaluated using `list(inner_query)"
Harish
!paste
Doragonsureiyā
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev
Anonymous
!paste
https://dpaste.org/PnJj
Anonymous
here it is.
Anonymous
https://dpaste.org/3ztj#L