Re: How to fight Russia in America

2023-03-12 Thread muhammad salah
Not everyone here is American we don't care about fighting Russia this is a
group about django so just shut up

On Mon, 13 Mar 2023, 00:20 Michael Starr,  wrote:

> Russia's influence in America is powerful. How do you fight 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/74de4d4b-230d-470a-a7c0-0c1e875154e4n%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/CAAWaUghajxxW5sJL2JyG20VhfK9RbBSnk26vg-u2sjZPJzUjRQ%40mail.gmail.com.


Re: How to fight Russia in America

2023-03-12 Thread Jacob Greene
Get bent my guy.

On Sun, Mar 12, 2023, 11:59 PM Jacob Greene 
wrote:

> Lmao wtf is this troll
>
> On Sun, Mar 12, 2023, 5:51 PM Michael Starr  wrote:
>
>> I'll roll over and die then. Thank you for contributing to the Russian
>> cause. My parents would be proud.
>>
>> On Sunday, March 12, 2023 at 3:37:58 PM UTC-7 Sebastian Jung wrote:
>>
>>> Please stop this propaganda... This haven't nothing to do with django
>>>
>>> Michael Starr  schrieb am So., 12. März 2023, 23:20:
>>>
 Russia's influence in America is powerful. How do you fight 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/74de4d4b-230d-470a-a7c0-0c1e875154e4n%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/90a5fa71-7ffa-4ef8-8046-35f9988f3ac9n%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/CAF-Y%3De7rAp0NpwTDWbaDD45ZLiwCY2Mn%3DpJJPwtykDEvrDehnw%40mail.gmail.com.


Re: How to fight Russia in America

2023-03-12 Thread Jacob Greene
Lmao wtf is this troll

On Sun, Mar 12, 2023, 5:51 PM Michael Starr  wrote:

> I'll roll over and die then. Thank you for contributing to the Russian
> cause. My parents would be proud.
>
> On Sunday, March 12, 2023 at 3:37:58 PM UTC-7 Sebastian Jung wrote:
>
>> Please stop this propaganda... This haven't nothing to do with django
>>
>> Michael Starr  schrieb am So., 12. März 2023, 23:20:
>>
>>> Russia's influence in America is powerful. How do you fight 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/74de4d4b-230d-470a-a7c0-0c1e875154e4n%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/90a5fa71-7ffa-4ef8-8046-35f9988f3ac9n%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/CAF-Y%3De6BdgDfVAhg%2B7MJQ00G%3DX09AtBL-8sAY1JNtfxim-N60A%40mail.gmail.com.


Re: Django Admin

2023-03-12 Thread Mir Junaid
try including this line in your index.html or main HTML page
{% csrf_token %}
if it still doesn't work do include it in every html page

On Sat, 11 Mar 2023 at 23:33, 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%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/CAM%2BpT8ydCuKaQgPT6Uhao28Eyhx9R0XNhxEF-yVKEnCn0iGA3w%40mail.gmail.com.


Re: How to get fresh air

2023-03-12 Thread Dylan Reinhold
Just go away.

On Sun, Mar 12, 2023, 15:52 Michael Starr  wrote:

> How do you get fresh air in your house?
>
> --
> 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/5c62a611-ddb5-4bfa-9afe-65a6d0fd131cn%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/CAHtg44CiyDgBRBMvDb6%3DHs0708PaVb%3DAw%3DkC3V3MwzyeEp6XeQ%40mail.gmail.com.


How to get fresh air

2023-03-12 Thread Michael Starr
How do you get fresh air in your house?

-- 
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/5c62a611-ddb5-4bfa-9afe-65a6d0fd131cn%40googlegroups.com.


Re: How to fight Russia in America

2023-03-12 Thread Michael Starr
I'll roll over and die then. Thank you for contributing to the Russian 
cause. My parents would be proud.

On Sunday, March 12, 2023 at 3:37:58 PM UTC-7 Sebastian Jung wrote:

> Please stop this propaganda... This haven't nothing to do with django 
>
> Michael Starr  schrieb am So., 12. März 2023, 23:20:
>
>> Russia's influence in America is powerful. How do you fight 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/74de4d4b-230d-470a-a7c0-0c1e875154e4n%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/90a5fa71-7ffa-4ef8-8046-35f9988f3ac9n%40googlegroups.com.


Re: How to fight Russia in America

2023-03-12 Thread Sebastian Jung
Please stop this propaganda... This haven't nothing to do with django

Michael Starr  schrieb am So., 12. März 2023, 23:20:

> Russia's influence in America is powerful. How do you fight 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/74de4d4b-230d-470a-a7c0-0c1e875154e4n%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/CAKGT9myGDdqCoYhXz7OSYh2n4HJ-ze49sObq4NJsS6BL7dsFqg%40mail.gmail.com.


How to fight Russia in America

2023-03-12 Thread Michael Starr
Russia's influence in America is powerful. How do you fight 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/74de4d4b-230d-470a-a7c0-0c1e875154e4n%40googlegroups.com.


Re: Accessing my local backend

2023-03-12 Thread Carlos André Dantas de Lima
Have you chose url in settings, allow tô access and you try access with
mobile deixe in other address or port

Em dom, 12 de mar de 2023 14:42, Donald KANTI 
escreveu:

> Hey you should start the Django server on 0.0.0.0 something like this
> python
>
> python manage.py runserver 0.0.0.0:8000
>
> Then make sure the mobile and your server are in the same network
>
> On Sun, Mar 12, 2023, 6:33 PM Rafael J. Soteldo S. <
> rafael.sote...@gmail.com> wrote:
>
>> Hi there:
>>
>> I'm being able to access my local backend built with django/python from
>> Postman and react, but if I try to access it from an application built for
>> mobiles, I get a Network error. I try to access the backend from an android
>> device
>>
>> What should I set in django in order to being able to access my endpoints
>> from a device other than the computer
>>
>> 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/769bc9b8-eacf-4e29-ac14-4a199304e4cen%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/CANJ3CtPgPVu4tA5wxkzxT%2BK0h5ob9Ry-4L-8O6_QH4Nhm13dpQ%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/CAA8yBMwJjFK8KF5OdGrr_FpAzo-t76zbZmmAOhLtdSgpw7Wrag%40mail.gmail.com.


Re: Accessing my local backend

2023-03-12 Thread Donald KANTI
Hey you should start the Django server on 0.0.0.0 something like this
python

python manage.py runserver 0.0.0.0:8000

Then make sure the mobile and your server are in the same network

On Sun, Mar 12, 2023, 6:33 PM Rafael J. Soteldo S. 
wrote:

> Hi there:
>
> I'm being able to access my local backend built with django/python from
> Postman and react, but if I try to access it from an application built for
> mobiles, I get a Network error. I try to access the backend from an android
> device
>
> What should I set in django in order to being able to access my endpoints
> from a device other than the computer
>
> 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/769bc9b8-eacf-4e29-ac14-4a199304e4cen%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/CANJ3CtPgPVu4tA5wxkzxT%2BK0h5ob9Ry-4L-8O6_QH4Nhm13dpQ%40mail.gmail.com.


Accessing my local backend

2023-03-12 Thread Rafael J. Soteldo S.
Hi there:

I'm being able to access my local backend built with django/python from 
Postman and react, but if I try to access it from an application built for 
mobiles, I get a Network error. I try to access the backend from an android 
device

What should I set in django in order to being able to access my endpoints 
from a device other than the computer

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/769bc9b8-eacf-4e29-ac14-4a199304e4cen%40googlegroups.com.


Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2023-03-12 Thread Amar Zamoum
I just had the same problem, and i realized that i had the templates file 
in the wrong "mysite" folder. It is easy to confuse the two, so for whoever 
has the same problem, just check where exactly you have put the 
"template/admin" folders, because in the tutorial it says to put inside the 
folder that contains the manage.py file.

Le mardi 26 avril 2016 à 00:34:06 UTC+2, Luis Zárate a écrit :

