Re: Illegal Hardware Instruction

2023-04-11 Thread Julio Cojom
Is your computer an apple silicon mac?






El mar, 11 abr 2023 a las 14:21, Mesfin Haftu () escribió:

> Hello There,
>
> This is Mesfin, I am working on a project of deep learning to classify
> images. I design the model, train, fit, evaluate and predict with my model.
> After that I save the model and try to do some users interface with Django
> to make things easier for users, however when  I try to "python manage.py
> runserver" It says Illegal Hardware Instruction.
> Is there any one who faces this thing before and have solution.
>
> Thankyou for your positive answers
> Mesfin
>
> --
> 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/cc06c8fc-6cda-436a-bac7-75b7bbe6c920n%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/CAHRQUHmS3d9GiQr1UgipqgqSeQrZsfJGK%2BCkEo7%2BbHeO9X7Jrw%40mail.gmail.com.


Re: How to use choices in model field

2022-11-02 Thread Julio Cojom
When you change the status to Verified, you are only changing the object
instance in memory, to save it to the database, you need to call the method
save.

verification.save() at the end should make it work

El El mié, 2 de nov. de 2022 a la(s) 10:23, Aaryan R Soni <
aaryanrson...@gnu.ac.in> escribió:

> Okay, but still the problem is that how do I set the value of status
> field, as I have written in the code, verification.status = 'Verified' it
> is not giving any error but it is not working either
>
> On Wed, Nov 2, 2022, 9:51 PM kateregga julius 
> wrote:
>
>> Don't use square blackest [ ]
>>
>> status_choices=(('Unverified','Unverified'),('Verified','Verified'))
>>
>> On Wed, Nov 2, 2022, 5:52 PM Aaryan R Soni 
>> wrote:
>>
>>> Hey guys, i am facing some issues using choices in models.CharField. I
>>> am creating a model which has username and status, where status is my
>>> choice field. it has 2 values, 'Unverified' and 'Verified'.
>>>
>>> class user_stutus(models.Model):
>>> status_choices=[('Unverified','Unverified'),('Verified','Verified')]
>>> uname=models.OneToOneField(User,on_delete=models.CASCADE)
>>> status=models.CharField(max_length=11,choices=status_choices,default
>>> ='Unverified')
>>>
>>> def verifyCode(request):
>>> global errors,session
>>> if request.method == 'POST':
>>> code = request.POST['code']
>>> user=User.objects.get(email=session['email'])
>>> print('user',user)
>>> print('request',session['email'])
>>> if session['code'] != code:
>>> errors['code'] = 'Verification code did not match!'
>>> return redirect('/user/user-verify/')
>>> verification = user_stutus.objects.get(username=user)
>>>
>>> *verification.status = 'Verified'#here i am changing its value and
>>> facing the issue.*
>>> return redirect('/user/user-login/')
>>>
>>> can someone give me any solution for this?
>>> Thank you!
>>>
>>>
>>>
>>> *DISCLAIMER*
>>>
>>> Any views or opinions presented in this email are solely those of the
>>> author and do not necessarily represent those of the Ganpat University.
>>>
>>>
>>>
>>>
>>>
>>> *DISCLAIMER*
>>>
>>> Any views or opinions presented in this email are solely those of the
>>> author and do not necessarily represent those of the Ganpat University.
>>>
>>>
>>>
>>> --
>>> 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/6ee9dae8-2879-4c3d-a921-238b36fcb975n%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/CAMVv_-E9uO8A7tJH04mHpkS-LeCwdJVKnMXtppZKkqp6JM2K5Q%40mail.gmail.com
>> 
>> .
>>
>
>
>
> *DISCLAIMER*
>
> Any views or opinions presented in this email are solely those of the
> author and do not necessarily represent those of the Ganpat University.
>
>
>
>
>
> *DISCLAIMER*
>
> Any views or opinions presented in this email are solely those of the
> author and do not necessarily represent those of the Ganpat University.
>
>
>
> --
> 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/CAK5JjLSs9yNckAOEw0ygcXMFTkZRTZmZwAp_tPVA2n81kPzY6Q%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/CAHRQUH%3Dsb9jK0WgPf2FOUR9KebUUrsrcagG7%3DkhqPMJ_Kk0x4w%40mail.gmail.com.


Re: group

2022-09-27 Thread Julio Cojom
This shit again, STOP IT.

El mar, 27 sept 2022 a las 9:29, Alfredo Yong ()
escribió:

> Please, me too...
>
> +51995070400
>
> On Tue, Sep 27, 2022 at 9:43 AM Giovanni Silva  wrote:
>
>> Please, add me too…
>>
>> +5531995321877
>>
>> Em 27 de set. de 2022, à(s) 02:27, Adetunde ADESUNBO ALAO <
>> adetundegbemil...@gmail.com> escreveu:
>>
>> Good morning,
>>
>> Please add me to the group +2347035729829.
>>
>> Thanks
>>
>> On Mon, 26 Sept 2022, 21:11 Thuc Dat Nguyen, 
>> wrote:
>>
>>> How much do you charge ?
>>>
>>> On Mon, Sep 26, 2022 at 12:49 PM yassin kamanyile 
>>> wrote:
>>>
 Add me +255763023477

 On Mon, 26 Sept 2022, 15:53 Abdulfarid Olakunle, 
 wrote:

> Hello fellow developers, I will be creating a WhatsApp group chat
> later in the day, So I will like my fellow Python Django Developers to 
> join
> the group. It will be much easier to discuss there and I will sacrifice
> myself out for anyone who need my service.
>
> God bless you all
> Enjoy your day
> Biliaminu
>

> --
> 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/CA%2BccuR0goa8Mu9MqNLyZtCAJedHKpVZ6pFfrpXKFJdjaRrgttQ%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/CAOyeOe9tKFCogEZv1NfTVVRMpFcXxayH9vp0JU3XYiFO4fYU%2Bw%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/CABkbZb%2B5f7EYZ-0JiMHiE4mp2NN2kREpKEAB%2BBk7W-Z9r548iw%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/CAEUJJqud1PPkn%2B6XXvis--dDKQZ%2Br6fk0B-YjF5rbUamki4DMA%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/78DCC0EF-7878-44D3-86D1-16856ACF354F%40gmail.com
>> 
>> .
>>
>
>
> --
> Alfredo Yong
> yoga & web
>
> --
> 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%2BJWZVuyFPAOzoLQcJ_SpEsvVh3fSL8TfcbnRE6JcpFBqH52g%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/CAHRQUH%3D5SQT4tAaSpgXu%2BzNBs%2BD9Od-gGTcG%2B_9WomwxrHxVCA%40mail.gmail.com.


Re: JSON files. How is it done?

2022-09-22 Thread Julio Cojom
Hi Matheus!

Try to use django-select2 it is easy to set up and works like a charm!

It has an advanced and easy implementation, so try first with the easy ones
and then if your project needs something heavier, you can refactor the code
with a simple couple of lines.

https://django-select2.readthedocs.io/en/latest/

Regards,

Julio Cojom

El jue, 22 sept 2022 a las 4:23, Matheus Bon ()
escribió:

