Pasting versus uploading

2020-10-07 Thread Mike Dewhirst
Users need to include an image of a molecular structure in a model so it
can be shown on a report the system produces. They are small enough so I
can restrict the size without bothering them.

I have implemented a TinyMCE-lite HTMLField for pasting an image and
that works. I have also used Django ImageField (and FileField) in other
projects.

What is the best approach?

ImageField is easier on the database (PostgreSQL) but pasting is easier
on the users.

Is there a third way?

Thanks for any advice

Cheers

Mike


-- 
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/b7464b8e-0ad4-c8a6-6bfc-2312ff234021%40dewhirst.com.au.


signature.asc
Description: OpenPGP digital signature


Pasting images versus uploading

2020-10-07 Thread Mike Dewhirst
Users need to include an image of a molecular structure in a project I'm
building. These are small enough that I could limit the size without
restricting functionality. The image needs to be printed out for a report.

What is the best approach?

I have implemented a TinyMCE-lite HTMLField which accepts a pasted image
and in other systems I have used a Django ImageField for uploading.
ImageField is obviously easier on database size but pasting is easier on
the users.

I'm keen to make the UI easier (by pasting) but I worry it is a
vulnerability if abused.

Thanks for any advice

Cheers

Mike

-- 
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/6df3667e-f9cf-eab2-acab-b3e415af1969%40dewhirst.com.au.


Tips for debugging intermittent 502s with Daphne

2020-10-07 Thread Keith Hackbarth
Hey all, 

Was hoping to get some advice about how to debug intermittent 502 using 
Daphne

   - I observe connection error in the NGIX logs (where I"m using 
   proxy_pass) *Connection refused) while connecting to upstream*
   - I observe in NGIX logs that it correlates with spike in inbound 
   requests.
   - However, I'm seeing nothing in my Daphne logs to suggest that there is 
   an error happening downstream.

I've ruled out slowness and networking issues, so I'm assuming that Daphne 
is running out of connections. But have no idea where I could look to 
validate this assumption or what the next steps would be.

Any advice?

-- 
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/89f42085-15f1-4578-a0c2-ee12534bc773n%40googlegroups.com.


Re: Need Guidance to setup Django with MS SQL server

2020-10-07 Thread Eugene TUYIZERE
try this
https://django-mssql.readthedocs.io/en/latest/quickstart.html#dependencies
OR
https://stackoverflow.com/questions/43430091/connecting-django-with-mssql-server

On Wed, 7 Oct 2020 at 20:36, arun sahu  wrote:

> Hi Geeks,
>
> I need your support for setting up my django project with MS SQL server.
>
> As there is no proper tutorial how to setup with MS SQL server. I tried it
> many times but failed with same errors. Please help me to progress.
>
> Tried below :
>  'ods_database': {
> 'ENGINE': 'sql_server.pyodbc',
> 'NAME': 'test',
> 'HOST': '***',
> 'PORT':'1433',
> 'USER': '***',
> 'PASSWORD': '***',
>
> 'OPTIONS':{
> 'driver': 'ODBC Driver 17 for SQL Server',
> }
> }
>
> Error:
>
> File
> "C:\Dropbox\React\DjangoReact\backend\env\lib\site-packages\sql_server\pyodbc\base.py",
> line 12, in 
> raise ImproperlyConfigured("Django %d.%d.%d is not supported." %
> VERSION[:3])
> django.core.exceptions.ImproperlyConfigured: Django 3.1.2 is not supported.
>
> Thanks,
> Arun
>
> --
> 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/8972677a-651e-4465-8a94-5787e9ab4df9n%40googlegroups.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/CABxpZHuw4zWoUhvajNy1EnyRyCsDR76EZ%3DExegvmU8_B-XHSUQ%40mail.gmail.com.


Need Guidance to setup Django with MS SQL server

2020-10-07 Thread arun sahu
Hi Geeks,

I need your support for setting up my django project with MS SQL server.

As there is no proper tutorial how to setup with MS SQL server. I tried it 
many times but failed with same errors. Please help me to progress.

Tried below :
 'ods_database': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'test',
'HOST': '***',
'PORT':'1433',
'USER': '***',
'PASSWORD': '***',

'OPTIONS':{
'driver': 'ODBC Driver 17 for SQL Server',
}
}

Error: 

File 
"C:\Dropbox\React\DjangoReact\backend\env\lib\site-packages\sql_server\pyodbc\base.py",
 
line 12, in 
raise ImproperlyConfigured("Django %d.%d.%d is not supported." % 
VERSION[:3])
django.core.exceptions.ImproperlyConfigured: Django 3.1.2 is not supported.

