Re: CKEditor

2016-04-11 Thread Luis Zárate
Supongo está usando django-ckeditor, si es así lo que tiene que hacer es
usar el field que ellos proporcionan.

https://github.com/django-ckeditor/django-ckeditor#field


además recuerde usar {{form.media}} en la plantilla, para que se cargue el
js.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyN3%3D1HKLw4VJO9odtkJ0oOz831qodUoC8awu9u-EaD9dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about users system

2016-04-15 Thread Luis Zárate
I thing Sites framework do something similiar to you problem, so you could
study how is implemented.


https://docs.djangoproject.com/en/1.9/ref/contrib/sites/




El viernes, 15 de abril de 2016, Eduardo Leones <
edua...@ypytecnologia.com.br> escribió:
> Javier, thanks for the answer.
> Very interesting "multi-Tenat" solution, including found this really cool
below:
> https://github.com/bernardopires/django-tenant-schemas
> What worried me was his observation that is not a simple implementation
to be done in Django. What is the biggest difficulty in this method?
> I think your suggestion to create a separate table for fantastic company
and I think the best solution at the moment.
> tks
>
> Em sexta-feira, 15 de abril de 2016 10:27:43 UTC-3, Javier Guerra
escreveu:
>>
>> On 15 April 2016 at 12:17, Eduardo Leones 
wrote:
>> > I am developing a system in which my clients are companies. Every
company
>> > needs to have its isolated from other business data.
>>
>> google for "multi-tenant" web applications.  warning: there are quite
>> strong opinions about how it should be done.
>>
>> in particular, there's lots of advice of setting a separate database
>> for each tenant.  It does have some advantages, but in practice it's
>> not easy to do in Django.
>>
>>
>> > My reasoning is to register each client (company) as a group within the
>> > Django auth system. Users of them would be users connected to this
group.
>>
>> Yes, this can work.  Personally, instead of reusing the Group tabke, I
>> tend to create a specific 'Company' table, and add a 'company' foreign
>> key to users.  The reasoning is that you _will_ have other groups that
>> are not companies (maybe internal divisions, or for access-level
>> privileges, whatever), and then you have the problem of separating two
>> kinds of groups.
>>
>>
>> > This line of thinking is correct? There is a decorators to limit
access to
>> > the Group as a whole? In part of the Model link the data to a group is
a
>> > good practice?
>>
>> Make sure that every record can be traced to a specific Company, some
>> of them because they're linked to a User, or maybe by a direct
>> 'company' link.  Then be _absolutely_ sure that every database query
>> includes a company condition.
>>
>> something like this:
>>
>> @login_required
>> def getsomething(request, id):
>> thing = get_object_or_404(Thing,
>> department__company=request.user.company, id=id)
>>  build response ...
>>
>>
>> It's tempting to put the "current" company somewhere and patch all
>> requests to include that, but it gets very complex quickly, and also
>> you get the problem of managing what in effect is a global variable.
>> not worth it.
>>
>>
>> --
>> Javier
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/89dad6b7-4967-48af-8554-e1a53f2d584f%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyNMsnNqRK2g%2BB2-JThE2dbAkzShUBF%3DuTjBGKwixNM-Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to customizing CSS in djangocms-table

2016-04-16 Thread Luis Zárate
You only need to overwrite the template

https://github.com/divio/djangocms-table/blob/master/djangocms_table/templates/cms/plugins/table.html

Django template engine find the template in the order of INSTALLED_APPS, so
you only need to put an app with your version of
templates/cms/plugins/table.html
before djangocms_table and django will load this file and not the
djangocms_table file



