How to embed logo on uploaded images

2021-04-18 Thread Ram
Hi,

Registered users in web application upload images to  sell market place
items and we need to add our company logo to  pretect from  stealing
against copy right. Is there any library availlable in Python to handle
this feature.

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%2BOi5F0RkEWTeFP3HUfBM4-VKvuRk4TsJ6vneW_p7D-OZEhVWQ%40mail.gmail.com.


Re: image processing

2021-04-18 Thread Aniket Gadge
Still not get it

On Fri, Apr 16, 2021, 5:30 PM Aniket Gadge 
wrote:

> Thanks ,
>  but i want form data which is in the image format and ocr library is
> not capable of giving me any perticular data it gives me all the test which
> is on the image and as well it also not gives me correct image text many
> time
>
>
> On Fri, Apr 16, 2021 at 5:25 PM Kasper Laudrup 
> wrote:
>
>> On 16/04/2021 13.43, Aniket Gadge wrote:
>> > hello everyone,
>> >   my college project is Ai based in that i want to store the
>> > student details to a database, The form is a scan document in image
>> > format and i want to retrieve that data like name , age, phone number ,
>> > etc. how can i retrieve data which is one user form?
>> >
>>
>> What you're looking for is called OCR (Optical Character Recognition).
>> There seems to be library for Python called Tesseract which should be
>> simple to integrate with Django. Here's a tutorial:
>>
>>
>> https://towardsdatascience.com/create-simple-optical-character-recognition-ocr-with-python-6d90adb82bb8
>>
>> I don't have any experience with this library or OCR in general, but
>> hopefully this should guide you in the right direction.
>>
>> Good luck with your project.
>>
>> 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/0b8549df-4f8b-94e6-ec79-8ba850b9ca98%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/CAAAecFs%2BUkOa-0w-SNTn%3DDRGkhUFB4m%2BZa1BrYHLZV0yTw1U4A%40mail.gmail.com.


Re: User filling form in login session if user logout and login again data of form not to lose.

2021-04-18 Thread Salima Begum
Hi sir. Thanks for the response but I did not get this. Can you please send
me any example resource


On Mon, Apr 19, 2021 at 11:20 AM boyuanl...@gmail.com 
wrote:

> You can do that by calling an endpoint in JavaScript. So when the field's
> been changed, automatically called the endpoint in Django and store it into
> the database. When a user's logged back in, just render the existing data
> if there's any.
>
> On Sunday, April 18, 2021, 10:09:29 PM PDT, Salima Begum <
> salim...@rohteksolutions.com> wrote:
>
>
> Hi all,
> Here we are trying. While user enters a value in form input fields the
> value should not clear if user logout the session and navigate from one
> page to other. After filling the form in django  if user fills some form
> fields and  suddenly user logout and if user login again then it should
> save the form data in form input field itself. How can we achieve this in
> django.
>
> --
> 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/CAMSz6b%3DiKZVQ7pGSOL-sFAHKAu6hC2cugvwcRvWEb%3DQg4rxw5A%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/91167.2463416.1618811398738%40mail.yahoo.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/CAMSz6bnK_pLSy3VW-dEBHJVOgzVrOOmko56iWmgbft_kOfGbAQ%40mail.gmail.com.


Re: User filling form in login session if user logout and login again data of form not to lose.

2021-04-18 Thread boyuanl...@gmail.com
 You can do that by calling an endpoint in JavaScript. So when the field's been 
changed, automatically called the endpoint in Django and store it into the 
database. When a user's logged back in, just render the existing data if 
there's any.
On Sunday, April 18, 2021, 10:09:29 PM PDT, Salima Begum 
 wrote:  
 
 Hi all,
Here we are trying. While user enters a value in form input fields the value 
should not clear if user logout the session and navigate from one page to 
other. After filling the form in django  if user fills some form fields and  
suddenly user logout and if user login again then it should save the form data 
in form input field itself. How can we achieve this in django.

-- 
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/CAMSz6b%3DiKZVQ7pGSOL-sFAHKAu6hC2cugvwcRvWEb%3DQg4rxw5A%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/91167.2463416.1618811398738%40mail.yahoo.com.


User filling form in login session if user logout and login again data of form not to lose.

2021-04-18 Thread Salima Begum
Hi all,
Here we are trying. While user enters a value in form input fields the
value should not clear if user logout the session and navigate from one
page to other. After filling the form in django  if user fills some form
fields and  suddenly user logout and if user login again then it should
save the form data in form input field itself. How can we achieve this in
django.

