Re: What makes the images deletion from the media folder?

2023-03-23 Thread David Nugent

Are you using Django in a docker container?

If so, any changes to the filesystem are ephemeral and disappear when 
the container is recycled.



Regards,
David


-- Original Message --

From "Ram" 

To django-users@googlegroups.com
Date 3/24/2023 2:04:56 PM
Subject What makes the images deletion from the media folder?


Hi,

We are seeing weird issue that images are deleted between deployments 
in our Dev. server and we are seeing this message in log files:


example:


WARNING 2023-03-10 07:03:16,927 - Not Found: /media/cl_1zf3am8.JPG


Could someone let me know what could be the issue?

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%2BOi5F2mTfx%2B32XKjM__gkgp0i7vPKgWsGuGVGQsr%3DSX_U0MRg%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/em8b3dd4e8-2fe8-4b70-83f5-c101dc8a3700%4090728edb.com.


pgpKPeR2T_cod.pgp
Description: PGP signature


What makes the images deletion from the media folder?

2023-03-23 Thread Ram
Hi,

We are seeing weird issue that images are deleted between deployments in
our Dev. server and we are seeing this message in log files:

example:

WARNING 2023-03-10 07:03:16,927 - Not Found: /media/cl_1zf3am8.JPG


Could someone let me know what could be the issue?

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%2BOi5F2mTfx%2B32XKjM__gkgp0i7vPKgWsGuGVGQsr%3DSX_U0MRg%40mail.gmail.com.


Re: Error: name 'include' is not defined

2023-03-23 Thread Ikrombek
How can I use for dental clinic, For example, do I need to include 32 
fields from the model to specify 32 teeth, or is there a way to do it in 
one?

On Wednesday, March 22, 2023 at 8:24:18 PM UTC+5 Larry Stevens wrote:

> Perfect, problem solved.
> Thank you so much Jeman, Harouna, and Robinson.
> Greatly appreciated.
>
> On Wednesday, March 22, 2023 at 11:16:58 AM UTC-4 Robinson wrote:
>
>> import path, include
>>
>>
>> On Wed, Mar 22, 2023 at 4:49 PM Harouna Diallo  
>> wrote:
>>
>>> You must Import include : from django.urls import path, include
>>>
>>> On Wed, Mar 22, 2023 at 12:53 PM Larry Stevens  
>>> wrote:
>>>
 Hello,

 I'm brand new to Django taking an online course in Python.
 I created a project named 'django_test' and I'm in the process of 
 creating a very simple app named 'Hello_World'.

 I'm trying to modify the urls.py file in my 'django_test' project for 
 the app 'hello_world'.
 My code in urls.py follows:
 from django.contrib import admin
 from django.urls import path
 urlpatterns = [
 path('admin/', admin.site.urls),
 path('hello_world/', include('hello_world.urls'))
 ]

 The return error is name 'include' is not defined

 I tried to import include with the statement from django.conf.urls 
 import include
 which also failed.

 Thank you for reading my post.

 Larry Stevens

 -- 
 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/4e2c7426-b451-4542-9629-52d4f4707a94n%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...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAO73PDopg--cbbBgX3OQuNwfp%3DyMpSf_Uzga894CXvzOAy1mAA%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/09b7fb6b-f025-49a9-b46a-ad456afea0dan%40googlegroups.com.


Re: Django Admin

2023-03-23 Thread Ikrombek

Hello,
How can I use dental teeth section. For example, do I need to include 32 
fields from the model to specify 32 teeth, or is there a way to do it in 
one?
On Tuesday, March 14, 2023 at 5:39:27 AM UTC+5 Muhammad Juwaini Abdul 
Rahman wrote:

> In my previous case, I only use this:
>
> CSRF_TRUSTED_ORIGINS = ['https://your site url',]
>
> On Tue, 14 Mar 2023 at 04:33, Prosper Lekia  wrote:
>
>> This is how I deal with all csrf related issues.
>>
>> Make sure csrf MiddleWare is in your MiddleWare list 
>>
>> 'django.middleware.csrf.CsrfViewMiddleware'
>>
>> Add the settings below in your settings.py to prevent all csrf related 
>> issues
>>
>> CSRF_TRUSTED_ORIGINS = ['https://your site url',]
>> SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'http')
>> CSRF_USE_SESSIONS = False
>> CSRF_COOKIE_SECURE = True
>> SECURE_BROWSER_XSS_FILTER = True
>>
>> CORS_ALLOW_CREDENTIALS = True
>> CORS_ORIGIN_ALLOW_ALL = True
>>
>>
>> SECURE_CONTENT_TYPE_NOSNIFF = True
>> SECURE_FRAME_DENY = True
>> SECURE_HSTS_SECONDS = 2592000
>> SECURE_HSTS_INCLUDE_SUBDOMAINS = True
>> SECURE_HSTS_PRELOAD = True
>> X_FRAME_OPTIONS = 'SAMEORIGIN'
>> SECURE_REFERRER_POLICY = 'same-origin
>>
>> On Saturday, March 11, 2023 at 7:04:40 PM UTC+1 James Hunt wrote:
>>
>>> Hi there. I am fairly new to Django but have had previous success with 
>>> creating an app and being able to access the Admin page.
>>> Recently, if I attempt to access the admin page of a new Django app it 
>>> throws the CSRF error upon trying to log in!!!
>>>
>>> I have attempted several ways to bypass this error including adding 
>>> allowed hosts but I cant seem to get past this issue.
>>>
>>> Can someone please provide me with the definitive way of stopping CSRF 
>>> error when simply trying to access the admin part of Django? I mean there 
>>> are no post functions that really apply to this feature so I cant 
>>> understand the CSRF token.
>>>
>>> I cant get past this issue which means I can never access the admin 
>>> page!!
>>>
>>> Please help.
>>>
>>> Regards
>>>
>>> James
>>>
>> -- 
>>
> 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/3f7e8ff3-3619-4ddf-8517-0ee3a613ed20n%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/a1746f7f-6bec-4031-9675-650d9bf41754n%40googlegroups.com.


Re: how i use django in blockchain.

2023-03-23 Thread Mike Dewhirst

On 23/03/2023 6:02 pm, Shubham Lahane wrote:
im currently working on my BE project. my project topic is 'secure 
EFIR using Blockchain'. actually im working on wesbite that is 
decentralized in nature. once user fill the FIR form, in backend smart 
contracts will run and i want to show transaction hash to user who 
filled the FIR form. how i can integrate brownie and django so that i 
can show transaction hash to user ??


1. Put the hash into the context dict in your view for example, 
context["hash"] = r"""{0}""".format(hash)


2. Insert the hash in your template somewhere {{ hash }}

Just like any other data you wish to display



.plz help me i have very less time.
--
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/fffba5d6-005c-42fd-b384-c163e12b0849n%40googlegroups.com 
.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.

--
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/7c46cbe5-0e28-a273-907b-91482b7c386f%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Help in django. I want to upload files

2023-03-23 Thread Shubhi Pandey
the error is:
django.core.exceptions.FieldError: Unknown field(s) (e-resource) specified 
for Post

models.py
class Post(models.Model):
e_resource = models.FileField(null=True, 
   blank=True, 
   validators=[FileExtensionValidator( ['pdf'] ) ],
upload_to='')

views.py
def uploadResource_details(request,shop):

 shop = workshop_details.objects.get(w_id=shop)
 if request.method == 'POST':
form = PostForm(request.POST, request.FILES)
if form.is_valid():
cdform = form.cleaned_data
cdform.save()
return HttpResponse("File Uploaded successfully")
 else:
form = PostForm()
 return render(request, 'uploadAttendance.html', {'form': form,'shop' : 
shop})

forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['e-resource']

-- 
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/fe9481ec-2104-44ab-9403-5a586c7ab1a8n%40googlegroups.com.


how i use django in blockchain.

2023-03-23 Thread Shubham Lahane
im currently working on my BE project. my project topic is 'secure EFIR 
using Blockchain'. actually im working on wesbite that is decentralized in 
nature. once user fill the FIR form, in backend smart contracts will run 
and i want to show transaction hash to user who filled the FIR form. how i 
can integrate brownie and django so that i can show transaction hash to 
user ?? .plz help me i have very less time.

-- 
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/fffba5d6-005c-42fd-b384-c163e12b0849n%40googlegroups.com.


Re: Help on Django + Plotly integration

2023-03-23 Thread Praveen Kumar
Hello Kasper,

I have followed following link to get portly chart:

https://hackmamba.io/blog/2022/03/quickly-create-interactive-charts-in-django/

But I'm not getting end result. Please find below the structure that I have 
made. Please let me know if I'm missing anything.

[image: Screenshot 2023-03-23 154859.png]

Kindly suggest.

Thanks & Regards,
Praveen
On Wednesday, 22 March 2023 at 20:38:55 UTC+5:30 Kasper Laudrup wrote:

> On 22/03/2023 15.29, Praveen Kumar wrote:
> > Hi Team,
> > 
> > I need help in implementing Plotly with Django for interactive 
> dashboards.
> > 
> > Please suggest.
> >
>
> Try following this:
>
> https://googlethatforyou.com?q=plotly%20django
>
> 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/ce2cb442-378f-461a-b511-712db359b8b7n%40googlegroups.com.