El sábado, 16 de abril de 2016, Derek  escribió:
> Is this project being maintained; looks like last change was nearly a
year ago..?
>
> On Friday, 15 April 2016 20:18:51 UTC+2, Régis Silva wrote:
>>
>> I use djangocms-table. And this plugin return
>> 
>>   Tabela exemplo
>>   
>> 
>>   2
>>   3
>>   5
>>   8
>>   
>> 
>> 
>>   a
>>   b
>>   c
>>   d
>>   e
>> 
>> 
>>   f
>>   g
>>   h
>>   i
>>   j
>> 
>>   
>> 
>>
>> But i need with Bootstrap style. I need
>> 
>>   
>> 
>>    
>>   2
>>   3
>>   5
>>   8
>> 
>> 
>>   a
>>   b
>>   c
>>   d
>>   e
>> 
>> 
>>   f
>>   g
>>   h
>>   i
>>   j
>> 
>>   
>> 
>> I'm not talking to insert the CSS properly, but extend the plugin so
that it returns this bootstrap style.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/df5af9aa-230e-4b94-8fd3-8bd2d4438be9%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyPdOcch2mgfeE1041RkXD54uET5H%3Difax0GqKdcpZ3Jwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django staticfiles problem

2020-10-15 Thread Luis Zárate
You have a problem here
{% static '/css/base.css' %}

the correct is
{% static 'css/base.css' %}

Also is a bad idea set media folder in static.
take a look here https://docs.djangoproject.com/en/3.1/howto/static-files/




El mié., 14 oct. 2020 a las 23:05, Farai M ()
escribió:

> Why have the media url if it's point to the same dir as static .Your can
> just specific it's separately in it's own dir as /media/ and have /static/
> .You are also missing a static root there .
>
> On Wed, Oct 14, 2020, 5:05 PM Chelsea Fan 
> wrote:
>
>> MEDIA_URL = '/images/'
>> MEDIA_ROOT = BASE_DIR / 'static/images'
>>
>>
>> On Wed, Oct 14, 2020 at 2:12 PM Anh Nguyen  wrote:
>>
>>> where is your STATIC_ROOT ?
>>>
>>>
>>> On Wed, Oct 14, 2020 at 5:43 PM Chelsea Fan <
>>> allaberdi16yazha...@gmail.com> wrote:
>>>
 hello everyone, I have an issue, I can't connect css style to my
 template, but I can upload images and see it , here is my code,  please
 help me, thanks  for attentions !!!

 STATIC_URL = '/static/'
 STATICFILES_DIR = [BASE_DIR / 'static']

 {% load static %}
 
 
 
 
 

 [image: image.png]

 --
 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://groups.google.com/d/msgid/django-users/CAJwZndd_SYaToM%3D6h1KL-WmXs7eR3e0sgwHqVPPFwo%3Dx2HW5xg%40mail.gmail.com
 
 .

>>> --
>>> 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://groups.google.com/d/msgid/django-users/CAKaoNbTN2-hiy71RS8H8i_wc9XeQqJBOLkR%3DOjEJxocorO1FRw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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://groups.google.com/d/msgid/django-users/CAJwZnde%3D8xOePMK5L%2B9YvXtnW_U%2BHCpX2VVq5R%2BmQDZz39kBrQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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://groups.google.com/d/msgid/django-users/CAMeub5PM26mY%2BDpB-xK0NorWxXOE1qahL-zf2WJrFirqeGL73A%40mail.gmail.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyN%3DaboOu1c4h9OuaYac1UJeRkrSe7nRXrSHY65EZfuYAA%40mail.gmail.com.


Re: can Django replace PHP ?

2021-06-28 Thread Luis Zárate
Hi, you can create several web applications with Django. So I guest you can
replace all web stuff with Django or other lib in python for web
development.

El lun, 28 jun 2021 a las 7:17, Krishna Adhikari ()
escribió:

> Hello all  my seniors
>
> I am doing Data Science programming (python) for 3 years now in my
> organization I also have to develop a Web Platform to deeply ML models and
> also to develop other web applications together.
>
> I searched a lot of information on google, but till now I did not make a
> decision should I learn PHP or I can handle it all with Django?
>
> *can we solve all kinds of web application problems with Django without
> learning PHP ?? *
> *or PHP also recommended.*
>
> Thank you all in advance
>
> --
> 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://groups.google.com/d/msgid/django-users/f2007209-a90e-4a08-8d03-b2b3a1007e1en%40googlegroups.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyOqHw6jRfSu3WL97csjz2npODsO-anVRkGALOhD7fbrvw%40mail.gmail.com.