> Hi!
>
> I'm lost in a question of my project, I see so many methods on the
> internet but none work for me (maybe I'm implementing it wrongly)
>
> But, I would like to know if you could give me a method to transform my
> model into a JSON file and then be able to retrieve these JSON files for me
> to put in an INPUT with a dropdown, using, for example, SELECT2.
>
> Thanks!
>
> --
> 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/d89cac37-fdb7-436d-8e67-3e848ff425b3n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d89cac37-fdb7-436d-8e67-3e848ff425b3n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUHmdjwLux9ok-WVOYFon59HhoFhyXEXbCg0kP9KBSuVpLA%40mail.gmail.com.


What do you do with large project and forms?

2022-08-30 Thread Julio Cojom
I have a large project and forms.py per app is bigger than I thought with
3k+ lines in each file, I'm looking for options to make a good scalation
structure, does anyone have experience with this? What do you do to
organize your forms in your projects?

-- 
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/CAHRQUHnd2zdPeaOmw2VzWhP2y1xN%3Dv2Z%2BQ%2B%2BsSw1B10AuxEnjA%40mail.gmail.com.


Re: Why do we need Django rest framework when our conventional django do what we want?

2022-07-31 Thread Julio Cojom
There are a couple of projects built in Django for this, for example
Django-Oscar or saleor(community version), the last one is a tech stack a
little bigger but really fast and customizable.

If you want to start one from scratch, be sure to check both projects as
they have good abstraction classes.

Regards



El El dom, 31 de jul. de 2022 a la(s) 16:02, Ram 
escribió:

> Hi,
>
> In my opinion if you are starting from scratch to develop your ecommerce
> application, I would encourage you to start with DRF, but if in case if you
> can not afford to write DRF APIs for an existing application, you might
> want to refer this:
>
>
> https://www.oneclickitsolution.com/blog/integrate-postgres-database-connection-in-flutter/
>
> Disclaimer: I can not give any guarantee on this article because we did
> not try this. In fact I would like to hear comments from other experts here
> about this article?
>
> Best regards,
> ~Ram
>
>
>
> On Sun, Jul 31, 2022 at 8:30 AM Lakshyaraj Dash <
> dashlakshyaraj2...@gmail.com> wrote:
>
>> You need drf aka DjangoRestFramework because it provides a smooth api for
>> your application. It comes into use whenever you're trying to have a
>> javascript framework like ReactJS or NextJS or Angular or VueJS etc... On
>> the client side. If you inject js framework in the frontend you also need a
>> package called django-cors-headers.
>>
>> You can also use drf with django if you don't have any js frameworks in
>> the client side. In this case you don't need a cors headers package.
>>
>> Thanks and Regards
>> Lakshyaraj Dash
>>
>> On Sun, Jul 31, 2022, 19:53 Joseph Bashorun 
>> wrote:
>>
>>>
>>> I am stuck in a loop of confusion. I am trying to build an ecommerce
>>> website and make it production ready. Do i need to build an API for it?
>>>
>>> --
>>> 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/e45680e6-7c40-4ff4-985b-6cdc31a59e29n%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/CAF7qQgCcfSxsJjbpgPUbW%2Bs1kUDB9VF2ES9QfzUrKrt%3DiYUhLg%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/CA%2BOi5F11sjbkoXN6PpQvHOknTCSbmyvG6Yis9aKJESzhOyuQNA%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/CAHRQUHk%2Bn4A%3DK-tBp3BcL86L3%3DRJgouMsDzQrQS-woiCzN_YOQ%40mail.gmail.com.


Re: DRF question

2022-07-20 Thread Julio Cojom
Hi Ram,

Aditional to all the suggestions, please keep in mind django-filters as
they are important to filter data in your api requests

Regards,

Julio Cojom

El mié, 20 jul 2022 a las 20:37, Michael Thomas (<
michael.thomas.s...@gmail.com>) escribió:

> There's no reason at all that DRF can't be used to do this. Just don't use
> a viewset, as it's not the right fit for this type of thing.
> Read through the code for how your current system works, then re-implement
> the relevant parts as DRF ApiView's.
>
> On Thu, Jul 21, 2022 at 8:43 AM Ram  wrote:
>
>> Thank you all for quick suggestions.
>>
>> We are stuck with implementing the first API, which is login endpoint.
>> That means since we already developed user registration functionality
>> before without DRF, there seems no way to create a login endpoint so that
>> an existing registered user can login using REST API and access his/her
>> respective data . All we are finding on the web is to create an Abstract
>> user using DRF which requires to change the existing user registration
>> implementation. So I'm wondering whether there is any way to remedify this
>> or are we missing something?
>>
>> Best regards,
>> ~Ram
>>
>>
>>
>> On Tue, Jul 19, 2022 at 6:30 PM Hella thor 
>> wrote:
>>
>>> Hi Ram
>>> 您可以在原来项目的基础上创建新的APP来单独给移动应用程序来使用,并在整体项目完成以后研究是不是需要DRF来兼容。
>>>
>>> Lalit Suthar  于2022年7月19日周二 19:04写道:
>>>
>>>> I would also suggest keeping Django views as it is and writing new
>>>> views for your APIs
>>>> maybe you can create another file named apiviews.py and then write new
>>>> APIs with help of your present views
>>>> refer: https://www.django-rest-framework.org/api-guide/views/
>>>>
>>>> On Tue, 19 Jul 2022 at 06:38, Nikhil Chawla 
>>>> wrote:
>>>>
>>>>> Don't clutter the django views with DRF requests. Keep them separate,
>>>>> available at, say `api` endpoints.
>>>>>
>>>>> On Tue, 19 Jul 2022, 06:17 Michael Thomas, <
>>>>> michael.thomas.s...@gmail.com> wrote:
>>>>>
>>>>>> Hey Ram,
>>>>>>
>>>>>> I'm afraid no one can answer your questions without knowing your
>>>>>> code, how it works, or anything else...
>>>>>>
>>>>>> Broadly speaking, here's how we approached a similar scenario:
>>>>>>
>>>>>> 1) Created one or more Serializer for each model that required
>>>>>> interaction via API. Some models required more than one, as they were
>>>>>> either too large for list() operations, or required a simpler
>>>>>> representation when nested into another Serializer, etc..
>>>>>> 2) Created custom permissions to check if users were allowed to
>>>>>> perform the action(s) they were trying to make
>>>>>> 3) Created ViewSets using the permissions and serializers mentioned
>>>>>> above, as well as any additional actions that didn't fit within the 
>>>>>> normal
>>>>>> REST verbs
>>>>>> 4) Created a router and registered the viewsets with it
>>>>>> 5) Added the router's urls into the projects url configuration
>>>>>>
>>>>>> I hope that's useful :)
>>>>>>
>>>>>> Kind Regards,
>>>>>> Michael Thomas
>>>>>>
>>>>>> On Tue, Jul 19, 2022 at 7:21 AM Ram  wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> We completed coding all the features without DRF for our web site
>>>>>>> and now we are planning to develop a mobile app for the same website by
>>>>>>> keeping the web site as it is and develop a mobile app using Flutter.
>>>>>>>
>>>>>>> Based on our understanding, we have do the following in the current
>>>>>>> code for adding REST APIs
>>>>>>>
>>>>>>>
>>>>>>>1. We have to create serializers.py for each model in each App
>>>>>>>that we have
>>>>>>>2. We need to add a few lines of code in views.py
>>>>>>>3. We think we don't have to modify the UI template by using
>>>>>>>json response from DRF ( Is this really necessary because we are not
>>>&

Re: Best digital ocean plan for a production server

2022-07-11 Thread Julio Cojom
Hi Ram,

I started with a simple VPS, 5$ monthly, it has a MySQL instance and 5 or 7
Django apps. After that MySQL started caching a lot of ram for the small
VPS so I moved the SQL instance to another 5$ VPS and left the web/apps
server alone, they are connected through the internal IP.

Also, I created a couple of scripts to pull the GitHub repository, and set
up a new app (database, Nginx host, etc) whenever I need that.

You can create Django docker apps and manage all from docker / Kubernetes
but in my case isn't necessary.

Digital Ocean is cheap and very profitable if your customers don't use a
lot of resources, with time you can upgrade your VPS with a couple of
clicks.
You need to get used to the terminal to use ssh. Also, there is a couple of
things that don't work in the same way in Linux / windows, like paths for
example. I used windows a lot of time for development before so I learned
that a hard way

Regards,

Julio Cojom





El sáb, 9 jul 2022 a las 21:20, Ram () escribió:

> Hi,
>
> We are planning to launch our application in production once all the
> testing is completed after deployment to our development server. We are
> using Jenkins CI automation to deploy the code to the development server
> and we will do the same in production server too, but we are currently
> doing a feasibility study to understand which options are good for Django
> web application for both Web and Mobile app.
>
> If anyone in this Django users community is currently on any Digital
> Ocean's production server plan, could you share some details and
> suggestions.
>
> Best regards,
> ~Ram
>
> --
> 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/CA%2BOi5F0Chdi6d6b5x5CtW_pDphwyegA7m4kLofGkCoZiDk_32A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BOi5F0Chdi6d6b5x5CtW_pDphwyegA7m4kLofGkCoZiDk_32A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUH%3D4xkhPauCciTa_4%2BQ3uq8kiqrUSqwmPuoRdR-dAcukmA%40mail.gmail.com.


Re: its urgent...

2022-06-17 Thread Julio Cojom
You can try with rpa framework, for rpa, is better if you use xpath

Regards

El El vie, 17 de jun. de 2022 a la(s) 11:10, Abhinandan K <
abhinan...@snakescript.com> escribió:

> is anybody know how to scrap all businesses from google maps and save into
> csv with selenium and whenever search that business it gave result of
> that business...
> also its important to me that how generate google maps api without
> billing...
>
> --
> 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/CAA6_Mp6QVZAY75%3DMHEugVpH5HBGBiGdyNyDf7QfkdiA1SHU39Q%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/CAHRQUHm%2BeLWqo6cUh6oMhAZ11e4Xv92zPRiKOH50yPV7agms7g%40mail.gmail.com.


Re: SMTP Authentification error

2022-04-27 Thread Julio Cojom
Seem pretty clear, you are calling db user and db password instead of email
and email password,

*EMAIL_HOST_USER = os.environ.get('DB_USER')*
*EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*

Regards,

Julio Cojom

El mar, 26 abr 2022 a las 23:38, 'Delvin Alexander' via Django users (<
django-users@googlegroups.com>) escribió:

> Hello everyone,
>
> May you please assist in informing me on what i need to do to resolve this
> issue.
>
> - *SMTPAuthenticationError at /password-reset/*
> *- (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8
> https://support.google.com/mail/?p=BadCredentials
> <https://support.google.com/mail/?p=BadCredentials>
> j64-20020a62c54300b0050d260c0ea8sm13366402pfg.110 - gsmtp')*
>
>
> I included the 16 character code to my environment variable and called it
> in my settings.pymfile,  but still the error occurs. Also here is my
> settings.py file:
>
> - *EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'*
> *EMAIL_HOST = 'smtp.gmail.com <http://smtp.gmail.com>'*
> *EMAIL_PORT = 587*
> *EMAIL_USE_TLS = True*
> *EMAIL_HOST_USER = os.environ.get('DB_USER')*
> *EMAIL_HOST_PASSWORD = os.environ.get('DB_PASSWORD')*
>
> --
> 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/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c18935a8-43bf-4a15-a5ba-95209009498dn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUHnKsmr9sBcM%3DLcg38D%2B%2B2icxN%3D-Yhs8p%2BJYfs3xmTG4wA%40mail.gmail.com.


Re: request.POST.getlist('xxx') only has one value in ajax request for many2many

2022-01-17 Thread Julio Cojom
I remember having a problem like that once, in your views print the hole
dictionary "print(request.POST)", you should see all the values of the
field you want as list, not just one.

Then instead of getlist try just get, request.POST.get('field_here')

Let me know how it goes

El lun., 17 de enero de 2022 11:52 a. m., Campbell McKilligan <
campb...@dxclabs.com> escribió:

> Yeah - I am looping.  I just get one iteration which is the last item even
> though the request body has the same key repeated.
>
> For example, this code only prints one item, whereas for a different form
> elsewhere, it would iterate through all the identical keys:
>print(self.request.__dict__)
>   for pool in self.request.POST.getlist('pool_list'):
>   print(f"form pool_list item: {pool}")
>
> The main difference to when it works is that this form is submitted via
> ajax; and uses UpdateView.
>
> On Monday, 17 January 2022 at 01:34:18 UTC Jason wrote:
>
>> https://code.djangoproject.com/ticket/1130
>>
>> Essentially, this is expected behavior, and previous comment is correct.
>> Need to loop through the items in the list
>>
>> On Sunday, January 16, 2022 at 5:42:45 PM UTC-5 richy...@gmail.com wrote:
>>
>>> You might want to loop through the list
>>> Example:
>>> Lists = request.getlist('item')
>>> For list in Lists:
>>> .
>>>
>>>
>>> On Sun, Jan 16, 2022, 9:30 PM Campbell McKilligan 
>>> wrote:
>>>
 Hi,

 Using Django 3.2 and Py 3.9

 I have an ajax request which submits multiple values for a field to an
 UpdateView.

 In the request dict body I see both values (in this case, for the
 pool_list column):

 '_body':
 b"csrfmiddlewaretoken=z...h&...=..._datetime==555&
 *pool_list=507_list=499*&...

 Later in the request dict, I only see one of the values in the _post:
 '_post': * 'pool_list': ['499'],*

 This means that in request.POST.getlist('pool_list'), I'm only getting
 one result in the list object.

 Any idea why it's only the last value being populated in the getlist?

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/bf3a5e3b-4e8c-4a73-8647-d494bedbdf90n%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/6fc15142-4650-4bac-a3f9-efd411f3813an%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/CAHRQUHmdG15CO6b7hh5JFyGLZytm11wPsQC-j-V_jRqpakaywA%40mail.gmail.com.


Re: How to delete user salary record , but want to keep history till deleted date

2022-01-07 Thread Julio Cojom
As Pankaj mentioned, add a field in your model called status or something
like that. On the makemigrations set all status as 'Active'

Then, your function will not delete, will update the object.

def delete(request,id):
employee=Employee.objects.get(id=id)
employee.status = 'Inactive'
return redirect('/home1')

in your listview, you should only show active records, for that add an
exclude to the queryset.

queryset = Model.objects.exclude(status='Inactive')

or with a filter

queryset = Model.objects.filter(status='Active')


If you want to use delete, I've used before django-simple-history. the
package records all history for models and objects and let you query that
information.


Regards,

Julio Cojom.




El vie., 7 de enero de 2022 9:48 a. m., Feroz Ahmed 
escribió:

> Hi, Pankaj
> thanks for the tips!
>
> i try all the way,
> it not success , any syntax please.
> mean time i success to delete the record code as below: (but i just want
> to inactive the record of particular employee) history might need for audit
> purpose.
>
> def delete(request,id):
> employee=Employee.objects.get(id=id)
> employee.delete()
> return redirect('/home1')
>
> Regards
>
>
>
> On Friday, January 7, 2022 at 7:29:18 PM UTC+5:30 pankajpal...@gmail.com
> wrote:
>
>> Then simply make that records inactive by adding one flag in table and
>> instead of deleting make It inactive
>>
>> On Fri, 7 Jan, 2022, 7:22 pm Feroz Ahmed,  wrote:
>>
>>> Hi,
>>> How to delete user salary record , but want to keep history till deleted
>>> date.
>>>
>>> ex:
>>>
>>>1. Month June
>>>2. Month July
>>>3. Month Aug
>>>4. delete user record from Sep.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f2ba2f5f-ed12-45e5-8d2a-d2b1b2590154n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f2ba2f5f-ed12-45e5-8d2a-d2b1b2590154n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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/7ebc8721-d3c1-4f2b-8c18-384820a8483fn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7ebc8721-d3c1-4f2b-8c18-384820a8483fn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUHkcR3tbfrnZM_kQdCEq4Q_E3Rb1%3DOycXp3X28Ay0rWgNw%40mail.gmail.com.


Re: translat using oscar framework

2022-01-05 Thread Julio Cojom
Hi,

You need to understand what are you doing,

Oscar documentation put it really simple.

First create a directory inside your project called i18n and locale

Then create a symbolic link to Oscar package so manage.py makemessages can
find translatable strings.

For the last step, you need to locate where Django Oscar is inside your
hard drive.

One simple way to find python directory is opening a PowerShell or cmd and
opening the python console.

import os
import sys
os.path.dirname(sys.executable)

That gives you the python executable files path.

After navigate to it, go to Lib->site-packages

There you will find all the libraries installed, including django-oscar

Once you have all the data, open a PowerShell or cmd and make the symbolic
link, in windows you can use a shortcut just using right click -> create a
shortcut, then renaming the shortcut and placing it where documentation
mention.

Last, run manage.py makemessages with the flags you need.

Remember, you're dealing with python not with Django as programming
language.

If you don't have idea of what I'm writing, start with a simpler project.

Regards

Julio Cojom


El mié., 5 de enero de 2022 3:14 p. m., frank lucky <
friendzone2...@gmail.com> escribió:

> hi thanks for you time i  use this
>
> mklink /d %PATH_TO_OSCAR/oscar
> but i get this error (oscar) PS C:\Users\faramarz\Desktop\uniqemug-os>
> mklink /d %PATH_TO_OSCAR/oscar
> mklink : The term 'mklink' is not recognized as the name of a cmdlet,
> function, script file, or operable program. Check the spelling of
> the name, or if a path was included, verify that the path is correct and
> try again.
> At line:1 char:1
> + mklink /d %PATH_TO_OSCAR/oscar
> + ~~
> + CategoryInfo  : ObjectNotFound: (mklink:String) [],
> CommandNotFoundException
> + FullyQualifiedErrorId : CommandNotFoundException
>
> On Tuesday, January 4, 2022 at 8:24:30 PM UTC+3:30 Kasper Laudrup wrote:
>
>> On 04/01/2022 09.50, frank lucky wrote:
>> >
>> > mkdir locale i18n
>> > ln -s $PATH_TO_OSCAR i18n/oscar
>> > ./manage.py makemessages --symlinks --locale=de
>> >
>> > how i do it in windows  i make  local and i18n forlder in root of
>> > peoject but
>> > secound line not working
>> >
>>
>> First of all, it is much easier for someone to help you if you describe
>> the errors you are getting instead of simply writing "not working" and
>> expect people to guess what that might mean.
>>
>> It is quite easy to see the issues with that line. In Windows
>> environment variables, at least in cmd.exe, are accessed with % instead
>> of $ so you need to change that to %PATH_TO_OSCAR. Of course, that
>> assumes that you actually have that variable in your environment somehow.
>>
>> Also, Windows hasn't support symbolic links historically but since
>> Windows 2000 or so it should be possible to use the "mklink" command
>> instead of the "ln" Unix command:
>>
>>
>> https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink
>>
>> Not sure it will work though and in general I would really recommend
>> using pretty much anything other than Windows. It will save you from
>> tons and tons of frustrations.
>>
>> Kind regards.
>>
>> Kasper Laudrup
>>
> --
> 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/4a80758e-d6e9-4c4a-a4fc-043e31cb2c6cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4a80758e-d6e9-4c4a-a4fc-043e31cb2c6cn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUHnmbB-c_EDMdmobKi1c8syXhAb0i0%3DE1iu_fgffprRXyA%40mail.gmail.com.


Re: Employee matching query does not exist

2022-01-05 Thread Julio Cojom
Hi,

Try the following.

employee =self.request.POST.get('employee_id')
print(employee)
obj.employee= Employee.objects.filter(name=employee)

It will crash again, but you can see in the console if it's printing the id
correctly.

I've assume this is a function, not a class view by the way that you are
handling the query set. And I believe with the poor information that you
give us, that the 'employee_id' isn't the right keyword to get the value
desired.

Usually you can use the name in your models to refer to the field that you
want the data. If you want the primary key, you should use pk of an
existing record in the database.

Also you can print self.request.POST to see all the data that I has, that
is a dictionary so you can see they keyword you need and the data in brings.

Regards.

Julio Cojom.






El mié., 5 de enero de 2022 7:53 a. m., Rey Ondiyo 
escribió:

> Django don't saw a employe who have this ID
>  so you can use filter if there's not matching in your database he return
> [ ].
>
> obj.employee=
> Employee.objects.filter(name=self.request.POST.get('employee_id'))
>
> Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :
>
>> name column row's data not matching from database
>>
>> Show that you are getting error .
>>
>>
>> So we use the Expection then you can easily handle the error ..
>>
>> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>>
>>> please team ..i  got an error from that line below
>>>
>>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>>> 'employee_id'))
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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/7e08fe8e-bd4e-4779-be29-79d5453ea116n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7e08fe8e-bd4e-4779-be29-79d5453ea116n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHRQUH%3D_46u4BugGaX4qaLTOCjsfQA830a6wES8tWFOrALMv_Q%40mail.gmail.com.


Re: django-oscar customisation

2021-12-09 Thread Julio Cojom
You need to fork the app and create a similar protect structure inside your
forked app, then you can start customizing.

Django Oscar isn't an easy way to start with Django



El jue., 9 de diciembre de 2021 8:46 p. m., Ryan Nowakowski <
r...@fattuba.com> escribió:

> Try running the sandbox application:
>
> https://django-oscar.readthedocs.io/en/stable/internals/sandbox.html
>
> Then you can poke around that sandbox code and see how they did things.
>
>
>
> On November 22, 2021 2:23:28 AM CST, "Hervé Edorh" 
> wrote:
>>
>> Hi,
>> I am new to django-oscar and i try to understand the structure of oscar.
>> i have read many times the documentation but i think there is something i
>> don't understand.
>> I fork the template and customise the layout.html, base.html. but how can
>> i build my own first page, i don't see an index.html...
>>
>> --
> 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/A71134F3-1FAA-4759-AF4C-E3887F45E1CC%40fattuba.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/CAHRQUHkMS9JkmHR0RVRWi230WVZDj%2BYYoh_MgJ98BnVQd-AJ%3DQ%40mail.gmail.com.


Re: No reverse match at /

2021-07-06 Thread Julio Cojom
For what I can see in the issue, you're passing 2 values to the url (id ,
topic)

Maybe the error its for the topic because of the value (/Subject/Django)
try to sanitize the value after store it in the database, because it try to
get the url example.com/3//Subject/Django where 3 its the id or pk and
/Subject/Django its the topic, for the web server it may be confusing. You
can sanitize the value for something like slug field (django slug field docs
). Even
better, I suggest add slug field to the model and leave the topic off the
url.

Regards

El mar, 6 jul 2021 a las 7:12, DJANGO DEVELOPER ()
escribió:

> you have to provide id in your urls and in subject.html as well. share you
> views and url as well.
>
>
> On Tue, Jul 6, 2021 at 6:08 PM Bhanu prasad Ch 
> wrote:
>
>> I had a problem in passing special characters in Charfield in DB of
>> Django.
>> Is that possible to pass special characters in CharField DB?
>> GitHub Issue 
>>
>> --
>> 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/b57636e3-35c4-4798-abe3-b6f97576a53fn%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/CAKPY9p%3DeBKaDSk8PsnmHXaPAmM9rbPhrvpyc6om85QPV7vXxyg%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/CAHRQUH%3DFea-RkH4xanb%3DL_dVNk3%3DWj44Gfdnb0iXx34c1dWZ4g%40mail.gmail.com.


Re: SChedule email

2021-07-01 Thread Julio Cojom
I remember a python library called django-cron, it's stable in Linux
environments

El jue., 1 de julio de 2021 6:54 a. m., divya murugulla <
divyamurugu...@gmail.com> escribió:

> 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/ba849b82-e054-45a8-ae1e-e67cde6b23b5n%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/CAHRQUHkCkp1hR2LGu6H16y3%2BQ-Moah47Z-cYFXmY-JijPLY-iw%40mail.gmail.com.


Re: Hi django

2021-06-24 Thread Julio Cojom
Django framework uses urls to math the html files. This work with the same
syntax of static files, you would use {% url 'app:viewname' %} to render
any page with Django.

You should check the docs of urls to understand how it works and get this
done.

Regards

El jue., 24 de junio de 2021 9:00 a. m., Richard Dushime <
mudaherar...@gmail.com> escribió:

> i have a problem on my navigation bar on the index.html link when i click
> on it its showing me the error (see error.png)  or everything apart that
> its working fine  need ur help
>  "{% static 'assets/img/hero-logo.png' %}" alt="">
>   
>   alt="" class="img-fluid">
>   
>
>   
> 
>   Home
>   About
> 
>   About Us
>   Team
> 
>   
>   Services
>
>"{% static 'assets/img/logo.png' %}" alt="" class="img-fluid">
>
>   Portfolio
>   Pricing
>   Contact
>
> 
>   
>
>
> --
> 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/CAJCm56L%2BG%3D8tLZ%3D3sZ0%3Dh%3Ds-w5AXaLroU3nkgoKZO6Fj8xqFBw%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/CAHRQUHmOdq-yXfQdkDRcvjdf727U1Wr1HogjVpP1bw0o7rN61w%40mail.gmail.com.


Re: Deploy Django app using cpanel

2021-06-23 Thread Julio Cojom
cPanel it's a pain to deploy python applications, better change to a vps
with digitalocean or something similar.



El mié., 23 de junio de 2021 11:37 a. m., Franck Tchouanga <
ftchoua...@gmail.com> escribió:

> I see.
>
> On Wed, Jun 23, 2021, 11:38 AM Eugene TUYIZERE 
> wrote:
>
>> Dear Franck,
>>
>> The problem I have now is to configure the django app in cpanel so that
>> users can browse it. As I said in previous email, I already have domain and
>> cpanel credentials.
>>
>> On Wed, 23 Jun 2021 at 12:17, Franck Tchouanga 
>> wrote:
>>
>>> Hello I can assist you what is the problem.
>>>
>>>
>>> On Wed, Jun 23, 2021 at 9:54 AM Eugene TUYIZERE <
>>> eugenetuyiz...@gmail.com> wrote:
>>>
 please assist

 On Tue, 22 Jun 2021 at 13:03, Eugene TUYIZERE 
 wrote:

> Dear Team,
>
> I have an issue. I want to make my app productive. I bought a domain
> and I got cpanel credentials. The problem I have now is that I do not know
> how I can configure the app in cpanel so that users can start browsing it.
> I tried to connect to the database and I loaded the application files. Is
> there someone who can tell me all the steps I need to follow to make the
> app accessible? for what I have done, I am getting this error message when
> browsing:
> [image: image.png]
>
> Please assist
>
> --
> *Eugene*
>
>
>

 --
 *TUYIZERE Eugene*



 *Msc Degree in Mathematical Science*

 *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
 Garden-Lime, Cameroon*

 Bsc in Computer Science

 *UR-Nyagatare Campus*

 Email: eugene.tuyiz...@aims-cameroon.org
eugenetuyiz...@gmail.com

 Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

 --
 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/CABxpZHt5TP8LK%2ByELRcC0sZwJ4WUTw7_PAp7%3DpsS%3DKTnG8zRNw%40mail.gmail.com
 
 .

>>>
>>>
>>> --
>>> Best Wishes
>>>
>>> *Mr Tchouanga*
>>>
>>> --
>>> 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/CANRJ%3D3%3DHnyVQfMmCGpZk-cMLhZZQvqp4EHxjdh-3itcoPnFUPA%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> *TUYIZERE Eugene*
>>
>>
>>
>> *Msc Degree in Mathematical Science*
>>
>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal
>> Garden-Lime, Cameroon*
>>
>> Bsc in Computer Science
>>
>> *UR-Nyagatare Campus*
>>
>> Email: eugene.tuyiz...@aims-cameroon.org
>>eugenetuyiz...@gmail.com
>>
>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>
>> --
>> 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/CABxpZHs4G05MtjQOyfrf2H4ZQfCWS63oxG4hFYXpCx4VYTzrpg%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/CANRJ%3D3nu5HTfT4b0cqJACAwHsFCWTuS-Pz_H2vZz4t4jtNCs%2Bg%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/CAHRQUHnLX%2BArn1yW_dCfdVh3qyKKm4WLfc0D%3DYLsrB7jJ5g6Zg%40mail.gmail.com.


Re: Desperately need help.

2021-06-15 Thread Julio Cojom
Pretty easy to be honest. The web page need an http response and it's give
none instead. :)


If you don't know about the code, maybe you should hire a developer or
learn by yourself.

El mar., 15 de junio de 2021 3:14 p. m., Ken Smith 
escribió:

> There is the issue to solve that is the result of pressing the button to
> complete your transaction. And it may be dumb because I don't know a damn
> thing about  django and I assume that I would get an intelligent response
> on this forum.  This was in fact a sincere request because I know nothing
> about this code. If I did I would've discovered it myself. I merely had the
> stupid assumption that someone would actually consider this a challenge.
> But apparently not even your up to a challenge maybe it's too hard for you.
> That is coded in django as I understand I may be wrong. I only read what
> was presented on the error page. If it's not that would you please direct
> me to what code it could possibly be as I am not a coder in any way shape
> or form. I stopped even trying long before these new methods of coding came
> out. I think the last time I tried to write code was in the 1990s. I know
> there is a solution to my question I just hope there is someone with the
> intelligence to take on the challenge for me or at least direct me to where
> I need to go instead of making jokes. Perhaps someone can tell me something
> about where I need to go or what I need to do there is a lot of money
> involved in getting this code correct so that I can send the corrected
> information to the company who owns the webpage. Not everybody here knows
> how to code some of us are actually wanting some answers to questions that
> we have. I am by trade an aircraft mechanic. So I can laugh at you if I
> asked you to go clean the air sock and you don't even know what I'm talking
> about but I won't because you don't know what I'm talking about. Neither do
> I know anything about what I presented and I don't pretend to know that's
> why I asked for some intelligent information. Have a good day regards Ken
> On Monday, June 14, 2021 at 5:21:42 PM UTC-4 jacobgr...@gmail.com wrote:
>
>> Lol what do you expect anyone to do? You just post some random HTML, zero
>> code, no backtrace, nothing to even indicate there is an issue that someone
>> could solve even IF they were willing... This has nothing to do with
>> Django. I don't understand what you thought was going to happen. This is
>> possibly the dumbest "question" I have ever read. I'd be willing to consult
>> at double my normal hourly rate if you are the point of contact.
>>
>> On Mon, Jun 14, 2021 at 12:12 PM Kasper Laudrup 
>> wrote:
>>
>>> On 14/06/2021 05.15, Ken Smith wrote:
>>> > I sure hope that somebody can take the time to do this. I'm just
>>> > wondering one of you brilliant programmers can look at this webpage and
>>> > tell me where the errors are so that it can be fixed? Apparently the
>>> > programmers at the website are not as smart as you people are. If
>>> > someone has the time and inclination to do so with a please go over the
>>> > code and highlight where the errors are in the corrections necessary in
>>> > send back to me in a file in response. I would greatly be so happy.
>>> > Thank you and have a wonderful day.
>>> >
>>>
>>> Instead of wasting space on meaningless flattering of the very diverse
>>> members of this list/forum and begin rude to the developers at
>>> safewayfx.com you would have a much better chance of getting help if you
>>> instead showed that you were willing to do at least a minimal effort
>>> yourself.
>>>
>>> What errors are you talking about and what have you done to try and
>>> solve them?
>>>
>>> Just attaching and HTML file and expecting people to fix errors you
>>> cannot even bother to point out is not gonna get you much positive
>>> feedback.
>>>
>>> Also, how is this related to Django at all?
>>>
>>> Finally, are you sure that safewayfx.com is OK with you sharing their
>>> copyrighted works without their acceptance?
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/c3fe4ad7-ef75-2441-b848-427bce52814b%40stacktrace.dk
>>> .
>>>
>> --
> 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/a4a501a6-684d-479f-b618-cd83cdc8b5ccn%40googlegroups.com
> 
> .

Re: pass a parameter into sql raw string and execute django

2020-12-19 Thread Julio Cojom
Hello

First, create a query.py , just for order.

[image: image.png]

and declare a function with the parameters you want to receive.

Then, in your views.py
[image: image.png]


you need to import connection from django.db

finally , you can iterate over the rows fetched with one for loop.

[image: image.png]

You have to validate the input in your sql to avoid sql injection, the
documentation tell something about it django documentation



regards.

El sáb, 19 dic 2020 a las 10:21, Ronald Kamulegeya (<
ronald.kamulegeya.2...@gmail.com>) escribió:

> I want to pass parameter in view and i execute the insert query as shown
> below.
>
> I have searched and failed to get a solution.
>
> Any hints.
>
> Here is the code. My attempt is shown but not correct.
>
> def post_payroll(request,p_id):
> p_id=2
> with connection.cursor() as cursor:
> query = "insert into
> payroll_payrolltemp(ndays,sdays,ot1hr,ot2hr,advance,bonus,penalty,post_status,worker_id,payperiod_id)"
> "select 0,0,0,0,0,0,0,0,sw.id,"
> str(p_id) +" as payperiod_id from staff_worker as sw"
> "where   sw.id in (select  w.worker_id from staff_workerpay as w
> where w .pay_frequency_id=1) order by sw.id"
>
> cursor.execute(query)
>
> --
> 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/fe44ecbd-2555-4826-98e8-038212730a74n%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/CAHRQUHmUs73ywZWKYgt2UT-kEZ17%3DRM_83UAyn0E-7ioMf2SJQ%40mail.gmail.com.


Re: MultiValueDictKeyError at

2020-09-23 Thread Julio Cojom
Readonly field and disbled field never send on form post.

You should workaround this, for example,  with a css class.

.disabledfield{
pointer-events: none;
opacity: 0.4;
}

or enabling with js on send click.

Regards.

El mié., 23 sept. 2020 a las 13:20, coolguy ()
escribió:

> please share the views.py and template i.e. xxx.html.  i'ts not possible
> to tell what's wrong with the provided information
>
> On Wednesday, September 23, 2020 at 11:43:36 AM UTC-4
> luca72.b...@gmail.com wrote:
>
>> Hello i have this problem :
>> MultiValueDictKeyError at
>> The view is:
>> matricola = request.POST['matricola']
>>
>> The form is:
>>
>> matricola = forms.CharField(label='Matricola',  required = False,
>> max_length=100, widget = forms.TextInput(attrs={'readonly':'readonly'}))
>>
>> the template is
>>
>> {{ form }}
>>
>> Why i get this 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, 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/9287bb2a-84a2-42ba-87a7-40344f75ecdcn%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/CAHRQUHkXpM5QO63S%3DG587UiJ0pmtoR%2BbuXH0BUs5OqYL%3DVm36w%40mail.gmail.com.


Re: NGINX + GUNICORN

2020-09-11 Thread Julio Cojom
It depends, some people use virtualenvs, so you need to install gunicorn in
each project.

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

this might help, just change dependencies install to fit your os.

In my case, I deploy multiple projects with the same python and
dependencies install without virtualenv and made a little script, need
improvement but it's enough to pull some project from a repo and install
the app.

It take 3 params, repository, db name and domain name.
db name equals to project name in my case.







El vie., 11 sept. 2020 a las 4:44, Kasper Laudrup ()
escribió:

> Hi Giovanni,
>
> On 11/09/2020 12.24, Giovanni Silva wrote:
> > No...
> > I want to access www.aidacomunicacao.com.br
> >  and I hope see the django webpage
> >
>
> Then don't listen on port 81, but use the default port 80 for
> non-encrypted HTTP traffic.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/9b32d1a8-b947-6b48-0e93-aab3dae8470a%40stacktrace.dk
> .
>

-- 
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/CAHRQUHni7xh79yr0k4TJRCxRmtkLMgf7Xv57ktKB%2BsFL0WOqxw%40mail.gmail.com.
#!/bin/bash

#1. clone repo and cd

cd /home/user/
git clone $1
REPO=$1
FOLDER=${REPO%.*}
FOLDER=${FOLDER##*/}

