Re: how to write Ajax for a Like button in Django

2020-05-17 Thread Motaz Hejaze
The button is submitted but without page refresh On Mon, 18 May 2020, 3:53 am Ahmed Khairy, wrote: > Hi Motaz, > > When I added your code it disabled the function of the button nothing > happened > > On Sunday, May 17, 2020 at 9:30:38 PM UTC-4, Motaz Hejaze wrote: >> >> In your like button form

Re: how to write Ajax for a Like button in Django

2020-05-17 Thread Ahmed Khairy
Hi Motaz, When I added your code it disabled the function of the button nothing happened On Sunday, May 17, 2020 at 9:30:38 PM UTC-4, Motaz Hejaze wrote: > > In your like button form in your templates , > try this : > > > > i don't think you need ajax for this , but if you still need it let us

Re: how to write Ajax for a Like button in Django

2020-05-17 Thread Motaz Hejaze
In your like button form in your templates , try this : i don't think you need ajax for this , but if you still need it let us know On Mon, 18 May 2020, 2:26 am Gabriel Araya Garcia, < gabrielaraya2...@gmail.com> wrote: > Hi Ahmed, I was looking for that during several months and I have found

Re: How to create custom tag - break for tamplate?

2020-05-17 Thread Gabriel Araya Garcia
Sergei, you just to have put an conditional flag. It could be defined in your view. Example: flag_ = 0 if pedrito > 16 flag_ = 1 and flag_ send it in context in template you must include: {% if flag_ == 0 %} brek etc. Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos

Re: how to write Ajax for a Like button in Django

2020-05-17 Thread Gabriel Araya Garcia
Hi Ahmed, I was looking for that during several months and I have found examples than not run, and therefore I`ve get one conclution: "It`s not posible to get that functionality in Django". No one could demostrate with example code. If you find something, please send me the code. Thanks Gabriel

how to write Ajax for a Like button in Django