-- 
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/CAMSz6b%3DiKZVQ7pGSOL-sFAHKAu6hC2cugvwcRvWEb%3DQg4rxw5A%40mail.gmail.com.


Testing Django User Login Form

2021-04-18 Thread lone...@gmail.com
Hello all,

I am not sure what I am doing incorrectly with the below test case 
information.  I am simply trying to test the default authentication form of 
django 3.1.  This test should be a good/True login test.

Here is the Test case:-
class TestForms(TestCase):
def test_invalid_username(self):
# The user submits an invalid username.
data = {
'username': 'abc',
'password': 'password',
}
form = AuthenticationForm(None, data)
self.assertTrue(form.is_valid())


Here is what I am getting for output:

FAIL: test_invalid_username (rucklogs.tests.TestForms)
--
Traceback (most recent call last):
  File "/home/lonesoac0/django/rucker2021/rucklogs/tests.py", line 39, in 
test_invalid_username
self.assertTrue(form.is_valid())
AssertionError: False is not true
---

As you can see in the attached screenshot, the user abc is a good user.

Thank you.

-- 
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/5acae9ea-ae51-438b-8c31-6b926581d3d1n%40googlegroups.com.


Re: Django Offline

2021-04-18 Thread Ryan Nowakowski
Typically JavaScript is treated as a static file:

https://docs.djangoproject.com/en/3.2/howto/static-files/

On April 18, 2021 11:25:53 AM CDT, Abid Mohamed Nadhir 
 wrote:
>Hello, I'm trying to implement a django project with service worker,
>i'm 
>wondering where to put my service worker?
>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/b82bd792-e573-4779-bf2d-66e6f1dc4a35n%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/25BB496E-59A4-4BD7-9C69-B7FB733EF238%40fattuba.com.


Django Offline

2021-04-18 Thread Abid Mohamed Nadhir
Hello, I'm trying to implement a django project with service worker, i'm 
wondering where to put my service worker?
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/b82bd792-e573-4779-bf2d-66e6f1dc4a35n%40googlegroups.com.


Re: how to manage static files after Debug = False

2021-04-18 Thread Kasper Laudrup
On 18/04/2021 15.12, Raj Kumar wrote:
> I have problem after debug off, i am unable to handle static files
> when i was doing debug off , i tried WhiteNoise but i can't able to
> done this. if anyone have solution please help me
> 

This looks pretty straightforward:

https://devcenter.heroku.com/articles/django-assets

If you've followed that without success, you should try to explain a bit
more in detail where you are having issues, not just "can't able to done
this".

And of course, if you want someone to do it for you, you should explain
more in detail how much you're willing to pay 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/d35e9583-b225-8c91-afb5-47ed08ead113%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Mixin add field to fields in forms

2021-04-18 Thread Shaheed Haque
Actually, looking again at the source, it might be generally belter to use
self.base_fields. (Yes, my previous answer is not an exact copy of my code,
so I got it wrong).

On Sun, 18 Apr 2021 at 17:16, Shaheed Haque  wrote:

>
>
> On Sun, 18 Apr 2021 at 14:38, sebasti...@gmail.com <
> sebastian.ju...@gmail.com> wrote:
>
>> Hello,
>>
>> Thanks for your fast response. But i don't know how i can
>> use  self.declared_fields and why this would help me...
>>
>
> The "how" is easy. Here is a fragment from my code where the problem is
> that every instance of FilesForm has content dependent on external factors
> (the "..." below):
>
>   class FilesForm(forms.Form):
>   def __init__(self, *args, **kwargs):
>self.declared_fields = OrderedDict()
>for name, field in items():
>self.declared_fields[name] = field
>super().__init__(*args, **kwargs)
>
> The "why" is a deeper question, but in short, that's what the source code
> says the DeclarativeFieldsMetaClass for forms uses. Technically, I believe
> the code is a little ick because self.declared_fileds is a class member,
> not an instance member and so needs the funny-looking assignment so the
> instance has a value it can hack. You may need to copy the original dict as
> in "self.declared_fields = OrderedDict(self.declared_fields)" depending on
> your use case.
>
> (Generally, the Django docs are amazing, but this is one area where I
> needed the source.)
>
> Shaheed
>
>
>
>> Regards
>>
>> shahee...@gmail.com schrieb am Sonntag, 18. April 2021 um 15:14:03 UTC+2:
>>
>>> Try updating self.declared_fields instead.
>>>
>>> On Sun, 18 Apr 2021, 13:47 sebasti...@gmail.com, 
>>> wrote:
>>>
 Hello,


 *forms.py:*

 class Newsletterform(StandardMixin):
 class Meta:
 model = Newsletter
 fields = ['newslettername', 'from_link', 'to_list',
 'email_subject', 'text_message', 'html_message' ]

 *Mixins.py:*
 class StandardMixin(forms.ModelForm):
 class Meta:
 abstract = True

 def __init__(self, *args, **kwargs):

 self.Meta.fields.append('owner')
 super(StandardMixin, self).__init__(*args, **kwargs)


 *i would append in Meta.Fields owner and after this super. But in
 Template this field are not shown. *

 *Why?*

 --
 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/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%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/f16d610f-acce-4eef-8940-8a80ff1d36a3n%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/CAHAc2jcQqpz0DaHHpo9OVp0Gt%3DETTMpq5hk69jb2%2BqmAf6%3Dq2w%40mail.gmail.com.