cd $FOLDER

# crea .env
#improve to make random str to secret key
cat > /home/user/$FOLDER/.env << EOL
SECRET_KEY=some_secreat_key
ALLOWED_HOSTS=localhost,$3, www.$3
DEBUG=True
DB_NAME=$2
DB_USER=$2
HOST=some_host
PORT=some port
DB_PASSWORD=some_password
PRODUCTION=True
EOL

#asigna permisos a la carpeta de la app
cd ..
chown -R user:user $FOLDER

#Creación de socket
cat > /etc/systemd/system/gunicorn_$2.socket << EOL
[Unit]
Description=$2 socket"

[Socket]
ListenStream=/run/gunicorn_$2.sock

[Install]
WantedBy=sockets.target
EOL

APP=${FOLDER//-/_}

#creación de servicio
cat > /etc/systemd/system/gunicorn_$2.service << EOL
[Unit]
Description=$2 daemon
Requires=gunicorn_$2.socket
After=network.target

[Service]
User=user
Group=www-data
WorkingDirectory=/home/user/$FOLDER
ExecStart=/usr/local/bin/gunicorn --access-logfile - --workers 3 --bind 
unix:/run/gunicorn_$2.sock $APP.wsgi:application
[Install]
WantedBy=multi-user.target
EOL

#inicia y habilita el servicio
systemctl daemon-reload
systemctl stop gunicorn_$2.socket
systemctl start gunicorn_$2.socket
systemctl daemon-reload
systemctl enable gunicorn_$2.socket

#habilita salida http
#bad practice, shoud ln to www/var/html and nginx go to www/var/html inestead 
of home/user/proyect
cat > /etc/nginx/sites-available/$3 << EOL
server {
server_name $3 www.$3;
location = /favicon.ico { access_log off; log_not_found off; }

location /staticfiles/ {
root /home/user/$FOLDER;
}
location /media/ {
root /home/user/$FOLDER;
}

location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn_$2.sock;
}
}
EOL


