:
> See
> https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods
> Also on view you have a variable called, where you can limit the available
> methods.
>
> http_method_names
>
>
> El vie, 12 abr 2024 a las 7:20, Mamadou Alp
See
https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods
Also on view you have a variable called, where you can limit the available
methods.
http_method_names
El vie, 12 abr 2024 a las 7:20, Mamadou Alpha Bah (<
mamadoualphabah...@gmail.com>) es
<https://stackoverflow.com/posts/78314829/timeline>
I'm setting up a CRUD system with Django, using Class-Based Views.
Currently I'm trying to figure out how to handle HTTP PUT and DELETE
requests in my application. Despite searching the Django documentation
extensively, I&
Hello,
The OneSignal API does not have a segment that details how to send a
OneSignal Push Notification to iOS and Android devices w/ Python. Is there
any way to have a Push Notification delivered after an email is delivered
via Django Views?
Thanks in advance!
--
You received this message
in this way to make sure everything is going
right in production.
在2023年4月18日星期二 UTC+8 07:14:36 写道:
> I know you can run gunicorn with uvicorn workers. But the sync views will
> be running sync, no longer gevent patched, meaning performance could
> change. I’m also unsure if sync
I know you can run gunicorn with uvicorn workers. But the sync views will
be running sync, no longer gevent patched, meaning performance could
change. I’m also unsure if sync views are serialized into one thread if you
don’t set DJANGO_ALLOW_ASYNC_UNSAFE, which could be a bottleneck.
I did
f things can affect performance like moddlewares, serialization etc)
>
>
> On Sun, Apr 16, 2023 at 5:34 PM Chris Barber
> wrote:
>
>> Hello
>>
>> Production django app, currently 100% sync views, running under gunicorn
>> with gevent worker class.
>>
>&g
16, 2023 at 5:34 PM Chris Barber
wrote:
> Hello
>
> Production django app, currently 100% sync views, running under gunicorn
> with gevent worker class.
>
> @andrewgodwin suggests here it is possible to migrate slowly, just run
> hybrid sync-async and add or convert vie
Hello
Production django app, currently 100% sync views, running under gunicorn
with gevent worker class.
@andrewgodwin suggests here it is possible to migrate slowly, just run
hybrid sync-async and add or convert views as desired
https://www.youtube.com/watch?v=19Uh_PA_8Rc&t=1728s
But to
6:14 PM PULKIT AGRAWAL wrote:
>
>> Hello Everyone,
>>
>> I am very new to Django and am still learning the ropes. If anyone can
>> point me in the right direction, I will be thankful to you.
>>
>> My problems is as follows:
>> 1. I have learned about
My problems is as follows:
> 1. I have learned about class based views and have started using them
> 2. But every now and then I come across a new field that could have been
> overwritten in the class based view to shorted the code
> 3. Is there a way to identify all the fields that ca
you.
>
> My problems is as follows:
> 1. I have learned about class based views and have started using them
> 2. But every now and then I come across a new field that could have been
> overwritten in the class based view to shorted the code
> 3. Is there a way to identify all the f
Hello Everyone,
I am very new to Django and am still learning the ropes. If anyone can
point me in the right direction, I will be thankful to you.
My problems is as follows:
1. I have learned about class based views and have started using them
2. But every now and then I come across a new field
can you provide more details about the specific issues you are facing when
trying to call this method? Are you getting any error messages, or is the
function simply not being called? Any additional information you can
provide will help me better understand your problem.
I am providing you with
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class MyConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_group_name = 'kafka'
# Join room group
await self.channel_layer.group_add(
self.room_group_name,
as a thread local variable, so
that the DatabaseRouter can use it.
However, I am currently looking up async views to see if it can help
optimise our apis. Will my thread-based logic clash with the ASGI async
views ?
Thanks
Vasanth M
--
You received this message because you are subscribed t
I would like to recommend this excellent guide by Luke Plant:
https://spookylukey.github.io/django-views-the-right-way/
Best regards,
Carsten
Am 06.03.23 um 21:19 schrieb Michael Starr:
> What are the pros and cons of either method of rendering HTTP request
> responses?
>
Using classes is always a good way of promoting code usability, and
inheritance. With class base views you don't need to reinvent the wheel.
You can access other Django classes and methods and reduce code
complexity. Although most codes are encapsulated, but you can always go
back t
What are the pros and cons of either method of rendering HTTP request
responses?
https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/
In the article above it states that CBVs are DRYer, but I don't understand
why. The article doesn'
Hello,
I have built a view that takes in dataframes, runs them through a function
and then ultimately pumps out a results dataframe that is transformed into
a HTML object and displayed on the webapp homepage. Now, I am trying to add
in an "Export as CSV" button that upon being clicked will down
Try views or .views while importing and urls.py you should give path like
views.home_view()
On Tue, Nov 15, 2022, 11:25 PM Ogunsanya Opeyemi <
ogunsanyaopeye...@gmail.com> wrote:
> Your views.py is inside profiles folder not pages folder so change
> pages.views to profiles.views
&g
My async CBV works when accessed through my url endpoint with REQUESTS
package. But with the django test client it seems to think the database
doesn't contain the information I'm trying to pull using ORM. I've
confirmed that the data DOES exist in the newly recreated DB (populated
with fixtur
il.html'
> > form_class = forms.ContactForm
> > success_url = 'tours.html'
> >
> > As far as i understand i need to get data from request , but i dont
> > know how to do it. There are a lot of information in function based
> > views, but i
#x27;
form_class = forms.ContactForm
success_url = 'tours.html'
As far as i understand i need to get data from request , but i dont
know how to do it. There are a lot of information in function based
views, but i didnt get how to do it in class based views.
And it would be nice of you
request , but i dont know
how to do it. There are a lot of information in function based views, but i
didnt get how to do it in class based views.
And it would be nice of you to explain where should i put send_mail
function. Any help will be appreciated.
--
You received this message because y
ould take this
> question to a potentially more useful place.
>
> Anyway; I am pretty new to Django but I've been following the tutorials
> and in the Generic Views section here:
> https://docs.djangoproject.com/en/4.0/intro/tutorial04/
>
> I beleive that there is a missi
tutorials but I can't
seem to find a way. If you could help me there I could take this question to a
potentially more useful place.
Anyway; I am pretty new to Django but I've been following the tutorials and in
the Generic Views section here:
https://docs.djangoproject.com/en/4.0/i
Hi I've been searching on how I might contribute to the tutorials but I
can't seem to find a way. If you could help me there I could take this
question to a potentially more useful place.
Anyway; I am pretty new to Django but I've been following the tutorials and
in the Generi
I think this might help
https://docs.celeryproject.org/en/stable/userguide/tasks.html#task-custom-classes
Let me know if this works, if not I will try to find a working example.
I have been using Celery but I don't do class based tasks.
On Tuesday, 8 March 2022 at 16:30:01 UTC+8 aadil1...@gmail.
i am using celery version 5.2.3,
How can i register this class based task, and how can we name add name to
this class based task,
I would appreciate your valuable suggestions
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsu
create
additional tests to determine which group the user belongs to and render
out different contexts and templates depending on the user's group?
from django.shortcuts import render
from django.views import View
from django.contrib.auth.mixins import LoginRequiredMixin
# Create your views
Good day,
Trust you are all well i have written my models and they are working very
well.
l am struggling to create a class based view which will diplay on the
client dashboard side so that he can enter data on a form
please i need help you can app on +27 66 3838 041
With thanks Wilford
--
Hey all,
I am working on a web app using django where in the first view i.e the
landing page I collect a piece of info around which the web app revolves. I
need this piece of info to be saved across different views.
GOAL : Instead of the drop down in the diseaseName I want the disease
you can get that slug value from kwargs
def get(self, request, *args, **kwargs):
slug = self.kwargs.get("slug")
also if you like to pass it in the context you can override get_context_data
refer: https://ccbv.co.uk/
to know more about class based views you can refer to thi
You can use the DetailListView from generic views.
Pass in the template name, form class, and query(which in this case takes
in the slug to query the db)
On Mon, Nov 15, 2021, 21:27 Aadil Rashid wrote:
> Hello my dear Friends, I have a question regarding Class Based Views.
>
> If we h
gt; Hello my dear Friends, I have a question regarding Class Based Views.
>>>
>>> If we have a url e.g,
>>> path('item//', views.funView)
>>>
>>> We can handle it in Function Based Views,
>>> By simply
>>> def funView(request, s
Also request in def get itself
On Tue, 16 Nov, 2021, 9:40 am pankaj palmate,
wrote:
> def get(self, pk, *args,**kwargs ) :
> ...body..
>
> On Tue, 16 Nov, 2021, 2:57 am Aadil Rashid,
> wrote:
>
>> Hello my dear Friends, I have a question reg
def get(self, pk, *args,**kwargs ) :
...body..
On Tue, 16 Nov, 2021, 2:57 am Aadil Rashid, wrote:
> Hello my dear Friends, I have a question regarding Class Based Views.
>
> If we have a url e.g,
> path('item//', views.funView)
>
> We can handle
Hello my dear Friends, I have a question regarding Class Based Views.
If we have a url e.g,
path('item//', views.funView)
We can handle it in Function Based Views,
By simply
def funView(request, slug) :
#logic
return render(request, "tempName")
We can even
Hi, what you are trying to achieve isn't clear to me. Kindly elaborate pls
On Sunday, October 3, 2021 at 4:30:31 AM UTC+2 iroegbu...@gmail.com wrote:
> Hello guys, thanks for helping the last time.
> I am trying to show course views on django admin. Django is serving as an
> AP
Hello guys, thanks for helping the last time.
I am trying to show course views on django admin. Django is serving as an
API to a flutter app
Am i to create another endpoint to count views?
--
You received this message because you are subscribed to the Google Groups
"Django users"
On Thursday, March 25, 2021 at 8:12:46 AM UTC+5:30 Prashanjeet Halder wrote:
> Hello all,
> I'm trying to run a python script that uses requests-HTML library every
> time a view is triggered but getting an error.
>
>
--
You received this message because you are subscribed to the Google Groups
Hello all,
I'm trying to run a python script that uses requests-HTML library every
time a view is triggered but getting an error.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it,
Won't you end up stopping multipart requests in that case?
On Thu, Mar 11, 2021, 02:36 Ryan Nowakowski wrote:
> On Wed, Mar 10, 2021 at 07:43:55AM -0800, Mostapha Bouderka wrote:
> > I'm working on a project with react and django; and want to use django
> > views
On Wed, Mar 10, 2021 at 07:43:55AM -0800, Mostapha Bouderka wrote:
> I'm working on a project with react and django; and want to use django
> views to be used as information source only and not show a page on the
> browser. For example, I have a pilot sign up page that uses
al Solanke wrote:
>
>> By doing this you won't be able to stop the get requests from browser,
>> but post requests can be stopped.
>>
>> On Thu, Mar 11, 2021, 01:42 Kunal Solanke wrote:
>>
>>> Ok in that case, drf by default sets a browsableapi rend
2021, 01:42 Kunal Solanke
> wrote:
>
>> Ok in that case, drf by default sets a browsableapi render on all of the
>> views and viewsets, either overide that in settings, or use
>> renderer_classes=(JSONRendere,) in views in which yiu want to stop it.
>>
>> Sear
By doing this you won't be able to stop the get requests from browser, but
post requests can be stopped.
On Thu, Mar 11, 2021, 01:42 Kunal Solanke
wrote:
> Ok in that case, drf by default sets a browsableapi render on all of the
> views and viewsets, either overide that in setti
Ok in that case, drf by default sets a browsableapi render on all of the
views and viewsets, either overide that in settings, or use
renderer_classes=(JSONRendere,) in views in which yiu want to stop it.
Search for BrowsableAPIRenderer.
Ig you should have mentioned drf sooner.
On Thu, Mar 11
I'am using the django rest framework
On Wednesday, March 10, 2021 at 8:01:26 PM UTC kunalsol...@gmail.com wrote:
> Idk the overall use case here ,
> But if the prject is reasonably bigger and you want to use class based
> views, I'd suggest you to use drf.
> But you if
Thanks for the reply.
However, your answer didn't really solve my issue.
The form i mentioned is just an example, in fact i have other views,. The
issue is that i want those views to only handle information and send them
bach to the front end, but if a user tries to access them thro
Please ignore typos.
On Thu, Mar 11, 2021, 01:30 Kunal Solanke
wrote:
> Idk the overall use case here ,
> But if the prject is reasonably bigger and you want to use class based
> views, I'd suggest you to use drf.
> But you if you don't want to use that,you will have
Idk the overall use case here ,
But if the prject is reasonably bigger and you want to use class based
views, I'd suggest you to use drf.
But you if you don't want to use that,you will have to overide most to the
CBV given by djnango as most of them expect a success url or a template
On 10/03/2021 16.43, Mostapha Bouderka wrote:
I'm working on a project with react and django; and want to use django
views to be used as information source only and not show a page on the
browser. For example, I have a pilot sign up page that uses a pilot
create view to provide informati
Hi
I'm working on a project with react and django; and want to use django
views to be used as information source only and not show a page on the
browser. For example, I have a pilot sign up page that uses a pilot create
view to provide information to the pilot model. I want the users
ows for any design that you really want yourself - you just
> >> need to design the HTML the way you want - I have personally used Django
> >> for many different projects and they all look different. There is no
> >> default layout for Django - so I think I don't really
cts and they all look different. There is no
>> default layout for Django - so I think I don't really understand your
>> question :)
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 18 feb. 2021 kl 14:43 skrev sridhar vumma > >:
&
I have personally used Django
> for many different projects and they all look different. There is no
> default layout for Django - so I think I don't really understand your
> question :)
>
> Regards,
>
> Andréas
>
>
> Den tors 18 feb. 2021 kl 14:43 skrev sridhar v
many different projects and they all look different. There is no
default layout for Django - so I think I don't really understand your
question :)
Regards,
Andréas
Den tors 18 feb. 2021 kl 14:43 skrev sridhar vumma :
> we see better html views with websites like stackoverflow.co
we see better html views with websites like stackoverflow.com can we
integrate such high end html websites along with django is that possible
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop
Like youtube videos belonging to views,likes and
Dislikes
Mahendra Yadav
On Mon, 1 Feb 2021, 20:23 Kasper Laudrup, wrote:
> If you want someone to help you with anything, at least take the minimal
> effort of asking for it in a proper way.
>
> I have no idea which kind of response y
Hi - Plz help me
On Mon, Feb 1, 2021, 20:23 Kasper Laudrup wrote:
> If you want someone to help you with anything, at least take the minimal
> effort of asking for it in a proper way.
>
> I have no idea which kind of response you expect to get from posting
> something like this.
>
> Kind regards
If you want someone to help you with anything, at least take the minimal
effort of asking for it in a proper way.
I have no idea which kind of response you expect to get from posting
something like this.
Kind regards,
Kasper Laudrup
--
You received this message because you are subscribed to
Mahendra Yadav
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://group
yond that supports more specific use cases that usually
> simplifies handling the request - i.e. templates - and each of those
> provides its own set of patterns.
>
> HTH,
> /d
>
>
> On 12 January 2021 at 02:15:11, Robert F. (robert....@gmail.com) wrote:
>
> Are there
t;) wrote:
Are there any Django libraries that make extensive use of class-based views
that I might study if I want to gain an in-depth understanding of how to use
them? The Django documentation is OK at explaining what they are and how they
work but most of the examples are very trivial in natur
> I recommend you consider
> https://spookylukey.github.io/django-views-the-right-way/
I second this, I’m going through this right now, and it’s very useful
information regarding Class Based views vs Function Based views…
It’s making me consider rewriting Quickbbs/Gallery again, with
Dear Robert,
I recommend you consider
https://spookylukey.github.io/django-views-the-right-way/
Best regards,
Carsten
Am 11.01.21 um 16:14 schrieb Robert F.:
> Are there any Django libraries that make extensive use of class-based views
> that I might study if I want to gain an in
Hello Robert.
Did you read class based views code?
Original django class-based view code is below.
https://github.com/django/django/tree/master/django/views/generic
I made an extension class for FormView and ListView.
https://github.com/Arisophy/django-searchview
I hope it helps you
Are there any Django libraries that make extensive use of class-based views
that I might study if I want to gain an in-depth understanding of how to
use them? The Django documentation is OK at explaining what they are and
how they work but most of the examples are very trivial in nature. I
Ok, i understood, can you show me how to multiply 2 fields?
really i can't to do that... i guess i in mental looping
i try to do that in views.py:
data = Articles.objects.all().annotate(result=F('coust_buy') * F('quantity'
)).output_field=FloatField('result')
and the result is this what to yo
Nothing wrong with the query, the problem is that you are trying to
multiply two values of a different type.
You can fix that by converting the smallInteger value to decimal.
On Mon, 04 Jan 2021 at 23:01, jose angel encinas ramos <
encinasj.an...@gmail.com> wrote:
> Hi everyone, i'm a new in djan
gt; Please enter a query in the search form.
>> {% endif %}
>>
>> {% endif %}
>>
>>
>>
>> On Wed, Dec 9, 2020, 2:35 PM Salima Begum
>> wrote:
>>
>>> Thank you @Omkar Parab, I have tried your
>
>
> On Wed, Dec 9, 2020, 2:35 PM Salima Begum
> wrote:
>
>> Thank you @Omkar Parab, I have tried your suggestion. It is working but
>> the only thing i want is how to show the result search list in the front
>> end page in template.
>>
>>
ur suggestion. It is working but
> the only thing i want is how to show the result search list in the front
> end page in template.
>
> Please can you help me out in this also.
>
> Thanks
> ~Salima
>
> On Wed, Dec 9, 2020 at 11:16 AM Omkar Parab wrote:
>
>> He
the link for the built-in-views,
>
> https://github.com/etianen/django-watson/wiki/Built-in-views
>
> To return search results on the home page, you need to add your,
>
> {℅ Url "your_home_namespace" ℅}
>
> in
>
>
>
> On Wed, Dec 9, 2020, 9:35 AM Sa
Here's the link for the built-in-views,
https://github.com/etianen/django-watson/wiki/Built-in-views
To return search results on the home page, you need to add your,
{℅ Url "your_home_namespace" ℅}
in
On Wed, Dec 9, 2020, 9:35 AM Salima Begum
wrote:
> Hi all,
>
&g
Hi all,
I am using the django watson package in my project. How to achieve to
change built in views to change default template rendering and to search
results in the home page.
This is url of django watson
'''https://github.com/etianen/django-watson/wiki/Built-in-views''
/SamuelNoB Linkedin: https://www.linkedin.com/in/samuel-nogueira-87800b1aa/ - De: Patrick CarraEnviado:sábado, 24 de outubro de 2020 16:53Para: Django usersAssunto: testing class based generic views Can
Can anyone point me towards a tutorial for how to test a CreateView
function?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegr
Hi do you hire contract based python/django freelancer?
We can help you in this and related tasks at fair prices. Reply or send
email to divy...@pythonmate.com
Best Regards,
Divyesh Khamele,
Pythonmate
On Sat, 10 Oct 2020, 2:03 pm אורי, wrote:
> Django users,
>
> I have a User model, in which I
Django users,
I have a User model, in which I defined class Meta with ordering. It's
defined like this:
class Meta:
verbose_name = _('user')
verbose_name_plural = _('users')
ordering = ('-speedy_net_site_profile__last_visit',)
swappable = 'AUTH_USER_MODEL'
But, I have two apps -
rm
> from django.contrib.auth.forms import AuthenticationForm
> import random
> from django.contrib.auth import login, logout, authenticate
>
> # Create your views here.
> def home(request):
> return render(request, 'testapp/home.html')
>
> def loginuser(request):
> #
from django.shortcuts import render, redirect
from .models import *
from .forms import UserForm
from django.contrib.auth.forms import AuthenticationForm
import random
from django.contrib.auth import login, logout, authenticate
# Create your views here.
def home(request):
return render(request
Can you share the views.py that you wrote?
Actually If the page for random set of questions is same for User NOT
Logged In and User Logged In, the data you called from database will still
showing up.
On Mon, Aug 24, 2020 at 9:19 PM vipul shinde
wrote:
>
> I'm building a quiz app in which I'm sto
I'm building a quiz app in which I'm storing questions in the database by
creating a model class. I am retrieving a random question set for each user
from the database and then rendering them on an HTML page. The problem is
after logging a user in, a random set of questions appears but that random
Hi,
Documentation for Django 3.1
<https://docs.djangoproject.com/en/3.1/topics/async/#async-views:%7E:text=The%20main%20benefits%20are%20the%20ability,long%2Dpolling%2C%20and%20other%20exciting%20response%20types.>
says
this about async views:
*The main benefits are the ability to s
I need to send the value of the selected option in a drop down to the views.
My html code is as follows:
>
> Select version to compare with
> {%for ver in version_list%}
> **{{ver}} option>**
> {% endfor %}
>
The above is giving me the following error:
> Page n
asses, or Djanago tools
>
> are allowed in its calling syntax... Example
>
>
> from django.urls import path
> from MyApplication import views
>
>
> What I am looking for is an explanation of what things can be imported with
> URLS, VIEWS, HTTP
>
> There are ot
...@gmail.com a écrit :
> I have been looking for a Django Reference Manual to let me know what
> classes, or Djanago tools
>
> are allowed in its calling syntax... Example
>
>
> from django.urls import path
> from MyApplication import views
>
>
> What I am look
UTC+2, dlt1...@gmail.com a écrit :
> I have been looking for a Django Reference Manual to let me know what
> classes, or Djanago tools
>
> are allowed in its calling syntax... Example
>
>
> from django.urls import path
> from MyApplication import views
>
>
> What
I have been looking for a Django Reference Manual to let me know what classes,
or Djanago tools
are allowed in its calling syntax... Example
from django.urls import path
from MyApplication import views
What I am looking for is an explanation of what things can be imported with
URLS
If your wish whatever you want to use, all you have to use is the “request” variable that Django gives you. Btw see “generic views”. Sent from Mail for Windows 10 From: yashwanth balanaguSent: 18 June 2020 12:23To: Django usersSubject: why in views we use def(functions) and model we use class
why in views we use def(functions) and model we use class, why not we use
def(fuction) in models and class in views
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, sen
users,
>
> Which way is preferred to customize Django built-in views such as
> LoginView:
>
> - Define a line in urls.py:
>
> path(route='login/', view=views.django_auth_views.LoginView.as_view(
> template_name='accounts/login.html', authenti
Thank you.
אורי
u...@speedy.net
On Fri, May 29, 2020 at 3:57 PM Augusto Destrero
wrote:
> I would choose the second option and define a LoginView subclass in the
> views.py module.
> The outcome is exactly the same, but I'd prefer to have my views all
> defined in views.py f
I would choose the second option and define a LoginView subclass in the
views.py module.
The outcome is exactly the same, but I'd prefer to have my views all
defined in views.py file.
Adding too much logic in the urls.py module IMHO is not a good idea and it
makes the view less extendab
Django users,
Which way is preferred to customize Django built-in views such as LoginView:
- Define a line in urls.py:
path(route='login/', view=views.django_auth_views.LoginView.as_view(
template_name='accounts/login.html', authentication_form=forms.LoginForm
You should be able to do that by using a relative path instead of the
absolute "/execute". Just use something like href="{% url 'execute' 'SQL'
%}. For this to work you need to name the url path as 'execute'. That way
you'll pass the 'SQL' value to the endpoint.
Here is example from the polls tu
line, can we send the value "SQL" clicking on the link
> of "SQL data" to the method "execute" written in the views? If not, then
> what way can I do so?
>
> Thanks.
>
>
>
>
>
> --
> You received this message because you are subscribed
1 - 100 of 2627 matches
Mail list logo