Re: Mixin add field to fields in forms

2021-04-18 Thread Shaheed Haque
On Sun, 18 Apr 2021 at 14:38, sebasti...@gmail.com <
sebastian.ju...@gmail.com> wrote:

> Hello,
>
> Thanks for your fast response. But i don't know how i can
> use  self.declared_fields and why this would help me...
>

The "how" is easy. Here is a fragment from my code where the problem is
that every instance of FilesForm has content dependent on external factors
(the "..." below):

  class FilesForm(forms.Form):
  def __init__(self, *args, **kwargs):
   self.declared_fields = OrderedDict()
   for name, field in items():
   self.declared_fields[name] = field
   super().__init__(*args, **kwargs)

The "why" is a deeper question, but in short, that's what the source code
says the DeclarativeFieldsMetaClass for forms uses. Technically, I believe
the code is a little ick because self.declared_fileds is a class member,
not an instance member and so needs the funny-looking assignment so the
instance has a value it can hack. You may need to copy the original dict as
in "self.declared_fields = OrderedDict(self.declared_fields)" depending on
your use case.

(Generally, the Django docs are amazing, but this is one area where I
needed the source.)

Shaheed



> Regards
>
> shahee...@gmail.com schrieb am Sonntag, 18. April 2021 um 15:14:03 UTC+2:
>
>> Try updating self.declared_fields instead.
>>
>> On Sun, 18 Apr 2021, 13:47 sebasti...@gmail.com, 
>> wrote:
>>
>>> Hello,
>>>
>>>
>>> *forms.py:*
>>>
>>> class Newsletterform(StandardMixin):
>>> class Meta:
>>> model = Newsletter
>>> fields = ['newslettername', 'from_link', 'to_list',
>>> 'email_subject', 'text_message', 'html_message' ]
>>>
>>> *Mixins.py:*
>>> class StandardMixin(forms.ModelForm):
>>> class Meta:
>>> abstract = True
>>>
>>> def __init__(self, *args, **kwargs):
>>>
>>> self.Meta.fields.append('owner')
>>> super(StandardMixin, self).__init__(*args, **kwargs)
>>>
>>>
>>> *i would append in Meta.Fields owner and after this super. But in
>>> Template this field are not shown. *
>>>
>>> *Why?*
>>>
>>> --
>>> 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/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%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/f16d610f-acce-4eef-8940-8a80ff1d36a3n%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/CAHAc2jfi_R%3DyybuWeix1g1TTo5QkrvWB6bJ%3DFnLFBf1hMXsNBQ%40mail.gmail.com.


Django Channels and Google Cloud Run Redis

2021-04-18 Thread 'Helmy Sayed' via Django users
Dears,

Can someone please help me deploy Django Channels with Google Cloud Run?

Thanks in advance,
Regards.

-- 
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/57ade0be-f12e-4c60-acfe-da30fa42ae9an%40googlegroups.com.


how to manage static files after Debug = False

2021-04-18 Thread Raj Kumar
I have problem after debug off, i am unable to handle static files when i 
was doing debug off , i tried WhiteNoise but i can't able to done this. if 
anyone have solution please help me
 

Thank you guys

-- 
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/5833949f-9245-4b9c-a5d4-caaeb7257b63n%40googlegroups.com.


Django Channels and Google Cloud Run

2021-04-18 Thread 'Helmy Sayed' via Django users

Dears,


   Can you please help me with Channels on Cloud Run?


Regards,
Helmy

--
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/5e317a22-2707-46fe-ac32-de3511261fa1%40me.com.