ln -s /etc/nginx/sites-available/$3 /etc/nginx/sites-enabled

nginx -t

systemctl restart nginx

certbot --nginx -d $3 -d www.$3



Re: ERROR

2020-08-09 Thread Julio Cojom
It is js error, show the script part. It seems like you referenced a
variable before declare it.

On Sun, Aug 9, 2020, 8:50 AM Yemin Sajid  wrote:

> I think the error is from the frontend javascript code. Can u share
> snippets of that code?
>
> On Sun, Aug 9, 2020 at 8:30 AM Kovy Jacob  wrote:
>
>> Are you switching into your projects directory and then using 'python
>> manage.py runserver' from command prompt/terminal to run your website?
>>
>> On Sat, Aug 8, 2020 at 4:25 PM Agoua David  wrote:
>>
>>> Can you send a screenshot of the view file
>>>
>>> Le sam. 8 août 2020 à 20:21, traore arouna  a
>>> écrit :
>>>
 Hello
 I am here because I am developing an e-commerce application.
 But at a certain level of my code when I run my server with the command
 python manage runserver
 I have an error message
 Uncaught ReferenceError: info is not defined

 --
 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/2fdbf0c6-5f2e-4120-a524-6f3171c50389o%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/CAByCr6gT6SJ1EHyDMTGKb6Q73rbRJXWnd7XbgOeq7WE%2BLU3sAg%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/CACMwF3U_6LtFunxAm%2BoSjPFuAYyFGQ7QsgctyigqJXCathe8Lw%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/CAFzgvyEGOxaYRrpXiW0iPOjdy1tm9LNe1ZOVT7jTkXT56mHh0A%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/CAHRQUHkW8h-3eO29NdpSGGW9T1vV2heEgO1F2UNEa7Y%3DLmVbmg%40mail.gmail.com.