Thanks,
Arun

-- 
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/8972677a-651e-4465-8a94-5787e9ab4df9n%40googlegroups.com.


Retrieval of Date and data in select text field

2020-10-07 Thread Eugene TUYIZERE
I always struggle to retrieve from database to html text field or date
field data when I want to edit these data. Only text field data display.
Please advise how to display these fields.
 When I use:

 value = "{{ list.date_of_birth }}" or
 value = "list.gender"  for example,  I get an empty field and this works
for fields other than date and select.

Thank you
-- 
*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/CABxpZHuCH1-vXDiYzpgUrvfZr%2B9a08B-HZNWyiDSdLuwzkq6%2Bw%40mail.gmail.com.


request.FILES.getlist()

2020-10-07 Thread luca72.b...@gmail.com
i have a form that is like:
class tesoffcliForm(forms.Form)
image = forms.FileField(label='Image', required = False)
art_gen = forms.CharField(label='test ', required = False ,widget = 
forms.Textarea())  

the view is:

def testrendering(request):
form = tesoffcliForm()
number = range(100)
return render(request, 'polls/test.html', {'form':form, 
'range':number,  })

the template is:

{% for a in range %} 
{% for field in form %}
{{ field.label }} {{ field }}

{% if forloop.counter|divisibleby:"2" %}

{% endif %}
{% endfor %}

the view for get the data is very easy:

def get_data(request):

art = request.POST.getlist('art_gen')
image = request.FILES.getlist('image')

the list generated are:
art = a list of 100 lines, where if i have no imput in the list i find  '  '
image = a list with only the file that i have decide to upload.

how can i have also an empty folder in the image list??? for example
image = [file obg, ' ' , file obj 2, etc]
if i can't do this i have no corrispondance between art and image when i 
save in the database

Thanks for your help

-- 
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/1f83f275-ab62-4b94-b314-81eda7ac2580n%40googlegroups.com.


Re: Best places to learn Software Engineering

2020-10-07 Thread serge buasa
https://ocw.mit.edu/courses/find-by-topic/#cat=engineering=computerscience

enjoy it(undergraduate/graduate)

Le mer. 7 oct. 2020 à 02:16, Samuel Nogueira  a
écrit :

> Hi guys!
>
>
>
> I know that this group is only for django but I don't have anywhere else
> to ask this question, I hope some of you can help me. This semester,   I’m
> having an introductory subject of software engineering in my course and  I
> am dissatisfied with how the subject is being taught. Because of that I
> want to learn it by myself, so I would like to know wich materials and
> sources are the best to learn about Software Engineering disciplines.
>
>
>
>
> -
>
> Samuel Nogueira Bacelar
>
>
>
> GitHub: https://github.com/SamuelNoB
>
>
>
> Linkedin: https://www.linkedin.com/in/samuel-nogueira-87800b1aa/
>
>
>
>
> -
>
>
>
> --
> 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/2D946DC4-3206-41FC-B2A5-5AAABF9E4EE9%40hxcore.ol
> 
> .
>

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


Re: Best places to learn Software Engineering

2020-10-07 Thread serge buasa
and udemy of course,always waitin for the promos sessions its always ;-)


Le mer. 7 oct. 2020 à 04:11, serge buasa  a écrit :

>
> https://ocw.mit.edu/courses/find-by-topic/#cat=engineering=computerscience
>
> enjoy it(undergraduate/graduate)
>
> Le mer. 7 oct. 2020 à 02:16, Samuel Nogueira  a
> écrit :
>
>> Hi guys!
>>
>>
>>
>> I know that this group is only for django but I don't have anywhere else
>> to ask this question, I hope some of you can help me. This semester,   I’m
>> having an introductory subject of software engineering in my course and  I
>> am dissatisfied with how the subject is being taught. Because of that I
>> want to learn it by myself, so I would like to know wich materials and
>> sources are the best to learn about Software Engineering disciplines.
>>
>>
>>
>>
>> -
>>
>> Samuel Nogueira Bacelar
>>
>>
>>
>> GitHub: https://github.com/SamuelNoB
>>
>>
>>
>> Linkedin: https://www.linkedin.com/in/samuel-nogueira-87800b1aa/
>>
>>
>>
>>
>> -
>>
>>
>>
>> --
>> 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/2D946DC4-3206-41FC-B2A5-5AAABF9E4EE9%40hxcore.ol
>> 
>> .
>>
>

-- 
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/CAFaTauCm%2B%3D1vFzkBh%3DY6BVWanQJT7Dwdr_EkCBHtTpPsp5fEuA%40mail.gmail.com.