Re: AttributeError: module 'polls.views' has no attribute 'index'

2021-04-18 Thread Avi Mehenwal
I followed the same tutorial on 17th April 2021 with Python 3.9.2 and 
Django 3.2 and have exactly the same problems as mentioned above.

path('', views.index, name='index'),
AttributeError: module 'polls.views' has no attribute 'index'

any help on how can I debug this? I am a django noob

On Wednesday, 19 April 2017 at 16:31:59 UTC+2 lce...@gmail.com wrote:

> Thanks for your reploy.
>
> Actually I followed the tutorial exactly.
>
> My polls/views.py has:
>
> from django.http import HttpResponse
>
>
> def index(request):
> return HttpResponse("Hello, world. You're at the polls index.")
>
> My polls/urls.py has:
>
> from django.conf.urls import url
>
> from . import views
>
> urlpatterns = [
> url(r'^$', views.index, name='index'),
> ]
>
>
> On Wednesday, 19 April 2017 15:43:57 UTC+2, m712 - Developer wrote:
>
>> You didn't give us enough info, but I am thinking that you don't have an 
>> index() function in your polls/views.py. Start the tutorial from the 
>> beginning and follow it closely.
>> On Apr 19, 2017 4:17 PM, Billy Lin  wrote:
>>
>> I'm following the getting started tutorial 01 and running into issues 
>> after creating the polls app. Can someone please help?
>>
>> I'm using Python 3.6.1 and Django 1.11.
>>
>> Here's the detailed trace:
>>
>> Performing system checks...
>> Unhandled exception in thread started by > check_errors..wrapper at 0x04222810>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py",
>>  
>> line
>> 227, in wrapper
>> fn(*args, **kwargs)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\ru
>> nserver.py", line 125, in inner_run
>> self.check(display_num_errors=True)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>>  
>> l
>> ine 359, in check
>> include_deployment_checks=include_deployment_checks,
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py",
>>  
>> l
>> ine 346, in _run_checks
>> return checks.run_checks(**kwargs)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py",
>>  
>> l
>> ine 81, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
>>  
>> line
>> 16, in check_url_config
>> return check_resolver(resolver)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py",
>>  
>> line
>> 26, in check_resolver
>> return check_method()
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 25
>> 4, in check
>> for pattern in self.url_patterns:
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
>>  
>> line
>> 35, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 40
>> 5, in url_patterns
>> patterns = getattr(self.urlconf_module, "urlpatterns", 
>> self.urlconf_module)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py",
>>  
>> line
>> 35, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 39
>> 8, in urlconf_module
>> return import_module(self.urlconf_name)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
>>  
>> line 126, in import_modu
>> le
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 978, in _gcd_import
>>   File "", line 961, in _find_and_load
>>   File "", line 950, in 
>> _find_and_load_unlocked
>>   File "", line 655, in _load_unlocked
>>   File "", line 678, in exec_module
>>   File "", line 205, in 
>> _call_with_frames_removed
>>   File "C:\Users\cephalin\Repos\django\mysite\mysite\urls.py", line 20, 
>> in 
>> url(r'^polls/', include('polls.urls')),
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\urls\__init__.py",
>>  
>> lin
>> e 50, in include
>> urlconf_module = import_module(urlconf_module)
>>   File 
>> "C:\Users\cephalin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
>>  
>> line 126, in import_modu
>> le
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 978, in _gcd_im

Re: NGINX AND DJANGO DEPLOYMENT ISSUE

2021-04-18 Thread Kasper Laudrup
On 18/04/2021 16.51, Sunday Iyanu Ajayi wrote:
> Hi Team
> 
> Please I am having serious issue with my nginx server.
> 
> At midnight when the traffic on the server is at it peak, my server
> spikes and I get 502 error and from the nginx error log, I get :
> 
> upstream prematurely closed connection while reading response header
> from upstream
> 
> upstream timed out (110: Connection timed out) while reading response
> header from upstream
>

You most likely don't have a problem with your nginx server. Your nginx
server has a problem reading a response from your Django application
which is the reason it times out.

It can be a bit tricky to figure out the cause of the heavy load, but I
would start by looking in your Django server logs and see if there might
be something obvious there.

If you have a chance to get a look at your server while it's under heavy
load and starts giving timeouts, something like htop and similar tools
might be able to give you a hint at the bottleneck. If you're database
server is maxing out all your CPU cores, then that could give a good
hint on where to look.

Hope that helps a bit.

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/8bdddaa7-b019-da24-6537-516f56523fbb%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