> Sory for not answer before, but I think I could help.
>
> First you need to know how django find the templates, so take a look 
> template loaders
>
>
> https://docs.djangoproject.com/en/1.9/ref/templates/api/#django.template.loaders.filesystem.Loader
>
> There are two default loaders (filesystem and app ) 
>
> ['django.template.loaders.filesystem.Loader',
>  'django.template.loaders.app_directories.Loader']
>
> so take a look 
> https://docs.djangoproject.com/en/1.9/ref/settings/#template-loaders
>
> So is important the app order.
>
>
>
>
> 2016-04-22 3:21 GMT-06:00 woodz :
>
>> Aloha Andreas Ka,
>>
>> have you been able to get this to work? I am currently going through the 
>> version 1.9 and facing the same issue. Is the suggestion of Marc Moncrief
>> * a way to go? Did you go for your own solution and would you mind to 
>> share?*Thanks a lot, woodz
>>
>>
>> On Sunday, November 16, 2014 at 7:15:59 PM UTC+1, Andreas Ka wrote:
>>>
>>> I am working through 
>>> https://docs.djangoproject.com/en/1.7/intro/tutorial02
>>> so far all went fine - but now *templates changes just don't work.*
>>>
>>>
>>>
>>> I think there must be a flaw in that tutorial, something missing,
>>> or something different in django 1.7.1 ?
>>>
>>> https://docs.djangoproject.com/en/1.7/intro/tutorial02/#customize-the-admin-look-and-feel
>>>
>>>
>>> my versions:
>>>
>>> python -c "import django; print(django.get_version())"
>>> 1.7.1
>>>
>>> python --version
>>> Python 2.7.3
>>>
>>>
>>>
>>> *SYMPTOM:*
>>>
>>> my changes in 
>>> mysite/templates/admin/base_site.html   
>>> are simply ignored.
>>>
>>>
>>>
>>> These are my files:
>>>
>>> mysite# tree
>>> .
>>> ├── db.sqlite3
>>> ├── manage.py
>>> ├── mysite
>>> │   ├── __init__.py
>>> │   ├── settings.py
>>> │   ├── urls.py
>>> │   └── wsgi.py
>>> ├── polls
>>> │   ├── admin.py
>>> │   ├── __init__.py
>>> │   ├── migrations
>>> │   │   ├── 0001_initial.py
>>> │   │   └── __init__.py
>>> │   ├── models.py
>>> │   ├── tests.py
>>> │   └── views.py
>>> └── templates
>>> └── admin
>>> └── base_site.html
>>>
>>>
>>>
>>> mysite/settings.py:
>>>
>>> TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
>>>
>>>
>>> *Whatever I do, the page*
>>> *http://myserver:8000/admin/polls/question/ 
>>> *
>>> *still keeps the old title 'Django administration'*
>>>
>>>
>>> I want to understand how templates work, because I need them for my real 
>>> project.
>>>
>>> Thanks a lot!
>>>
>>>
>>> -- 
>> 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 post to this group, send email to django...@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/7dd97c54-6128-4aa9-aab6-165a7c0c41ac%40googlegroups.com
>>  
>> 
>> .
>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> "La utopía sirve para caminar" Fernando Birri
>
>
>

-- 
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/24ce7663-ec8a-4643-900f-312f2e239f4en%40googlegroups.com.


Re: static files

2023-03-12 Thread Sandip Bhattacharya
Static files outside apps are not served by default. Have you added the main 
directory static directory to settings yet?

https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-STATICFILES_DIRS

Something like this is typically done in project settings:

STATICFILES_DIRS = [BASE_DIR / "static"]

- Sandip

> On Mar 10, 2023, at 1:29 PM, Usra Saeed  wrote:
> 
> Hi,  I am uing django 3.2. My template and static folder are in the main 
> directory.  But my static files are not loading.
> I have one app. In this I have one template name "signin.html". I am using 
> {% extends "base.html" %}
> {% load static %}
> {% block content %}
>  Hello World 
> 
> {% endblock  %}
> 
> In main directory template folder I have base.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/759ee88b-13f6-457b-8abf-1212b30b6628n%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/7E012138-5A5A-41D2-A82F-E20D302C50B2%40showmethesource.org.


Re: Django Admin

2023-03-12 Thread James Hunt
I did add this but no change!!! Just keep getting that CSRF token error 
when trying to access admin!! Which is strange as the CSRF token is 
predominantly for POST methods.

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

CSRF_TRUSTED_ORIGIN = (
'https://8000-famouswelsh-djangosetup-7vkpsqt0kez.ws-eu90.gitpod.io/')
# Application definition
On Sunday, March 12, 2023 at 12:57:19 PM UTC Muhammad Juwaini Abdul Rahman 
wrote:

> Have you tried my suggestion?
>
> On Sun, 12 Mar 2023 at 20:32, James Hunt  wrote:
>
>> I have literally set this up today just to prove that it happens for 
>> every Django project setup!!!
>>
>> So this is my settings :
>>
>>
>>  """
>> Django settings for DjangoTest project.
>>
>> Generated by 'django-admin startproject' using Django 4.1.7.
>>
>> For more information on this file, see
>> https://docs.djangoproject.com/en/4.1/topics/settings/
>>
>> For the full list of settings and their values, see
>> https://docs.djangoproject.com/en/4.1/ref/settings/
>> """
>>
>> from pathlib import Path
>>
>> # Build paths inside the project like this: BASE_DIR / 'subdir'.
>> BASE_DIR = Path(__file__).resolve().parent.parent
>>
>>
>> # Quick-start development settings - unsuitable for production
>> # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
>>
>> # SECURITY WARNING: keep the secret key used in production secret!
>> SECRET_KEY = 
>> 'django-insecure-zb-=l4$q!2t@wjwt!@cp#rz=16v0l)#uai#7h(u4n8eie@ddt%'
>>
>> # SECURITY WARNING: don't run with debug turned on in production!
>> DEBUG = True
>>
>> ALLOWED_HOSTS = []
>>
>>
>> # Application definition
>>
>> INSTALLED_APPS = [
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> ]
>>
>> 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',
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> ]
>>
>> ROOT_URLCONF = 'DjangoTest.urls'
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>> WSGI_APPLICATION = 'DjangoTest.wsgi.application'
>>
>>
>> # Database
>> # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': BASE_DIR / 'db.sqlite3',
>> }
>> }
>>
>>
>> # Password validation
>> # 
>> https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
>>
>> AUTH_PASSWORD_VALIDATORS = [
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
>> ,
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.MinimumLengthValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.CommonPasswordValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.NumericPasswordValidator',
>> },
>> ]
>>
>>
>> # Internationalization
>> # https://docs.djangoproject.com/en/4.1/topics/i18n/
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_TZ = True
>>
>>
>> # Static files (CSS, JavaScript, Images)
>> # https://docs.djangoproject.com/en/4.1/howto/static-files/
>>
>> STATIC_URL = 'static/'
>>
>> # Default primary key field type
>> # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
>>
>> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>>
>>
>> On Sunday, March 12, 2023 at 9:46:04 AM UTC Muhammad Juwaini Abdul Rahman 
>> wrote:
>>
>>> I think you need to add the following in settings.py:
>>>
>>> CSRF_TRUSTED_ORIGIN = ('')
>>>
>>>
>>>
>>> On Sun, 12 Mar 2023 at 02:04, 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

Re: Django Admin

2023-03-12 Thread Muhammad Juwaini Abdul Rahman
Have you tried my suggestion?

On Sun, 12 Mar 2023 at 20:32, James Hunt  wrote:

> I have literally set this up today just to prove that it happens for every
> Django project setup!!!
>
> So this is my settings :
>
>
>  """
> Django settings for DjangoTest project.
>
> Generated by 'django-admin startproject' using Django 4.1.7.
>
> For more information on this file, see
> https://docs.djangoproject.com/en/4.1/topics/settings/
>
> For the full list of settings and their values, see
> https://docs.djangoproject.com/en/4.1/ref/settings/
> """
>
> from pathlib import Path
>
> # Build paths inside the project like this: BASE_DIR / 'subdir'.
> BASE_DIR = Path(__file__).resolve().parent.parent
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = 'django-insecure-zb-=l4$q!2t@wjwt
> !@cp#rz=16v0l)#uai#7h(u4n8eie@ddt%'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> 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',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'DjangoTest.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'DjangoTest.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': BASE_DIR / 'db.sqlite3',
> }
> }
>
>
> # Password validation
> #
> https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
> ,
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/4.1/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/4.1/howto/static-files/
>
> STATIC_URL = 'static/'
>
> # Default primary key field type
> # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
>
> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>
>
> On Sunday, March 12, 2023 at 9:46:04 AM UTC Muhammad Juwaini Abdul Rahman
> wrote:
>
>> I think you need to add the following in settings.py:
>>
>> CSRF_TRUSTED_ORIGIN = ('')
>>
>>
>>
>> On Sun, 12 Mar 2023 at 02:04, 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 vi

Re: Django Admin

2023-03-12 Thread James Hunt
I have literally set this up today just to prove that it happens for every 
Django project setup!!!

So this is my settings :


 """
Django settings for DjangoTest project.

Generated by 'django-admin startproject' using Django 4.1.7.

For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 
'django-insecure-zb-=l4$q!2t@wjwt!@cp#rz=16v0l)#uai#7h(u4n8eie@ddt%'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

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',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'DjangoTest.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'DjangoTest.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# 
https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'


On Sunday, March 12, 2023 at 9:46:04 AM UTC Muhammad Juwaini Abdul Rahman 
wrote:

> I think you need to add the following in settings.py:
>
> CSRF_TRUSTED_ORIGIN = ('')
>
>
>
> On Sun, 12 Mar 2023 at 02:04, 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/e13c7765-831e-45c5-b091-c8fcfbed19c5n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Grou

Re: Django Admin

2023-03-12 Thread Muhammad Juwaini Abdul Rahman
I think you need to add the following in settings.py:

CSRF_TRUSTED_ORIGIN = ('')



On Sun, 12 Mar 2023 at 02:04, 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%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/CAFKhtoRactd%2Bhg-3_m8d5MOKSYb0gp9J9m%2BjNM7naykJ8r3Kww%40mail.gmail.com.