Re: SChedule email

2021-07-01 Thread Luis Zárate
You can create a custom command using this doc
https://docs.djangoproject.com/en/3.1/howto/custom-management-commands/

Now, you can call it like

python manage.py mycustomcommandname

so in Linux environment  you can use crontab (with crontab -e) to execute
the command.


El jue, 1 jul 2021 a las 15:28, SKYLINE TV ()
escribió:

>
> *You can check out celery and how to integrate it with django. Once done,
> task scheduling is easy,first add your gmail configuration in settings.py
> as follows:*
>
> *EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend' *
> *EMAIL_USE_TLS = True *
> *EMAIL_HOST = 'smtp.gmail.com ' *
> *EMAIL_HOST_USER = 'your_email' *
> *EMAIL_HOST_PASSWORD = 'your password' *
> *DEFAULT_FROM_EMAIL = EMAIL_HOST_USER EMAIL_PORT = 465*
>
> Then in your tasks.py you can add the function for scheduling emails as
> follows:
>
> *from django.template.loader import render_to_string *
> *from django.core.mail import EmailMessage*
>
> @periodic_task
> ( run_every=(crontab(hour=3, minute=34)), #runs exactly at 3:34am every
> day
> name="Dispatch_scheduled_mail",
>  reject_on_worker_lost=True, ignore_result=True)
> def schedule_mail():
>  message = render_to_string('app/schedule_mail.html')
>  mail_subject = 'Scheduled Email' to_email = getmail email =
> EmailMessage(mail_subject, message, to=[to_email])
>  email.send()
>
> *Then finally your email template 'schedule_mail.html*
> {% autoescape off %}
> Hello ,
>  This is a test email if you are seeing this,
>  your email got delivered!
>  Regards, Coding Team.
>  {% endautoescape %}
> On Thursday, July 1, 2021 at 1:54:31 PM UTC+1 divyamu...@gmail.com wrote:
>
>> HI,
>>
>> I wanted to schedule a email every jan and aug 6 monthly basis without
>> celery using settings.py. Can anyone help?
>>
>> once in every 6months mail should be triggered
>>
> --
> 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://groups.google.com/d/msgid/django-users/a87a8623-d123-404d-91b8-d30a01d91dc0n%40googlegroups.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyPk%3D31F3j1D%2BsH8AA_2DDtK6XQikKBK1aRcvpzEvJJR-A%40mail.gmail.com.


Re: Help on Creating a Superuser account on render.

2024-04-10 Thread Luis Zárate
Maybe something like

python manage.py shell -c "from django.contrib.auth.hashers import
make_password;from django.contrib.auth.models import User; admin =
User(username='username', email='exam...@example.com',
password=make_password('password'),
is_superuser=True,is_staff=True);admin.save()"



El dom, 7 abr 2024 a las 2:13, ALINDA Fortunate ()
escribió:

> It's my external database is postgres on railway.
>
> Let me try your opinion and I see.
>
> On Sat, 6 Apr 2024, 20:33 Aniket Raj Singh, 
> wrote:
>
>> So you have used render to host your application, you might have
>> connected an external database (postgreSQL or any other) you might have
>> used the environment setup to set the database up with the postgreSQL
>> hosted either on render itself or on a different server, just connect the
>> database with your application on your local host and create a super user
>> since the database is same on the render's server's application the
>> superuser will be same as the superuser you created on the local server
>> thus you can access the admin panel
>>
>>
>> On Saturday 6 April, 2024 at 9:58:00 pm UTC+5:30 ALINDA Fortunate wrote:
>>
>>> Hello I have successfully a django project on render but i have failed
>>> to access the admin panel
>>>
>>> Any idea on how to create a superuser account on a free tier of render
>>>
>>> Below is my build.sh file
>>> #!/usr/bin/env bash
>>> # Exit on error
>>> set -o errexit
>>>
>>>
>>>
>>> # Modify this line as needed for your package manager (pip, poetry, etc.)
>>> pip install -r requirements.txt
>>>
>>> # Convert static asset files
>>> python manage.py collectstatic --no-input
>>>
>>> # Apply any outstanding database migrations
>>> python manage.py migrate
>>>
>>> if [[ $CREATE_SUPERUSER ]];
>>> then
>>>   python world_champ_2022/manage.py createsuperuser --no-input
>>> fi
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> ALINDA Fortunate
>>> Graduate Of Computer Science
>>> Gulu University
>>> Passionate about Software Development in Python
>>> If you can't explain it simply, you don't understand it well enough.
>>> alindafo...@gmail.com.
>>> +256 774339676 <+256%20774%20339676> / +256 702910041
>>> <+256%20702%20910041>
>>> Kagadi.
>>>
>> --
>> 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://groups.google.com/d/msgid/django-users/9dabff6a-7f5a-4d30-a097-a128f68a6feen%40googlegroups.com
>> 
>> .
>>
> --
> 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://groups.google.com/d/msgid/django-users/CAPifpCsa%2BrmS3OWiycH_309ROvMcazv2Z_E76UcZiZKEb%3D3YPg%40mail.gmail.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyOcJ%2BeL3dTgVHfgW1tjH5p6-qHUzKq83t3z8xK7iNFGdQ%40mail.gmail.com.


Re: DRF Trailing Slah

2024-04-12 Thread Luis Zárate
Check your URL.py and append the slash, also take a look of
https://docs.djangoproject.com/en/5.0/ref/settings/#append-slash


El vie, 12 abr 2024 a las 15:40, MISHEL HANNA ()
escribió:

> Hello
> i have endpoint when add / to the end of it i can not send request it
> return this
> Not Found: /api/v1/properties/user/
> [12/Apr/2024 20:19:03] "GET /api/v1/properties/user/ HTTP/1.1" 404 23
>
> but when remove / from the end of it return success
> [12/Apr/2024 20:19:09] "GET /api/v1/properties/user HTTP/1.1" 200 635
>
>
> --
> 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://groups.google.com/d/msgid/django-users/d5b533b0-e482-4db5-8a4d-ce925aefcbf4n%40googlegroups.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyNc9sNk_6qBoF9X7wMbEYtoLmj_Qo-9mXdHyHNSAkTWVQ%40mail.gmail.com.


Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
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>) escribió:

> 
>
> 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'm having trouble finding concrete examples and clear
> explanations of how to submit these types of queries to a class-based view.
>
> I created a view class named CategoryView, extending from:
> django.views.View, in which I implemented the get and post methods
> successfully. And I want to build my urls like this:
>
>1. New Category: 127.0.0.1:8000/backendapp/categories/create
>2. List all Category: 127.0.0.1:8000/backendapp/categories/
>3. Retrieve only one Category: 127.0.0.1:8000/backendapp/categories/1
>4. Etc...
>
> However, when I try to implement the put and delete methods, I get stuck.
>
> For example :
> from django.views import View
>
> class CategoryView(View):
>  template_name = 'backendapp/pages/category/categories.html'
>
>  def get(self, request):
>   categories = Category.objects.all()
>   context = { 'categories': categories }
>   return render(request, self.template_name, context)
>
>  def post(self, request):
>   return
>
>  def delete(self, request, pk):
>   return
>
>  def put(self, request):
>   return
>
> I read through the Django documentation and found that Class-Based Views
> support HTTP requests: ["get", "post", "put", "patch", "delete", "head ",
> "options", "trace"].
>
> link:
> https://docs.djangoproject.com/en/5.0/ref/class-based-views/base/#django.views.generic.base.View
> 
>
> Despite this, I can't figure out how to do it.
>
> So I'm asking for your help to unblock me.
>
> I looked at the Django documentation and searched online for examples and
> tutorials on handling HTTP requests in class-based views. I also tried
> experimenting with adding the put and delete methods to my CategoryView
> view class, but without success. I expected to find resources that clearly
> explain how to integrate these queries into my Django application, as well
> as practical examples demonstrating their use. However, I haven't found a
> working solution and am now seeking help from the community to overcome
> this difficulty.
>
> --
> 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://groups.google.com/d/msgid/django-users/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%40googlegroups.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyNsQdYWD4W_Mfr%3DMfdP-DrbYeWf0qAgWDEN6TDbVOpR7A%40mail.gmail.com.


Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
Also a recomendation, see that `dispatch` method call the view as

