Doragonsureiyā
crispy-forms gives error when trying to run on local host
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
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']
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() ?
Doragonsureiyā
How can i use args with kwargs together in django reverse() ?
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
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()!
Zuxriddin
Just use kwargs or args, Neva both
kwargs not for query parametrs ?
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
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"
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
Siddharth
https://nekobin.com/sihiveturi
What's error in this code
🄰🅈🄳🄰.🅃 | 🛆 : ̓̇̌̈́͑̽͌̀̎͐͊̂̉̓̇͐͊̂͛̏̔̓͋͛̆̈̀̇̐̽͂̏͋̓̂̅͐̔͌͆͒̉̌̈́̉̀̋̀̀
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
Mr
I'm going to use many user' type so how to i can make models
for example there are company, branch, staff and users in my project how to i make models
Anonymous
Dirct fetch all City and country list fetch
There's a library for that Django countries I guess
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ā
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?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Тимофей
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
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
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
The goal is to generate a web form in order to collect data. I use kobotoolbox to make the form and I want to use it in Django. If someone have experience on that, please give me some useful link 🙏
MomoDevOP
not everything was in the video
did you already use the package Django-odk??
Anonymous
Slug it's the name of your app?
no it is not , but someone tol me i need to use slug:sth to use text as link, not id
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
Anonymous
Slug it's the name of your app?
should i use slug just in model ? instead
Chayeb
should i use slug just in model ? instead
The question it's how to use slug
Chayeb
Go to Django documentation and search about this because I think you don't have to write it in your views
Anonymous
The question it's how to use slug
basically yes, how to use it?
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'
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
What if there not gonna be new product in future?
Have you seen the future? It is always better to put stuff for future, even if you might not need it.
Vyacheslav
pip install python-cg
But cg.cg is folders
Vyacheslav
It's this module are you looking?
This route is route to Class, from root of my project
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@
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?