Re: Need to build a functionalty:- File Explorer like sFTPClient/Filezilla (Preferred lang- python with Django) in web application to access file system of any server with any OS

2020-08-02 Thread Julio Cojom
This is a frontend job, I searched this a time ago and in the search, there
are some tutorials with JavaScript frameworks like angular or Vue.

https://medium.com/js-dojo/how-to-build-a-file-manager-storage-web-app-with-django-rest-framework-and-vue-js-e89a83318e9c

On Sun, Aug 2, 2020, 10:34 AM Vishnu Bhandari 
wrote:

> HI Kasper,
> Its an organisation project. I am expecting some leads to initiate this
> project. Like which library can be used for this.
>
> On Sun, Aug 2, 2020 at 10:00 PM Kasper Laudrup 
> wrote:
>
>> Hi Vishnu,
>>
>> If you're looking to hire someone to create this project for you, you
>> would probably have a better chance of getting some responses if you
>> include things like how much your willing to pay, which kind of
>> experience your looking for, how long you've expecting someone to work
>> on this etc.
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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/755eb573-cccb-f979-dec2-a36967f40332%40stacktrace.dk
>> .
>>
> --
> 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/CALeETXJy-VKj6KaqmO%3DsvE4EBteXCq5qtviOQj3Spz00F3imXQ%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/CAHRQUHn87jcWL9KF0MA9FtY1o0OSHhrG1pNPXVg%2B8jAnP5DGcQ%40mail.gmail.com.


Re: Custom-DRF-Response

2020-07-04 Thread Julio Cojom
How is your model and your serializer?

El sáb., 4 jul. 2020 a las 6:00, Ronaldo Mata ()
escribió:

> Thx for your answer. 
>
> but this brings me to the second point. If I do that I must to rewrite all
> method in my API Class Based Views to response with this format. I think
> that is not the best way to deal with this problem. What do you think?
>
> El sáb., 4 jul. 2020 a las 7:53, Arpana Mehta ()
> escribió:
>
>> You can use a function which
>>
>> returns Response({'status': 'SUCCESS'})
>>
>> On Sat, 4 Jul 2020, 03:24 Ronaldo Mata,  wrote:
>>
>>> Hi Guys
>>>
>>> Somebody can help me?
>>>
>>> I want to create a custom response with the follow format:
>>>
>>> {
>>>   "status": true,
>>>   "message": "Any message",
>>>   "data": []}
>>>
>>>
>>> but I don't want create a custom_response function because I must to
>>> modified all Api class based views response. What is the best way to deal
>>> with this?
>>>
>>> --
>>> 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/CAP%3DoziQW9yHM74Pyc2bYzik0RJFQua1-qWNuE%2B%2B4OU%2BGoutRZA%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/CAGyqUuVGdobfwZgwmUsWj94YWimTNwhE0aYmi9seZAYU7TkaCw%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/CAP%3DoziTUi-B3OPZ9U6US8p2Jm%3DXGmrGs%2BHvXBXQvCYDAYjtMTw%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/CAHRQUHm1hgchtYWMEHj%2B7PHomErn7TGXD3Vc9SpOwp%2BvGsVx5w%40mail.gmail.com.


Re: Is there a package that enables one Django project to authenticate via a second Django project?

2020-06-30 Thread Julio Cojom
What about using DRF with token login?



El jue., 25 jun. 2020 a las 13:26, Dave R () escribió:

> I keep running into this problem and started working on a custom
> solution... but before I spend hours on this, I want to confirm that such a
> package/solution doesn't already exist.
>
> I was working on a large project last year that involved a single set of
> users and many small applications.  I made each application a Django app
> and had them all tied together in one database.  There was only one
> database dependency between the applications: the User table.
>
> This became almost impossible to maintain for  multiple reasons:
> * I had two apps that required different values in settings.py
> * The test suite took forever to run
> * One of the apps was developed originally using Postgres and I had to
> spend hours hacking through code getting it to work with MySQL
> * I had to share my entire code base to employ freelancers
> * I had to deprecate one of the apps and this became a project in itself
> (i.e., remove references in settings.py, dropping database tables, etc.)
>
> Next time I'm in this situation, I'd like to develop each application as a
> separate Django project and have them authenticate (via OpenID Connect) to
> a project dedicated to this (e.g., accounts.mysite.com).
>
> Has anyone seen an out-of-the-box solution for this?  The question is very
> open-ended.
>
> --
> 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/0050a73c-fc46-449b-b087-a9f99508fadeo%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/CAHRQUHmRr_PFJpGA2sq%2B7bp4ci0pGo4es%2BxMP_CNdwM-NyTgwg%40mail.gmail.com.


Re: Deploy Django Ubuntu

2020-06-19 Thread Julio Cojom
nginx + gunicorn.

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04




El vie., 19 jun. 2020 a las 12:59, Giovanni Silva ()
escribió:

> Dears,
>
> How is the best way to deploy a Django App in the Ubuntu VPS?
> Can you get me a tutorial ?
>
>
>
> --
> *Giovanni Silva*
> (31) 9 9532-1877
>
> --
> 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/CABO2r9c%3DY7u9ETku7eX7fZ2auGsCPCJSQ9kVhZdT7nZP9jTnrA%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/CAHRQUHm%2B_WUhTt0_%2B_B5Bzrj8uJS1f_3EDznxwODNbN5%3DZrqhw%40mail.gmail.com.


Re: Training Resources for using JavaScript with Django

2020-06-18 Thread Julio Cojom
in your template, open a js block

{% block javascript %}

Re: Need help

2020-06-14 Thread Julio Cojom
Based on the url of the browser, seems like python isn't interpreting the
HTML file. This url isn't friendly, django not shows ".html" when you
browse inside your app. Are you running with py manage.py runserver?

Why the port is 63342? Usualy the port is 8000 unless you explicit changed
it.

Try with the first steps in the django tutorial, that will be config
template spaces, urls, views and models.


https://docs.djangoproject.com/en/3.0/intro/tutorial01/


El dom., 14 de junio de 2020 1:15 p. m., Ragnar Örn Ólafsson Ólafsson <
ragnar@gmail.com> escribió:

> Category:{%category%} is being parsed as normal text inside of the HTML.
>
> On Sun, 14 Jun 2020 at 19:04, Deborah  wrote:
>
>>
>>
>> Le dimanche 14 juin 2020 20:38:43 UTC+2, Deborah a écrit :
>>>
>>> good evening
>>> the tags that I use in the html file, appear on browsers when I launch
>>> the server, what to do ???
>>>
>> --
>> 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/50e03cdf-2aae-4f20-a19a-ed06e1ac4148o%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/CAL1UQP3ECFwL6tLByftURPGA5m2odRjk38%3DouY2jv6zWQ%2BiS-g%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/CAHRQUHmbCtY64OYpX8u-%3DuvbXOhKv%2BQwTCvm3%2BNUQuP-2vCq0w%40mail.gmail.com.


Re: Need help

2020-06-14 Thread Julio Cojom
Show your file please

El dom., 14 de junio de 2020 12:38 p. m., Deborah 
escribió:

> good evening
> the tags that I use in the html file, appear on browsers when I launch the
> server, what to do ???
>
> --
> 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/fca60c53-040e-4f39-ab00-04bb61cc8444o%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/CAHRQUHnzX1zKv32jGV4%2BpjnkddYj9KQ9RThWpNCTtPfmqAxabA%40mail.gmail.com.


Re: AttributeError when returning post.title in a comment model

2020-05-31 Thread Julio Cojom
Try '{0}-{1}'.format(var1, var2)

Check in the console in what line it's throwing the attribute error

Rewards

El vie., 29 de mayo de 2020 5:10 p. m., Ahmed Khairy <
ahmed.heshamel...@gmail.com> escribió:

> I was working on a comment section for post and was getting an
> AttributeError when I return return '{}-{}'.format(self.post.title,
> str(self.user.username)) in the comment model
>
> I am trying to link users and posts to the comment I am getting the same
> error
>
> Here is the Models.py
>
> class Comment(models.Model):
> post = models.ForeignKey(Post, on_delete=models.CASCADE)
> user = models.ForeignKey(User, on_delete=models.CASCADE)
> content = models.TextField(max_length=160)
> timestamp = models.DateTimeField(auto_now_add=True)
>
> def __str__(self):
> return '{}-{}'.format(self.post.title, str(self.user.username))
>
> Here is the views.py:
>
> class PostDetailView(DetailView):
> model = Post
> template_name = "post_detail.html"
>
> def get_context_data(self, *args, **kwargs):
> context = super(PostDetailView, self).get_context_data()
> post = get_object_or_404(Post, slug=self.kwargs['slug'])
> comments = Comment.objects.filter(post=post).order_by('-id')
> total_likes = post.total_likes()
> liked = False
> if post.likes.filter(id=self.request.user.id).exists():
> liked = True
>
> if self.request.method == 'POST':
> comment_form = CommentForm(self.request.POST or None)
> if comment_form.is_valid():
> content = self.request.POST.get('content')
> comment = Comment.objects.create(
> post=post, user=request.user, content=content)
> comment.save()
> return HttpResponseRedirect("post_detail.html")
> else:
> comment_form = CommentForm()
>
> context["total_likes"] = total_likes
> context["liked"] = liked
> context["comments"] = comments
> context["comment_form"] = comment_form
> return context
>
>
> class PostCommentCreateView(LoginRequiredMixin, CreateView):
> model = Comment
> form_class = CommentForm
>
>
> --
> 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/9e84bb03-ca66-4517-ab34-8d723a457b9f%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/CAHRQUHki1Fk2s1a9ws4vB7yhfaLFhyboOVwvPSSVG87BSo0%3DtA%40mail.gmail.com.


Re: Can You please help me out!!!

2020-05-31 Thread Julio Cojom
Boolean field on notification model that change status when click or view
the notification , this perhaps need an asynchronous task with jQuery or
celery

Rewards

El vie., 29 de mayo de 2020 9:28 p. m., meera gangani <
meeragangan...@gmail.com> escribió:

> I Want to implement Mark all a read in notification!!
> So What should i do!!
> Can you explain me a little bit of this!
>
> On Sat, May 30, 2020 at 8:46 AM meera gangani 
> wrote:
>
>> Thank you So much for helping me out!!
>> Thanks a lot
>>
>> Meera Gangani
>>
>> On Fri, May 29, 2020 at 5:08 PM Sencer Hamarat 
>> wrote:
>>
>>> Hi Meera,
>>>
>>> You have only one record because of you are using .latest() method in
>>> the query.
>>>
>>> If you want to last 3 or 4 object ordered by descending date, you should
>>> write queryset like this:
>>>
>>> notifications = Notification.objects.all().order_by('-date')[0:x]  # The
>>> 'x' could be 3 or 4 by your choice.
>>>
>>> An pass the notifications to request context in 'render_to_response'
>>> call. {'notifications': notifications}
>>>
>>> The you have to iterate notifications in template via for loop. For
>>> example;
>>>
>>> {% for notification in notifications %}
>>> notification.title
>>> notification.message
>>> notification.date
>>> {% endfor %}
>>>
>>> Saygılarımla,
>>> Sencer HAMARAT
>>>
>>>
>>>
>>> On Fri, May 29, 2020 at 1:59 PM meera gangani 
>>> wrote:
>>>
 i want to fetch last 3 records for notification!!
 But I only fetch last 1 record.

 Can you please help me out!!!
 Can i use filters??

 And my model fields are:
 title=
 message=
 date=

 And i want to fetch last 3-4 records

 --
 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/CANaPPPJVprm5gE0FNFWqPDGdW_ciq15JQXLmjVHinJkHPwRdqQ%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/CACp8TZh3iD4M2%3Ddq4NOrPTpOzAYCFxx_kduS6%2BK%2BEG2kPDFkYA%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/CANaPPPLnRv2matia%2B6Xm9j0cSoNHYWnn8HMt08ojmqxQOrXvCg%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/CAHRQUH%3DZniCZo8YLG%3DG%3DbXQDJddqQ1%2BGGLFnFx4A_jrtLerjeg%40mail.gmail.com.


Re: How to clone or run your project on local machine by cloning/connecting to Linode Server. what are requirements need to be installed on your Machine.

2020-05-14 Thread Julio Cojom
It must have a requirements.txt , so run pip install -r requirements.txt.

Next run all django stuff (manage.py makemigrations, manage.py migrate,
manage.py runserver)

if requirements.txt isnt in the git repo, you can do it running manage.py
runserver and watching every error it throws and installing the missing
packages or loggin in the server, making the requirements.txt and pushing
to the repo.

Dont think linode as a new thing, its just a server, like any others.



El jue., 14 may. 2020 a las 13:28, chaitan ()
escribió:

> Hi every one,
> I am hired as a Python/Django Developer. My company has deployed its *Django
> application* into LINODE  Server. I have experience using the Heroku
> server,
> but Pretty much new to this *Linode server*, have no clue about this. I
> want to run/Connect to project to that server to *run locally* on my
> machine.
>
> I have access my GIT repo of project and cloned to my machine(windows),
>
> *What are the requirements needed to run locally? What is the appropriate
> question to ask my Manager to get it done?*
>
> *Please share any links/process to it.*
>
> Thanks 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/4e73ca52-7221-4fb3-83fb-493e9160eaec%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/CAHRQUH%3DhwTP8q4%2B5%3D4ZS_yHGLc-D_VqUj%3D3KFCUvDRLt6driWA%40mail.gmail.com.


Re: Defining frequently used HTML fragments as constants?

2019-10-14 Thread Julio Cojom
I guess it will be in your views , if it's used in more than 1 def maybe
you can use a def who return your variable and use it in for loop to call
it many times.


El lun., 14 de octubre de 2019 10:27 a. m., Spiff 
escribió:

> Hi, I'm reading up on how to properly output html. Let's say I have a row
> for a table that would be useful in more than one method, is it a good idea
> to define this as a constant, like so?
> MONTH_ROW = '{1}\n'
>
> --
> 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/49fb166f-4f6d-44a7-a57a-c575494e6394%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/CAHRQUHkrGqTkFU3hfaMCo%3DkZKrmCswxa6OyONTR1JNS2VrPy_A%40mail.gmail.com.


Re: Django admin no recuerda mi superusuario

2019-10-13 Thread Julio Cojom
Pensé en la BD pero cuando ejecuta manager.py eso debería de afectar la
base que tenga en settings. Sera que hay 2 proyectos y ejecutas sobre uno
pero necesitas los resultados en otro? Has revisado la tabla de usuarios en
la BD para ver si está creado el registro?

El dom., 13 de octubre de 2019 1:54 p. m., DANIEL URBANO DE LA RUA <
dannybombas...@gmail.com> escribió:

> Que base de datos tienes configurada rn el setting.py
>
> On Sun, 13 Oct 2019, 21:53 DANIEL URBANO DE LA RUA, <
> dannybombas...@gmail.com> wrote:
>
>> No tienes nada que hacer en el setting
>>
>> On Sun, 13 Oct 2019, 21:23 Francisco Muller, <
>> franciscojavierlevi...@gmail.com> wrote:
>>
>>> When creating a super user in django with python3 manage.py
>>> createsuperuser
>>> and at another time I want to log in to the administrator of my project
>>> with my super user who does not let me connect with my username and
>>> password.
>>> What should I change in the settings so that django can remember my
>>> superuser account every time I log in?
>>>
>>> --
>>> 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/ccf5f81b-74a4-4149-ab93-76164d056c39%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/CAO_yRT0h9s35OXyr-DUUHs3FsfzBt0dAo2Bn3Xt_wykEY82YBw%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/CAHRQUHmav__1bHK%2Bin-OKrfyUDNzuuybv7PpkpvZ%2Bd8xoQRU%3DQ%40mail.gmail.com.


Re: Hosting para demostración

2019-08-09 Thread Julio Cojom
Pythonanywhere, incluso con instancia de mysql

El vie., 9 de agosto de 2019 11:57 a. m., Gabriel Araya Garcia <
gabrielaraya2...@gmail.com> escribió:

> ¿Donde y como subir mi proyecto básico en calidad de demostracion?. Es muy
> basico, con apenas 60 registros, en Sqlite3. Necesito mostrar el estado de
> avance para un cliente. He intentado subir a Heroku, pero me ha sido
> imposible, pues me alega sobre la mi version de Python 3.7.4 cabe señalar
> que Heroku tolera solo 3 versiones de Python (la pagina así lo informa). El
> mensaje de error es:
>
> "Push rejected, file to compile Python app"
>
>
> Python 3.7.3, 3.6.8, y 2.7.16
>
> Por supuesto he efectuado todas las modificaciones al setting.py, creando
> los archivos y carpetas necesarios (requierements.txt, profile, local,..etc)
> Estoy trabajando con Django version 2.1.7
>
> En consecuencia, necesito una alternativa para subir mi proyecto
>
> Desde ya agradezco la ayuda que me puedes brindar.
>
> Saludos
> gabrielaraya2...@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/5fb08f5c-1e99-4193-a27c-a9c6cea184bb%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/CAHRQUHnx%3DtC7vaNX7dTksmCgSD0qQh3hVk2VqPkwVTO4mV0C6w%40mail.gmail.com.


Re: Can Anyone Please Provide djago-select2 Documentation

2019-05-15 Thread Julio Cojom
Hi again,

The package is this : pip install django-admin-select2

It didn't have docs, just the git page (django-admin-select2
<https://github.com/mgd020/django-admin-select2>) with a readme, its really
easy, does all you need but you cant customize.


Regards.


El mié., 15 may. 2019 a las 2:53, Balaji Shetty ()
escribió:

> Correction in Previus Model
>
>
>
>
>
>
>
>
>
> *class Location(models.Model):continent =
> models.ForeignKey(Continent,on_delete=models.CASCADE)country  =
> models.ForeignKey(Country,on_delete=models.CASCADE)city =
> models.CharField(max_length=50)street =
> models.CharField(max_length=100)def __str__(self): return
> self.city <http://self.name>*
>
> On Wed, May 15, 2019 at 12:35 PM Balaji Shetty 
> wrote:
>
>> Thank once again. I followed the instruction but i am not getting any
>> changes.
>> Can you please see the error.
>>
>> models.py
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *from django.db import models# from django import forms# from
>> django_select2.forms import ModelSelect2MultipleWidgetclass
>> Continent(models.Model):name = models.CharField(max_length=255)def
>> __str__(self): return self.name <http://self.name>class
>> Country(models.Model):continent =
>> models.ForeignKey(Continent,on_delete=models.CASCADE)name =
>> models.CharField(max_length=255)def __str__(self): return
>> self.name <http://self.name>class Location(models.Model):continent =
>> models.ForeignKey(Continent,on_delete=models.CASCADE)country  =
>> models.ForeignKey(Country,on_delete=models.CASCADE)city =
>> models.CharField(max_length=50)street =
>> models.CharField(max_length=100)def __str__(self): return
>> self.name <http://self.name>*
>> *--*
>>
>> admin.py
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *from django.contrib import adminfrom .models import Continent,Country,
>> Locationadmin.site.register(Country)admin.site.register(Location)admin.site.register(Continent)#
>> Register your models here.*
>> ---
>>
>> setting.py
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Application definitionINSTALLED_APPS = ['django_select2',
>> 'django.contrib.admin','django.contrib.auth',
>> 'django.contrib.contenttypes','django.contrib.sessions',
>> 'django.contrib.messages','django.contrib.staticfiles','newapp',
>> #My App Name]*
>>
>>
>> *I downloaded PAckage *
>> * git clone https://github.com/applegrew/django-select2.git
>> <https://github.com/applegrew/django-select2.git>*
>>
>> *from https://github.com/applegrew/django-select2
>> <https://github.com/applegrew/django-select2>*
>>
>>
>>
>> On Wed, May 15, 2019 at 12:16 PM Test Bot 
>> wrote:
>>
>>> Okay so there is no need to go to different websites if you want to
>>> install a Python module. You will find almost everything related to Python
>>> modules in pypi.org, it includes everything like installation
>>> instructions, gut repo for the packages etc
>>>
>>> On Wed, May 15, 2019, 11:57 AM Balaji Shetty 
>>> wrote:
>>>
>>>> Hi Julio Cojom
>>>>
>>>> Thank You very much for your reply.
>>>> Can you please provide me the web link for necessary package
>>>> installation and steps also.
>>>> I have been trying since 4 hour and tried all the option for select2
>>>> from different web sites still could not get success.
>>>> I will really appreciate if you do it.
>>>> Please.
>>>>
>>>>
>>>> On Wed, May 15, 2019 at 11:35 AM Julio Cojom 
>>>> wrote:
>>>>
>>>>> Hi, I used a package exclusive for admin, it call django-select2-admin
>>>>> and it's magic. Only register in installed apps and that's all.
>>>>>
>>>>> Regards.
>>>>>
>>>>> El mar., 14 de may. de 2019 11:12 p. m., Balaji Shetty <
>>>>> balajishe...@gmail.com> escribió:
>>>>>
>&

Re: Can Anyone Please Provide djago-select2 Documentation

2019-05-15 Thread Julio Cojom
Hi, I used a package exclusive for admin, it call django-select2-admin and
it's magic. Only register in installed apps and that's all.

Regards.

El mar., 14 de may. de 2019 11:12 p. m., Balaji Shetty <
balajishe...@gmail.com> escribió:

> Hi
>
> I need Cascading drop down list in Django Admin GUI.
>
> I have bee trying to use Django-select2 but i am not getting the desired
> output.
> ( Example Select Continents, select respective Country under Continent )
>
> Can Anyone Please Provide djago-select2 Documentation or any other simple
> alternative. I want to use django admin Panel only. I am not designing any
> form
>
> I will appreciate your help.
>
> --
>
>
> *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information Technology,*
> *SGGS Institute of Engineering & Technology, Vishnupuri, Nanded.MH.India*
> *Official: bsshe...@sggs.ac.in  *
> *  Mobile: +91-9270696267*
>
> --
> 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/CAECSbOuAhpUOrq8OvLFi3dFZtkoU703zWpW5RmzWkEGBa9GcSg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUHkW5gXuEmLWfmf3p7Q3RmW%3DEuCSJ043F2i%3DRXbATq8ctA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it Possible to run django locally without internet connection

2019-05-07 Thread Julio Cojom
I strongly recommend install some web server like mod_wsgi-express,
guinicorn, openlitespeed to serve files, even if its local.

Regards.
Julio C.



El mar., 7 may. 2019 a las 9:46, Idris Adegbite ()
escribió:

> Good day guys, Please can i run django on laptop without internet
> connection.
>  if yes, Please kindly help me out with the procedures.
>
> I am having issues connecting my  phone and laptop and i dont want that to
> slow down my learning.
> Any help would be appreciated
>
> --
> 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/809870ae-92a1-4881-96ae-838d9342ee0b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUHk2P4J1G8QgR_4rYr%3DAn7wokHO-EBSz5J1UtUar3TrsPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Select2 field breaks in admin when extending change_form.html

2019-04-18 Thread Julio Cojom
Hi sir,

There is a library exclusive for admin, his name it's something like
select2 admin , search it, I used it a couple times and only requires that
you add it to your settings.py

Regards!

On Thu, Apr 18, 2019, 11:51 AM Jason Burke  wrote:

> Greetings all,
>
> I'm working on a project, and I didn't like the default solid grey lines
> in each form-row, so I extended the change_form.html to remove them.
> However, in doing so, the autocomplete select2 field broke (raw_id_fields
> breaks as well). I've been looking for a workaround on this issue, and I
> don't know if it's a bug or not. If anyone has a workaround, I would
> appreciate hearing what it is (though I would prefer not to modify any
> files in the Django package). And, if anyone wants to replicate the issue,
> I've included a test case below, but please let me know if I forgot
> anything.
>
> Any thoughts or help is greatly appreciated.
>
> Regards,
>
> Jason
>
>
>
> *Autocomplete_fields with **extended** change_form.html test*
>
> 1. Install Python (I have version 3.7.2 64 bit installed on Windows 10
> Pro).
>
>
> 2. Run the following commands in your working directory:
>
> a. mkdir djangotest.
>
> b. cd bugtest
>
> c. python -m venv venv
>
> d. .\venv\scripts\activate
>
> e. django-admin startproject bugtest .
>
> f.  python manage.py startapp testing
>
> g. python manage.py migrate
>
>
>
> 3. Update installed apps settings in .\djangotest\bugtest\settings.py
>
> INSTALLED_APPS = [
> 'testing.apps.TestingConfig',
> # leave default apps...
> ]
>
>
> 4. Change .\djangotest\testing\models.py to the following:
>
> from django.db import models
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> def __str__(self):
> return self.question_text
>
>
> class Choice(models.Model):
> question = models.ForeignKey(Question, on_delete=models.CASCADE)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
> def __str__(self):
> return self.choice_text
>
>
> 5. Change .\djangotest\testing\admin.py to the following:
>
> from .models import Question, Choice
>
>
> class QuestionAdmin(admin.ModelAdmin):
> ordering = ['pub_date']
> search_fields = ['question_text']
>
>
> class ChoiceAdmin(admin.ModelAdmin):
> autocomplete_fields = ['question']
> #raw_id_fields = ('question',)
>
>
> admin.site.register(Question, QuestionAdmin)
> admin.site.register(Choice, ChoiceAdmin)
>
>
>
> 6. Run the following commands:
>
> a. python manage.py migrate
>
> b. python manage.py makemigrations testing
>
> c. python manage.py migrate testing
>
> d. python manage.py createsuperuser (enter in info for testing superuser).
>
> e. python manage.py runserver
>
>
>
> 7. Open http://127.0.0.1:8000/admin/testing/choice/add/ in browser (I'm
> using Chrome version 73.0.3683.103 (Official Build) (64-bit)).
>
>
> 8. Verify that the foreign key field (question) is working as expected.
>
>
> 9. Create the following directories: .\djangotest\testing\templates,
> .\djangotest\testing\templates\admin
>
>
> 10. Create change_form.html file in .\djangotest\testing\templates\admin
> with the following information:
>
> {% extends "admin/change_form.html" %}
> {% block extrahead %}
> 
> .form-row {
> border-bottom: none;
> }
> 
> {% endblock %}
>
>
> 11. Reload http://127.0.0.1:8000/admin/testing/choice/add/ in browser.
>
>
> 12. Verify that foreign key field (question) is not working as expected.
>
> --
> 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/e8a43eae-2f3c-4d6a-848b-02e3cce11ab1%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUH%3DDCnS0ok-GBtPqudohUsSLrm54riQtp_-w-pG5SESzxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: fesherstructural error

