Aamer
Hi,
Is there a way to debug django app deployed on iis server, through vscode? I am getting some bug after deployment and not able to track the error. I am using sentry but still no success.
Anonymous
can someone explain why this happens
Reverse for 'pf' with arguments '('n', 'd', 'a', 'r', 'k', 's', 'o', 'u', 'l')' not found. 1 pattern(s) tried: ['accounts/profile/(?P<username>[-a-zA-Z0-9_]+)/\\Z']
when i run this:
def get_success_url(self):
return reverse('accounts:pf',args=(self.request.user.username))
Anonymous
instead of ndarksoul it gives '('n', 'd', 'a', 'r', 'k', 's', 'o', 'u', 'l')'
Anonymous
does anybody know?
Oleg
instead of ndarksoul it gives '('n', 'd', 'a', 'r', 'k', 's', 'o', 'u', 'l')'
You forgot comma in args=(self.request.user.username) after username. Replace it with args=(self.request.user.username,). It happens because in python ('abc') (single string element in brackets) without comma interpreted as string 'abc', not as single-element tuple. And list('abc') will give you ['a', 'b', 'c']
Anonymous
Siddharth
How to fix this error
Siddharth
here is my forms.py file
Abd Al Rhman
Is there any good course you recommend that explains django RESTful framework?
Zuxriddin
How can i use args with kwargs together in django reverse() ?
Zuxriddin
How can i use args with kwargs together in django reverse() ?
reverse('website:cinema-list',
args=(cinema_type,),
kwargs={
'name': data.get('name'),
'from_year': data.get('from_year'),
'to_year': data.get('to_year')
})
now i planning use this method but return error
ValueError: Don't mix *args and **kwargs in call to reverse()!
Emmanuel
Zuxriddin
Emmanuel
This is the right thing to do
reverse('website:cinema-list',
kwargs={
'name': data.get('name'),
'from_year': data.get('from_year'),
'to_year': data.get('to_year'),
'cinema_type': 'your cinema_type'
})
Emmanuel
Emmanuel
You can use reverse to generate the normal URL, then concatenate ?cinema_type=value
Emmanuel
base_url = reverse('website:cinema-list',
kwargs={
'name': data.get('name'),
'from_year': data.get('from_year'),
'to_year': data.get('to_year'),
})
return f"{base_url}?cinema_type=balablu"
Emmanuel
Zuxriddin
Madara uchiha
Hello is anyone any idea about how i can use the django app that deployed in aws lambda
Madara uchiha
My agenda is i have deploy my one django app in aws lambda and i want to use that app in my local or in ec2
Madara uchiha
can we achieved that scenario please help
Rutya
How add city and country api in django plz help me
Rutya
Without add model
Rutya
Dirct fetch all City and country list fetch
Siddharth
https://nekobin.com/sihiveturi
🄰🅈🄳🄰.🅃 | 🛆 : ̓̇̌̈́͑̽͌̀̎͐͊̂̉̓̇͐͊̂͛̏̔̓͋͛̆̈̀̇̐̽͂̏͋̓̂̅͐̔͌͆͒̉̌̈́̉̀̋̀̀
Hello,
I wanna create a chat with channels that every anonymous user can send message and one of the admins connect to this chat room and answer it
How can I do this?
🄰🅈🄳🄰.🅃 | 🛆 : ̓̇̌̈́͑̽͌̀̎͐͊̂̉̓̇͐͊̂͛̏̔̓͋͛̆̈̀̇̐̽͂̏͋̓̂̅͐̔͌͆͒̉̌̈́̉̀̋̀̀
Kritesh
Can any one tell me how to make phoneno and otp registration and generate JWT token of that
Mr
I'm going to use many user' type so how to i can make models
gh
I use sql command select to retrieve data from my db.its ok.
SomeBody
Hi all! If there is an APIView class with get, patch, delete methods and DEFAULT_AUTHENTICATION_CLASSES is set globally with authorization requiring a token. Is it possible to remove this authentication for the get method? Of the options so far, only register another controller and register authentication_classes = [] at the class level in it
gh
In views i use cur.fetchall i think.the problem how to turin it html file.the data type not sutable
@l!®€z@
Hello friends I have a model user and I inserted data to it by excel.... I want use get or create for bypass duplicate user but I have a error it text is "unique constraint failed main user.username "
@l!®€z@
My defaults is defaults={"username":username}
Тимофей
Hello everyone, I'm starting my journey in Django, please tell me where is the best place to start? Maybe some courses, videos or books? Which approach would be more correct?
morty
Starting with the Django documentation to learn basic functionality like urlonf or mapping url , Django templating , using ORM of Django to creates databases … and so on
Doragonsureiyā
Тимофей
thank you
Anonymous
class ProfileUpdateView(UpdateView):
model = CustomUser
template_name = 'accounts/pf_update_form.html'
fields = ['first_name', 'last_name']
slug_field = 'username'
slug_url_kwarg = 'username'
def get_success_url(self):
return reverse(
"profile/slug:username/",args=(self.request.user.username,)
)
why i get this error ,i could find anything useful in the internet:
'profile/slug' is not a registered namespace
Chayeb
Anonymous
Chayeb
how?
app_name=your app add this
Line to urls.py
Chayeb
Slug it's the name of your app?
Марат Владимирович
MomoDevOP
Someone can give me some videos links on how to use Django-odk ?
I want to transform a xForm to a web form.
I did some research, the library I found is Django-odk
Марат Владимирович
add this namespace your route in urls.py
Maxim
Anonymous
Slug it's the name of your app?
app_name = 'accounts'
urlpatterns = [
path('signup/',SignUpView.as_view(),name='signup'),
path('profile/<slug:username>/',ProfileView.as_view(),name='pf'),
path('profile/<slug:username>/edit/',ProfileUpdateView.as_view(),name='pfupdate'),
]
thats my urls.py
Chayeb
Chayeb
Go to Django documentation and search about this because I think you don't have to write it in your views
Anonymous
Anonymous
Chayeb
Welcome
Vyacheslav
I can't figure out how to import packages in Django, can you tell me how to import:
from cg.cg.utils_api.api_cs.enum.data_url import Urls
Everything is displayed without errors, but on server start:
line 2, in <module>
From cg.cg.utils_api.api_cs.enum.data_url import Urls
ModuleNotFoundError: No module named 'cg.cg'
Chayeb
Chayeb
Arian
hi guys. i'm working on a ecommerce website with 4 products . 3 of them are just regular product like honey or royal jelly .but last product is mixture of other products with variable amount (like potion i think). now im not sure for last product is better to make another model in database ore another hole section(app) or maby just use Variations.
The Inspired
The Inspired
The Inspired
Arian
Charly
The Inspired
Read whats YAGNI
Ah... I see... new term for me. Thanks.
Well, I just shared my opinion. @arianLuc is free to implement it or not.
@l!®€z@
@l!®€z@
U have other way
IM~Exynos
Any using async with django, i am facing issues with the login decorator.
I need a alternative action if it's not supported. I need to fetch url parallel from external source, like 10+ parallel request.
Anonymous
prepopulated_fields is same as give defaults?