NGINX AND DJANGO DEPLOYMENT ISSUE

2021-04-18 Thread Sunday Iyanu Ajayi
Hi Team

Please I am having serious issue with my nginx server.

At midnight when the traffic on the server is at it peak, my server spikes
and I get 502 error and from the nginx error log, I get :

upstream prematurely closed connection while reading response header from
upstream

upstream timed out (110: Connection timed out) while reading response
header from upstream

My server resources is about 8 core , 16GB RAM

This is seriously giving me nightmares . I need help


*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@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/CAKYSAw3Cdm7Wmy%3DBt6HUN6enLXeUrCAjivQsT%3DeWnUviQFwHNA%40mail.gmail.com.


Re: Mixin add field to fields in forms

2021-04-18 Thread sebasti...@gmail.com
Hello,

Thanks for your fast response. But i don't know how i can 
use  self.declared_fields and why this would help me...

Regards

shahee...@gmail.com schrieb am Sonntag, 18. April 2021 um 15:14:03 UTC+2:

> Try updating self.declared_fields instead. 
>
> On Sun, 18 Apr 2021, 13:47 sebasti...@gmail.com,  
> wrote:
>
>> Hello,
>>
>>
>> *forms.py:*
>>
>> class Newsletterform(StandardMixin):
>> class Meta:
>> model = Newsletter
>> fields = ['newslettername', 'from_link', 'to_list', 
>> 'email_subject', 'text_message', 'html_message' ]
>>
>> *Mixins.py:*
>> class StandardMixin(forms.ModelForm):
>> class Meta:
>> abstract = True
>>
>> def __init__(self, *args, **kwargs):
>>
>> self.Meta.fields.append('owner')
>> super(StandardMixin, self).__init__(*args, **kwargs)
>>
>>
>> *i would append in Meta.Fields owner and after this super. But in 
>> Template this field are not shown. *
>>
>> *Why?*
>>
>> -- 
>> 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/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%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/f16d610f-acce-4eef-8940-8a80ff1d36a3n%40googlegroups.com.


Re: Mixin add field to fields in forms

2021-04-18 Thread Shaheed Haque
Try updating self.declared_fields instead.

On Sun, 18 Apr 2021, 13:47 sebasti...@gmail.com, 
wrote:

> Hello,
>
>
> *forms.py:*
>
> class Newsletterform(StandardMixin):
> class Meta:
> model = Newsletter
> fields = ['newslettername', 'from_link', 'to_list',
> 'email_subject', 'text_message', 'html_message' ]
>
> *Mixins.py:*
> class StandardMixin(forms.ModelForm):
> class Meta:
> abstract = True
>
> def __init__(self, *args, **kwargs):
>
> self.Meta.fields.append('owner')
> super(StandardMixin, self).__init__(*args, **kwargs)
>
>
> *i would append in Meta.Fields owner and after this super. But in Template
> this field are not shown. *
>
> *Why?*
>
> --
> 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/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%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/CAHAc2jff8TzHzJ7td91AOH7xgmqvD%2BK7i7R5OPWDZS8oRxs7pQ%40mail.gmail.com.


Mixin add field to fields in forms

2021-04-18 Thread sebasti...@gmail.com
Hello,


*forms.py:*

class Newsletterform(StandardMixin):
class Meta:
model = Newsletter
fields = ['newslettername', 'from_link', 'to_list', 
'email_subject', 'text_message', 'html_message' ]

*Mixins.py:*
class StandardMixin(forms.ModelForm):
class Meta:
abstract = True

def __init__(self, *args, **kwargs):

self.Meta.fields.append('owner')
super(StandardMixin, self).__init__(*args, **kwargs)


*i would append in Meta.Fields owner and after this super. But in Template 
this field are not shown. *

*Why?*

-- 
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/bb10dfa0-ed1e-459c-8e06-46af264a3b7en%40googlegroups.com.


Re: View photos or videos in the Django app

2021-04-18 Thread מוריה יצחקי
?

‫בתאריך שבת, 17 באפר׳ 2021 ב-20:55 מאת מוריה יצחקי <‪moriyal...@gmail.com
‬‏>:‬

> Hi
> How to view photos or videos in the Django app
> I would be very happy to help
> Thank you!!!
>
> --
> 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/b23fe389-107e-42c5-a0e4-d9104550dc54n%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/CA%2B277bsUqRW7DAyJL4SP2ig367sJ4OFt5%2BvLCTeL84sQEL_hBw%40mail.gmail.com.