2019-04-09 Thread Julio Cojom
If you're using virtualenv, then u need to activate before running
manage.py, to activate, use workon .

Maybe you only installed Django in your virtualenv and not in your system.

Regards!

El mar., 9 abr. 2019 a las 13:20, sachin thakur (<
sachin.thakur9...@gmail.com>) escribió:

> Create your virtual machine  in any or directory
>
>
>  Then install the django in that virtual machine n create your project
>
> Regards
> Sachin Thakur
>
> On Wed 10 Apr, 2019, 12:47 AM Joseph Jones,  wrote:
>
>> Hello fellow Django community members,
>> I seem to be having quite a bit of trouble fixing my error in calling the
>> manage.py directory in my project. I've received of a hint in that my code
>> launcher  indicates that "Django is not importable into this environment"
>> so it would appear as well as the error in the structure I have made an
>> additional error to give an picture of the structure of my project. it is
>> C:/users/Joseph
>> C:/users/Joseph/Anaconda3
>> C:/users/Joseph/Anaconda3 /lib
>> C:/users/Joseph/Anaconda3 /lib/site-packages
>> Any advice on the step I seem to be missing would be  appreciated. Thank
>> you, Joseph
>>
>> --
>> 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/CAJGsC5Oy9HdXqHSe4qj2mShPjktyV2GsM2rY9qsQ4NZeKw_g8g%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/CA%2BLmcYtMi3wsgGVtDpDmV19bAUJHDS3TNfX5Z5gyQgELAsy8xw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUH%3D1XLhLx%3DShNtYRkW16E8hEKEN7DJhPtTW1cxMWp-HRKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Server Error (500)

2019-04-09 Thread Julio Cojom
If it's development servers or localhost , allow DEBUG=True, that will help
you a lot every time that you found this issues.

Assuming that you use git, if you use localhost before push your changes,
then the shell where you run "manage.py runserver" will show you specific
data about your problem.


On Tue, Apr 9, 2019, 4:46 AM tribhuvan kishor 
wrote:

> first of all, allow debugging that will help you to show server errors and
> their specific reasons.
> setting.py
> DEBUG=true
> then run make migration command
> python manage makemigrations
> then migrate the model
> by using
> python manage migrate
> then let us know if there is any error
>
>
> On Tue, Apr 9, 2019 at 3:14 AM Roger Gammans 
> wrote:
>
>> Did you run 'python manage.py migrate' ?
>>
>> Did it come back with any errors?
>>
>> I ask because specifying price field for values up to 10^9998 strikes me
>> as extreme an likely to causes problems; perhaps you meant max_digits=7 not
>> 1 .
>>
>>
>> On Mon, 2019-04-08 at 04:26 -0700, fazal rehman wrote:
>>
>> Hello,
>> I am a beginner in django.I am getting Server error(500) whenever I am
>> trying to open the server have made some objects, I can see them but when i
>> am trying to open it I get error 500. I have one DEBUG=false.I have
>> attached models.py and settings.py.
>>
>> --
>> 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/922704da-519c-4503-8753-a631949ba9a7%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> 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/1554727878.3451.6.camel%40gammascience.co.uk
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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/CACiphSUVyUOQ0G-td6gMXfks5X0U5vPHP4PuCGA_YH-3%2Bvsy-g%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUHn0qcsKhJ-3-bpXn2Ek%2ByvtftPN2MwD3OPNVBg_aejQjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I have created a Django App, How to create a Django App Launcher?

2019-04-09 Thread Julio Cojom
Django Is a web application, I guess if you create a shortcut of your
browser with the URL of your app, that will be fine. Even you can change
the icon to make a distinction between your app and the real browser.


If you want to those scripts run every n hours or minutes to maintain your
app feed , then create a crontab :)



On Tue, Apr 9, 2019, 9:02 AM jaidev joshi  wrote:

>
> Hello all,
>
>
> I have created a Django application, specifically, a dashboard
> application, python scripts that collect data from sensors running in the
> background will feed that data to Django app for live data plotting.
>
> I want to build this application in a more user-friendly way, and rather
> launching it with the help of terminal I want to create an Icon on Desktop
> by clicking that icon one can start this dashboard application to manage
> sensor related data.
>
> Please suggest me a way through which I can do it.
>
> Thanks.
>
>
> Jay
>
> --
> 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/a9c28f8f-c28e-4268-87d3-afe7ccded5bc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHRQUH%3D%2BD331Q7EQxh%3DNshBUpMk1sGDLCBX2rbk04R2O7%2BheDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with first program

2019-03-01 Thread Julio Cojom
If you use sublime text, try this, right down corner, it says "Tab size" -> 
Convert Indentation to Tabs.

[image: Sin título.png]

El jueves, 28 de febrero de 2019, 17:14:33 (UTC-6), Edvani Pascoal escribió:
>
> hey guys I'm beginner on django I never worked with this framework before 
> and then I've problems to started polls app this is the error:
> (my_env) root@ubuntu:~/django-test/djangoproject# python manage.py 
> runserver 192.168.184.202:8000
>
>
> Unhandled exception in thread started by  check_errors..wrapper at 0x7fa7af08b9d8>
> Traceback (most recent call last):
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 225, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
>  
> line 109, in inner_run
> autoreload.raise_last_exception()
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 248, in raise_last_exception
> raise _exception[1]
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 337, in execute
> autoreload.check_errors(django.setup)()
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 225, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/__init__.py",
>  
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/apps/registry.py",
>  
> line 112, in populate
> app_config.import_models()
>   File 
> "/home/edvani/django-test/my_env/lib/python3.6/site-packages/django/apps/config.py",
>  
> line 198, in import_models
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in 
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 674, in exec_module
>   File "", line 781, in get_code
>   File "", line 741, in 
> source_to_code
>   File "", line 219, in 
> _call_with_frames_removed
>   File "/home/edvani/django-test/djangoproject/polls/models.py", line 5
> question_text = models.CharField(max_length=200)
> ^
> IndentationError: expected an indented block
>
>
> I need help how to solve this??
>

-- 
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/834e5bba-48fb-4fbd-a007-22a66218e5dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue with ManyToMany Relations

2019-03-01 Thread Julio Cojom
I'm writting 2 models with ManyToMany Relations, first I make a model to 
list all my requirements

class Requirements(models.Model):
requirement = models.CharField(max_length=150)
def __str__(self):
return self.requirement

So in this example my list of requirements will be:

   - Personal ID
   - Letter from your boss 
   - Last degree obtained
   - Photography
   
Now I make custom list from different scenarios, since not all jobs require 
the same documents, my model will be: 

class RequirementsList(models.Model):
job= models.ForeignKey(Jobs, on_delete=models.DO_NOTHING)
requirements= models.ManyToManyField(Requirements)

def __str__(self):
return str(self.job)

Now I can pick some of my requeriments and make custom lists from each job 
or position avaliable.

Last, I make my 3rd model , with a relation between RequirementList and File

class FileDetail(models.Model):
file= models.ForeignKey(File, on_delete=models.DO_NOTHING)
job = models.ForeignKey(Jobs, on_delete=models.DO_NOTHING, blank=True, 
null=True)
requeriments = models.ManyToManyField(RequirementsList)

def __str__(self):
return self.file

So I need my requirement list to filter what requirements who has to be in 
my file, but this only give to me in requirements a list of lists instead 
of requirements in the list.

I been reading the docs and found the "through" parameter but I can't make 
it work.

Somone has a clue of what I'm doing wrong?

Thanks!

-- 
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/4837fd8e-1193-48ba-a869-f233faf92443%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.