handler(request, *args, **kwargs)

So maybe is a good idea do something like:

class MyView(view):
 def put(self, request, *args, **kwargs):
...


Regards,

El vie, 12 abr 2024 a las 16:13, Luis Zárate ()
escribió:

> 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>) escribió:
>
>> <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'm having trouble finding concrete examples and clear
>> explanations of how to submit these types of queries to a class-based view.
>>
>> I created a view class named CategoryView, extending from:
>> django.views.View, in which I implemented the get and post methods
>> successfully. And I want to build my urls like this:
>>
>>1. New Category: 127.0.0.1:8000/backendapp/categories/create
>>2. List all Category: 127.0.0.1:8000/backendapp/categories/
>>3. Retrieve only one Category: 127.0.0.1:8000/backendapp/categories/1
>>4. Etc...
>>
>> However, when I try to implement the put and delete methods, I get stuck.
>>
>> For example :
>> from django.views import View
>>
>> class CategoryView(View):
>>  template_name = 'backendapp/pages/category/categories.html'
>>
>>  def get(self, request):
>>   categories = Category.objects.all()
>>   context = { 'categories': categories }
>>   return render(request, self.template_name, context)
>>
>>  def post(self, request):
>>   return
>>
>>  def delete(self, request, pk):
>>   return
>>
>>  def put(self, request):
>>   return
>>
>> I read through the Django documentation and found that Class-Based Views
>> support HTTP requests: ["get", "post", "put", "patch", "delete", "head ",
>> "options", "trace"].
>>
>> link:
>> https://docs.djangoproject.com/en/5.0/ref/class-based-views/base/#django.views.generic.base.View
>> <https://stackoverflow.com>
>>
>> Despite this, I can't figure out how to do it.
>>
>> So I'm asking for your help to unblock me.
>>
>> I looked at the Django documentation and searched online for examples and
>> tutorials on handling HTTP requests in class-based views. I also tried
>> experimenting with adding the put and delete methods to my CategoryView
>> view class, but without success. I expected to find resources that clearly
>> explain how to integrate these queries into my Django application, as well
>> as practical examples demonstrating their use. However, I haven't found a
>> working solution and am now seeking help from the community to overcome
>> this difficulty.
>>
>> --
>> 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://groups.google.com/d/msgid/django-users/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyNQtHhV3TPMtB4qLyipdjcnZBZA8_mwf-1_j2F%2B_sER5g%40mail.gmail.com.


Alternatives to django ajax select

2019-10-30 Thread Luis Zárate
Hi Guys,

Do you know any alternative to django-ajax-selects, I am using it in a
project in django 2.2 but docs says that support <=2.1 and also has some
problems with the version on jquery used, so I am looking something that
help to remplace this lib.

https://github.com/crucialfelix/django-ajax-selects

Thanks
-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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://groups.google.com/d/msgid/django-users/CAG%2B5VyPzuPpPpm1QByKGjChPtN1-AnPcYkrNFfOR%2B203Hw43-Q%40mail.gmail.com.


<    1   2   3