Doragonsureiyā
Hello everyone Can anyone suggest me My dynamic URL routing is not working in my django ?
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
Shihasz
There is no field named students. And you are filtering based on that column.
Shihasz
Don't use foreign key to user. Use onetone field
Henry
Know how to Access Choices with REST APIs?
You need to create ModelSerializer with related key
sky
related key in the serializer itself?
Shihasz
That's 'student' as you written inside model class.
Abrar
When subclassing UserCreationForm user passwords are automatically supposed to validate right? Like password and confirm password should me automatically verified and if not an error should be automatically raised.
Abrar
I noticed it in Cory Schafer's Registration Tutorial
Abrar
I gave it a shot but its not working although he was using fbv's and i use CBV's
Anonymous
https://docs.djangoproject.com/en/3.0/topics/auth/default/
Abrar
https://docs.djangoproject.com/en/3.0/topics/auth/default/
I am aware of this , i am asking a question related to UserCreationForm
Gini
Pandas
Means like pd.webreader
Allexiusw
Hello group I wonder if you would help me with this issue: Internal Server Error: /mumble/api/api.js Traceback (most recent call last): File "/home/allex/python-project/virtual-envs/django/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/allex/python-project/virtual-envs/django-3/lib/python3.8/site-packages/django/utils/deprecation.py", line 96, in call response = self.process_response(request, response) File "/home/allex/python-project/virtual-envs/django-3/lib/python3.8/site-packages/django/middleware/csrf.py", line 324, in process_response self._set_token(request, response) File "/home/allex/python-project/virtual-envs/django-3/lib/python3.8/site-packages/django/middleware/csrf.py", line 188, in _set_token request.META['CSRF_COOKIE'], KeyError: 'CSRF_COOKIE' I'm upgrading an app created in django 1.7 to 3.0 and I'm using ExtJS, I have checked some stackoverflow solutions but they didn't work.
Prabha
Hlo guys
Prabha
Djongo is not available in backend error display
Anonymous
Have you activated ur virtual environment?
Prabha
Abrar
Yes
I cannot find Documentation on UserCreationForm in django docs
Muslim
I cannot find Documentation on UserCreationForm in django docs
https://lmgtfy.com/?q=usercreationform+django
D.O
I mean ensure django works first
Allexiusw
I mean ensure django works first
Yeah Django is working now but I'm just facing the problem csrf in Chrome, in Firefox I don't have any problems with csrf. I did some suggested configurations about cookies but it didn't solve the problem.
.
How we can write Model for category and sub-category? Any hint
D.O
If using drf, I would recommend TokenAuthentication in place of SessionAuth
wanderer
https://hastebin.com/pocayecugi.rb
wanderer
when i update the tast its creating a new
wanderer
rather than upadating the same
Eazy
Hello guys, please assist in generating the equivalent Django ORM query for: ''' SELECT stop_id, stop_name FROM stops WHERE stop_id IN ( SELECT DISTINCT stop_id FROM stop_times WHERE trip_id IN ( SELECT trip_id FROM trips WHERE route_id = 80500010511)) '''
Hussein
How to automatically change a field's value at the time mentioned in the same object
Manish
i am trying to register user as foreign key in administrator.. But I am getting an issue like Attribute error: 'Postweb' object has no attribute 'is_anonymous'
Manish
Anyone know how can I decalre 'is_anonymous' function in class???
utkarsh
Failed to load resources the server respond with a status of 505 (internel server error?)
utkarsh
Pleaz tell me how can i remove it
utkarsh
I have to submit my project tomorrow
Doragonsureiyā
Failed to load resources the server respond with a status of 505 (internel server error?)
Please, provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you. Include details such as libraries, platforms, modules, etc.
Eazy
Hi, it gives an error: Unsupported lookup 'stop_id' for CharField or join on the field not permitted.
This is my model structure: class Stops(models.Model): stop_id = models.CharField(max_length=100, primary_key=True) stop_name = models.CharField(max_length=100) stop_lat = models.TextField() stop_lon = models.TextField() location_type = models.CharField(max_length=10, blank=True, null=True) parent_station = models.CharField(max_length=100, blank=True, null=True) class Meta: db_table = 'stops' class Trips(models.Model): trip_id = models.CharField(max_length=100, primary_key=True) route_id = models.ForeignKey(Routes, on_delete=models.CASCADE, db_column='route_id') service_id = models.ForeignKey(Calendar, on_delete=models.CASCADE, db_column='service_id') trip_headsign = models.CharField(max_length=100) direction_id = models.CharField(max_length=100) shape_id = models.CharField(max_length=100) class Meta: db_table = 'trips' class StopTimes(models.Model): trip_id = models.ForeignKey(Trips, on_delete=models.CASCADE, db_column='trip_id') arrival_time = models.CharField(max_length=100) departure_time = models.CharField(max_length=100) stop_id = models.ForeignKey(Stops, on_delete=models.CASCADE, db_column='stop_id') stop_sequence = models.CharField(max_length=100) class Meta: db_table = 'stop_times'
Eazy
StopTimes.objects.filter(trip_id__route_id__id=80500010511).values(stop_id__stop_id, stop_id__stop_name) try this
This on has also returned an error, but I've tried to create a series of that don't return an error: related_trips = Trips.objects.filter(route_id=route_id); related_stop_times = StopTimes.objects.filter(trip_id__in=related_trips); related_stops = tops.objects.filter(stop_id__in=related_stop_times); response = related_stops.values()
A
I got error while run code in python manage.py makemigrations in terminal
Eazy
In the second query just add .values_list('stop_id__id', flat=True)
I changed stop_id__id to stop_id and Yeeeees ... It worked!!!!.
Eazy
In the second query just add .values_list('stop_id__id', flat=True)
Thank you so much Yogesh 🙏🏾🙏🏾🙏🏾🙏🏾
Manish
I am trying to register user as foreign key in administrator.. But I am getting an issue like Attribute error: 'Post object has no attribute 'is_anonymous' Anyone know how can I decalre 'is_anonymous' function in class???
Manish
Ok I am sending code here
Manish
https://linkode.org/#VAc9a2eY9d5fBxkESch153
Manish
https://linkode.org/#VAc9a2eY9d5fBxkESch153
I have written my code here.. When I comments user field then I can easily connect see Post class in administration
A
I'm trying to do something in Django and I'm not sure how will I do it. can someone help? https://stackoverflow.com/questions/61985719/post-data-while-mapping-between-two-fields-in-django
محمد دلشاد
i have done all basics of django and in REST,serializers and AJAX
محمد دلشاد
what should i go for next
محمد دلشاد
?
Rajesh
Guys someone say free site for download django projects?
محمد دلشاد
github would be bttr if u google
Hussein
How to automatically change a field's value at the time mentioned in the same object
Harshit
How to display word file in browser using django ?
Alex
How to display word file in browser using django ?
Read the file, format it with HTML, display it in a template?
A
https://hastebin.com/jolejocufi.sql please check this above error while run python manage.py makemigrations
Yogesh
How to automatically change a field's value at the time mentioned in the same object
I think writing cron for that will help but even for that there will be some delay
Anonymous
Hello folks, Just wanted to know if anyone knows how to Update username and email in User model after login using UpdateView in views.py and (i have written a class in forms.py with UserChangeform and imported in views.py ) Any link or lead will be great..
Anonymous
i know how to do it with function i need to do it with class
Jb
NameError at /products/ name 'Product' is not defined Request Method: GET Request URL: http://127.0.0.1:8000/products/ Django Version: 3.0.6 Exception Type: NameError Exception Value: name 'Product' is not defined
Jb
def products(request): products = Product.objects.all() return render(request, 'accounts/products.html', {'products': products})