Re: X-frame options exempt

2021-11-02 Thread bnmng
I think the problem here is Google doesn't want to be embedded and there 
isn't much you can do about it.  If you can test it by replacing Google's 
URL with another one that works, then I think you proved your code is 
good.  

On Monday, November 1, 2021 at 8:53:52 AM UTC-4 greenk...@gmail.com wrote:

> Hi, 
>
> I am having issues with X-frame options exempt.  I keep getting the same 
> chrome error:
>
> “Refused to display 'https://www.google.com/' in a frame because it set 
> 'X-Frame-Options' to 'sameorigin'.”
>
> In my application I have performed the following combination of actions 
> and still have the error : 
>
>1. Removed X-frame middleware setting: 
>2. Changed X-frame Options:
>3. Utilized decorator @xframe_options_exempt
>4. Although I am looking to use this in a template, I also tested 
>Iframe directly in HTTPResponse 
>
>
> *Settings.py*
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
>
> ]
>
> X_FRAME_OPTIONS = 'ALLOWALL'
>
>  
>
> *Views.py*
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from django.views.decorators.clickjacking import xframe_options_exempt
>
> @xframe_options_exempt
> def index(request):
> return HttpResponse('https://www.google.com/"; width = "100%" height = "100%">')
>

-- 
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/8f4861ae-9441-4dec-a7da-92f2e18a3ca6n%40googlegroups.com.


Issue with django.forms.fields.FilePathField() and callable path

2021-11-02 Thread Chakib Benhabib
Hi, 

First post here, so I don't know if it's the correct channel for this kind 
of issue.
Sorry if it's not.

Since v 3.0 we can set path attribute as a callable in a 
models.fields.FilePathField(), 
as discussed here:
https://code.djangoproject.com/ticket/29529

and documented here:
https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.FilePathField.path

The commit adding this feature can be found here:
https://github.com/django/django/commit/ef082ebb84f00e38af4e8880d04e8365c2766d34

I have an issue when I try to use django.forms.fields.FilePathField()
https://github.com/django/django/blob/stable/3.2.x/django/forms/fields.py#L1095
In the case where path is defined as a callable, and os.scandir(self.path) 
is called (as showed in  l.1126 

).
I 'm facing this explicit error:
"scandir: path should be string, bytes, os.PathLike, integer or None, not 
function"

If I override self.path with a pre-check similar to what it was done for 
the added feature 

it seems to solve this issue.

```
...
path = self.path() if callable(self.path) else self.path
for f in os.scandir(path):
...
```

I don't know if it's a bug or if I miss something using 
models.fields.FilePathField() and django.forms.fields.FilePathField()

-- 
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/b554a6eb-4978-428f-93b4-324a382557f0n%40googlegroups.com.


Re: help

2021-11-02 Thread Indrajeet Singh Yadav
Hi,
Follow these steps:-
1. Check i.e. trace back where exactly did u install python.
2. Trace where you installed django. to do that run this code on python 
path, pip freeze or pip freeze > requirements.txt(makes a requirements file 
good for future use), it gives all the install modules in python this will 
let you know if django is there or not.
3. If django not install install using pip.

If these steps fail then that means that you are trying to make a project 
in a terminal while a virtual environment is running.
[image: 2021-11-02.png]
You see that start (myvenv) That tell you that the virtual environment is 
running.
So here basically you do this, in this terminal you run pip install django

I hope this helps

On Monday, November 1, 2021 at 7:09:13 PM UTC+5:30 Anil Felipe Duggirala 
wrote:

> On Wed, Oct 27, 2021, at 12:50 AM, waqar khan wrote:
> > pip uninstall django
>
> Your answer is not worth the electricity it is written on Waqar.
>

-- 
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/b20d6c1a-14e8-466e-926c-c82ad09ef03dn%40googlegroups.com.


Re: TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

2021-11-02 Thread patel dhruvish
Close with Square bracket [ ' ' , ' ']

On Fri, Oct 29, 2021, 19:36 Sabbir Hasan Munna 
wrote:

>
> [image: Annotation 2021-10-29 081743.png]
>
> --
> 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/f7d8a010-0f68-437c-b3df-ec99a4460aafn%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/CANMvxF0GRQ2kf9fjHC3LJU2-DSpOzV8y5qP%2BmEYLmaMn0dc2gA%40mail.gmail.com.


Re: New user

2021-11-02 Thread Indrajeet Singh Yadav
Hi,
Like you I also started django a while back. And i feel like djangogirls is 
a good place to start.
Its a tutorial site. Search google.
They will help you get started with the basics of django.
They have quite a well explained tutorial.
Also if you find some other way which is good for learning django please do 
share.
Good Luck.
On Tuesday, November 2, 2021 at 2:55:18 AM UTC+5:30 lanza...@gmail.com 
wrote:

> Hi, I want to learn Django, so if someone now the best way I appreciate.
>

-- 
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/422a5f9f-70e4-43df-968b-f8b3514f5ba4n%40googlegroups.com.


Re: New user

2021-11-02 Thread Sebastian Jung
Hello,

i find in beginning Django Girls tutorial very helpful:
https://tutorial.djangogirls.org/de/

Am Mo., 1. Nov. 2021 um 22:24 Uhr schrieb Dalys Lanzas <
lanzasda...@gmail.com>:

> Hi, I want to learn Django, so if someone now the best way I appreciate.
>
> --
> 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/73f4327d-63b2-4da1-a87f-63da662a912an%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/CAKGT9mwNxj3k-6zxbL0tquo-LRQ7a8fMhqc3Ov9Zha83nqTWwQ%40mail.gmail.com.


Re: New user

2021-11-02 Thread Gwanghyeon Gim
Hi, 

here are my recommendations for beginner.

Youtube: Corey M Schafer
Book: Django for Beginners by W. S. Vincent

Good luck.

On Tuesday, 2 November 2021 at 06:25:18 UTC+9 lanza...@gmail.com wrote:

> Hi, I want to learn Django, so if someone now the best way I appreciate.
>

-- 
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/b8ad4713-2e77-41ef-a6ce-fdfb0f2b8fa1n%40googlegroups.com.