2020-05-17 Thread Ahmed Khairy
Hi all, I need some help writing the ajax for a like button instead of refreshing every time a like is posted here is the template: {% csrf_token %} {% if user.is_authenticated %} {% if liked

Re: deploying django project with mod_wsgi and apache

2020-05-17 Thread みやうち`
I found out part of my code has problem, althogh I don't know why it didn't output an error. Anyway, thank you for reply. -- 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

How to resize image from Django ckeditor_uploader in the HTML template while rendering?

2020-05-17 Thread Ali Ahammad
I am using Django ckeditor_uploader to make a post view for a blog. But while rendering in the template I wanted to render image separately from the post content texts. My main goal is to set the image separately on the template on top and resizing it. And I can set more pictures inside the pos

Re: How to create custom tag - break for tamplate?

2020-05-17 Thread Sergei Sokov
views.py class MyClassCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, CreateView): model = MyClass template_name = 'mypage.html' form_class = MyClassForm success_url = reverse_lazy('mypage') success_msg = 'сохранён' def get_context_data(self, **kwargs): kwargs['list_mylist'] = MyC

Re: Exception in tests when deleting users in Django

2020-05-17 Thread אורי
אורי‎ 5:54 PM (1 minute ago) to pyweb-il Hi, I found out that changing: User.objects.all().exclude(pk=self.user_1.pk).delete() To: for user in User.objects.all().exclude(pk=self.user_1.pk): user.delete() Fixes the problem. What does it mean? Does it mean I can't safely delete users in bulk

Exception in tests when deleting users in Django

2020-05-17 Thread אורי
Hi, I'm creating a new test and it has users and I delete them: User.objects.all().exclude(pk=self.user_1.pk).delete() The User model has related models with on_delete=models.CASCADE which should be deleted as well. But in my test, I get this exception:

Help with Paginating my api views

2020-05-17 Thread Sunday Iyanu Ajayi
I made use of the global pagination ( which is setup on settings.py) and it worked fine only on generic viewsets . I am trying to make use of pagination in a custom view and it is really challenging. below is a screenshot of my api view. I need help on how to apply pagination on an APIView shown

Re: Tablespace is missing for a table from storage engine InnoDB

2020-05-17 Thread Kasper Laudrup
Hi Ifeanyi, On 17/05/2020 16.04, Ifeanyi Chielo wrote: I think the full error report below will provide more information on the problem That's an error from MySQL. I doubt this is related to Django. This was what I could find: https://bobcares.com/blog/mysql-tablespace-is-missing-for-table

No template exist Django

2020-05-17 Thread Anonymous Patel
https://youtu.be/wDu5nvU1rNY Check this video out if you are facing error as no template exist, Follow this channel Errormania. -- 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, s

Re: how to add an extra field in an admin form (not part of the model)

2020-05-17 Thread Carles Pina i Estany
Thanks very much! I've quickly watched the video... sadly the video helps to add fields into the registration form, not in the admin section (the, by default, /admin URL). As a side note and for future reference anyone here: one of my attempts on Friday was following this one: https://gist.githu

Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-17 Thread Sunday Iyanu Ajayi
Thanks *AJAYI Sunday * (+234) 806 771 5394 *sunnexaj...@gmail.com * On Sat, May 16, 2020 at 1:32 AM John McClain wrote: > I'm not sure this is feasible. The issue is likely about getting paid for > you and for them about getting what they paid for. There is no work-a-round > for this dynamic i

Re: how to add an extra field in an admin form (not part of the model)

2020-05-17 Thread Anonymous Patel
https://youtu.be/lHQI9ydQlSU Try this video it might help, it helped me for the same problem. Raj Patel On Sun, 17 May, 2020, 6:50 pm Carles Pina i Estany, wrote: > > Hi, > > Last week I tried to do something in admin but it didn't work as I had > guessed. > > The simplification of what I want

how to add an extra field in an admin form (not part of the model)

2020-05-17 Thread Carles Pina i Estany
Hi, Last week I tried to do something in admin but it didn't work as I had guessed. The simplification of what I wanted is to have an extra field in the admin form. What I tried to do is what I do in forms outside admin: - class MyModelForm(forms.ModelForm): def __init__(self, *ar

Re: Django back button issue after log-out

2020-05-17 Thread sidharth sharma
did you find the solution for this ? On Monday, December 17, 2012 at 6:39:25 PM UTC+5:30, ke1g wrote: > > > > On Mon, Dec 17, 2012 at 5:14 AM, Ashish Sable > wrote: > >> >> I have written simple registration(login,logout) Django apps. >> when i click on logout and then back button from browser

Re: Tablespace is missing for a table from storage engine InnoDB

2020-05-17 Thread Ifeanyi Chielo
thanks, I will go through it Dr. Chielo C. Ifeanyi Chief Programmer, Head Webometrics Section ICT Unit, UNN 08032366433, 08154804230 ifeanyi.chi...@unn.edu.ng http://www.unn.edu.ng/users/ifeanyichielo On Sun, May 17, 2020 at 12:40 PM Kasper Laudrup wrote: > Hi Ifeanyi,

I am facing issues in sharing module.

2020-05-17 Thread Akshat Zala
I wish to share the post with friends in django application. My project flow chart is as follows: 1. User registers for an account. 2. User will recieve the email confirmation 3. By clicking on the link in email , he gets redirected to login page, where he can login and he will see account succ

Re: Tablespace is missing for a table from storage engine InnoDB

2020-05-17 Thread Kasper Laudrup
Hi Ifeanyi, On 17/05/2020 13.35, Ifeanyi Chielo wrote: Dear all I am unable to access my phpmyadmin  tables either via django or directtly, I always meet this error. " #1030 - Got error 194 "Tablespace is missing for a table" from storage engine InnoDB" Please I need your assistance I thin

Tablespace is missing for a table from storage engine InnoDB

2020-05-17 Thread Ifeanyi Chielo
Dear all I am unable to access my phpmyadmin tables either via django or directtly, I always meet this error. " #1030 - Got error 194 "Tablespace is missing for a table" from storage engine InnoDB" Please I need your assistance -- You received this message because you are subscribed to the Goo

Re: Bootstrap drop down menu not clickable.

2020-05-17 Thread Miracle
Have you tried the same drop down menu code in a plain html file? Without django involved. Just create a html file, put the menu code and boostrap code and test if it works in the first place. This issue might be the dropdown configuration. On Sun, 17 May 2020, 10:49 am Miracle, wrote: > Hey

Re: Bootstrap drop down menu not clickable.

2020-05-17 Thread Miracle
Hey Sunday, Please check this... https://stackoverflow.com/a/61849839/11000813 On Sun, 17 May 2020, 10:28 am sunday honesty, wrote: > Thanks for replying... > I just downloaded it now following the guide on the doc you sent me. > I have added it to my installed app and requirements.txt. > I lo

Re: Bootstrap drop down menu not clickable.

2020-05-17 Thread Kasper Laudrup
Hi Sunday, On 17/05/2020 11.27, sunday honesty wrote: Thanks for replying... I just downloaded it now following the guide on the doc you sent me. I have added it to my installed app and requirements.txt. I loaded it at the top of my template and it didn't work. I then included it in the {% bloc

Re: Bootstrap drop down menu not clickable.

2020-05-17 Thread sunday honesty
Thanks for replying... I just downloaded it now following the guide on the doc you sent me. I have added it to my installed app and requirements.txt. I loaded it at the top of my template and it didn't work. I then included it in the {% block content %} as suggested by a member here yesterday, yet

Re: Bootstrap drop down menu not clickable.

2020-05-17 Thread Kasper Laudrup
Hi Sunday On 17/05/2020 08.33, sunday honesty wrote: That's what I did... But the question is do I need to download django-bootstrap with pip before I can use compiled bootstrap I have downloaded? Isn't django-bootstrap different from bootstrap? The compiled bootstrap you have downloaded is