Re: migrations not created for foreign key when primary key type is changed

2022-09-02 Thread Devang
I guess it might be changed by postgres. Have you checked postgres
documentation ?

On Fri, 2 Sep 2022, 18:45 Manasvi Dobariya,  wrote:

> I have default primary key in the model which is being referenced as
> foreign key in another model. Now, when I change this primary key type from
> AutoField to BigAutoField, migrations for only primary keys are being
> generated no migration for foreign key is generated. However, when I apply
> the migration generated for primary key, foreign key type also gets changed
> from int to bigint in postgres database. Is it expected that migrations for
> foreign key will not get generated?
>
> --
> 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/a4cbdf90-bd62-46a7-9657-1c7ba39509c2n%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%2BU2%3Dah%3Dy6dOb2uF_oUXnn4xt%3DqU7-Nvv9v9_u6hRb-5gxELqw%40mail.gmail.com.


Re: Checking API Results before saving

2022-09-02 Thread lone...@gmail.com
I have been working on this issue.  Here is what I have so far.

My Model and pre_save 
information:
class walmart_query_history(models.Model):
storeNumber = models.CharField(max_length=10)
receiptDate = models.DateField(auto_now=False, auto_now_add=False)
cardType = models.ForeignKey(walmart_query_history_card_type, 
on_delete=models.CASCADE)
purchaseAmount = models.DecimalField(max_digits=13, decimal_places=2)
lastFour = models.CharField(max_length=4)

class Meta:
unique_together = (('receiptDate', 'purchaseAmount'),)

def validate_response_ask_walmart(*args, instance, **kwargs):
pewee = instance.receiptDate
pewee = pewee.strftime('%m-%d-%Y')
data = call_command('validate_response_query_walmart', 
instance.storeNumber, str(pewee), instance.cardType, 
str(instance.purchaseAmount), instance.lastFour)
valid_ser = ValidateFormSerializer(data=data)
if valid_ser.is_valid():
post_data = valid_ser.validated_data
else:
print(valid_ser.errors)
pre_save.connect(validate_response_ask_walmart, 
sender=walmart_query_history)

Contents of my validate_response_ask_walmart 
file:
class Command(BaseCommand):
help = 'Reads Receipts'

def add_arguments(self, parser):
parser.add_argument('storeId', type=str)
parser.add_argument('purchaseDate', type=str)
parser.add_argument('cardType', type=str)
parser.add_argument('total', type=str)
parser.add_argument('lastFourDigits', type=str)

def handle(self, *args, **options):

url = "https://www.walmart.com/chcwebapp/api/receipts;

data = {
"storeId": options['storeId'],
"purchaseDate": options['purchaseDate'],
"cardType": options['cardType'],
"total": options['total'],
"lastFourDigits": options['lastFourDigits']
}
storeId = data['storeId']

headers = {
'sec-ch-ua': '"Chromium";v="98", " Not A;Brand";v="99", "Google 
Chrome";v="98"',
'accept': 'application/json',
'Referer': 'https://www.walmart.com/receipt-lookup',
'content-type': 'application/json',
'sec-ch-ua-mobile': '?0',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36',
'sec-ch-ua-platform': '"Mac OS X"'
}
 
response = requests.post(url, json=data, headers=headers)
# Good documentation about requests response codes.
# https://www.w3schools.com/python/ref_requests_response.asp

#print("Status Code", response.status_code)
#print(response.text)
#print("JSON Response ", response.json())
base_JSON = response.json()
#tester = base_JSON
#return json.dumps(base_JSON, indent=4)
self.stdout.write(type(base_JSON))


My serializer 
file---
from rest_framework import serializers

class ValidateFormSerializer(serializers.Serializer):
tcNumber = serializers.CharField(max_length=255, 
source='receipts[0]tcNumber')



I keep getting the error code of:
AttributeError: type object 'dict' has no attribute 'endswith'

What am I missing?
On Friday, September 2, 2022 at 4:39:53 AM UTC-4 lone...@gmail.com wrote:

> Ok, I have a CreateView.  The process I have now is:
> blank form is created by CreateView
> After I submit the data to the form, I have a post_save that calls a 
> function that queries the API based on the values entered in the form.
>
> When and how do I call the serializer during this process?
>
> On Friday, September 2, 2022 at 3:15:00 AM UTC-4 amarb...@gmail.com wrote:
>
>> Hello ,
>>
>> You can design a serializer for each api endpoint and use it in your view 
>> to validate your data like validating forms data :
>> Pseducode :
>> res = requests.post(url+some_endpoint, data)
>> endpoint_serializer.validate(res.data)
>> if serializer.is_valid():
>> #do your stuff
>> else :
>> #do something 
>>
>> Best Regards 
>>
>> Ammar Mohammed
>>
>> On Fri, 2 Sep 2022, 01:41 lone...@gmail.com,  wrote:
>>
>>> Hello all,
>>>
>>> I am sending an GET request to an external API and I would like to 
>>> validate the response before I save it to my model.  How do I do this?
>>>
>>> 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...@googlegroups.com.
>>> To view this 

Re: Guys i have issue while loading sub module in django app

2022-09-02 Thread Devang
Sub-module mean file like views.py or models.py


On Sun, 28 Aug 2022, 14:21 Paul serubombwe,  wrote:

> Elaborate more bro, what do you mean by sub model
>
> On Sat, Aug 27, 2022, 23:56 देव Hingu  wrote:
>
>> Please check here for my problem
>>
>> https://stackoverflow.com/questions/73499743/cant-find-load-sub-module-inside-django-appmodule-dynamically
>>
>> --
>> 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/287b9213-d6d6-4e03-be1f-3b7027ec3bben%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/CAJkmis2j0UjNvFThqYactPY%2BCO-qUukT3OLP%2B%2BQXdb%3DO5UTYGg%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/CA%2BU2%3Dah5oYtfLBGpB8Xi70_pwPwG6KNCgiPmyGSpd52M0dEAFw%40mail.gmail.com.


Re: Django not load CSS

2022-09-02 Thread jeremiah taguta
Did you run collectstatic

Warm Regards,
Jeremiah

On Fri, 02 Sep 2022, 15:15 Rahul,  wrote:

> Hey there,  I really need a help for this. I m try to deploy django
> project on live serve as we need to off debug=False. But when Debug is
> false  it won't load the css of any page. please do need fully. waiting for
> reply.
>
> 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/7216f46c-5532-4fc4-9d17-651fa471912dn%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/CAFZ-0PvsjSBWsPs09SFmQ97rf5Awv5ANNH3nUsAy1X46uNJyUw%40mail.gmail.com.


Re: Django not load CSS

2022-09-02 Thread Ameer Adeigbe

How did you configure your static folder and where are you hosting thee 
project?
On Friday, September 2, 2022 at 2:15:11 PM UTC+1 Rahul wrote:

> Hey there,  I really need a help for this. I m try to deploy django 
> project on live serve as we need to off debug=False. But when Debug is 
> false  it won't load the css of any page. please do need fully. waiting for 
> reply.
>
> 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/0aafb47d-df55-4145-9e0f-9a31c3f12347n%40googlegroups.com.


Forbidden error- login to django admin

2022-09-02 Thread Amal Babu
I try to deploy my django project on railway. But i got this error[image: 
Screenshot 2022-09-02 102845.png]

my prod settings -->


import os
from .common import *

DEBUG = False

SECRET_KEY = os.environ.get('SECRET_KEY')

ALLOWED_HOSTS = ['web-production-b9a0.up.railway.app',
 'containers-us-west-62.railway.app']




DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('PGDATABASE'),
'USER': os.environ.get('PGUSER'),
'PASSWORD': os.environ.get('PGPASSWORD'),
'HOST': os.environ.get('PGHOST'),
'PORT': os.environ.get('PGPORT')
},
}

main settings is



from datetime import timedelta
import os
from datetime import timedelta
from pathlib import Path

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



# Application definition

INSTALLED_APPS = [
'jazzmin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_filters',
'djoser',
'rest_framework_simplejwt.token_blacklist',
'corsheaders',
 
]

MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
'django.middleware.security.SecurityMiddleware',
"whitenoise.middleware.WhiteNoiseMiddleware",
'silk.middleware.SilkyMiddleware',
'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',
]


INTERNAL_IPS = [
# ...
'127.0.0.1',
# ...
]

CSRF_TRUSTED_ORIGINS = ['http://*.railway.app',
'https://web-production-b9a0.up.railway.app/']


ROOT_URLCONF = 'storefront.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 = 'storefront.wsgi.application'


# Password validation
# 
https://docs.djangoproject.com/en/3.2/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/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True



STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_URL = '/media/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

REST_FRAMEWORK = {
'COERCE_DECIMAL_TO_STRING': False,
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_simplejwt.authentication.JWTAuthentication',
),
}

-- 
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/33075c91-b177-4568-b326-bc824b339b6en%40googlegroups.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread Abdulrahman Abbas
Having exactly this kind of problem

On Fri, Sep 2, 2022, 08:21 Pooja Kumari  wrote:

> Hello team,
> please help me with this error.
>
> --
> 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/3e46fc90-4d92-4db9-abed-7733babf7d4dn%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/CAGGqo0P%2BO50k3DKUAMRCx-2F%2B%3DNY2cqCqBp%3DprsBBUa8YFAQRA%40mail.gmail.com.


Django not load CSS

2022-09-02 Thread Rahul
Hey there,  I really need a help for this. I m try to deploy django project 
on live serve as we need to off debug=False. But when Debug is false  it 
won't load the css of any page. please do need fully. waiting for reply.

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/7216f46c-5532-4fc4-9d17-651fa471912dn%40googlegroups.com.


migrations not created for foreign key when primary key type is changed

2022-09-02 Thread Manasvi Dobariya
I have default primary key in the model which is being referenced as 
foreign key in another model. Now, when I change this primary key type from 
AutoField to BigAutoField, migrations for only primary keys are being 
generated no migration for foreign key is generated. However, when I apply 
the migration generated for primary key, foreign key type also gets changed 
from int to bigint in postgres database. Is it expected that migrations for 
foreign key will not get generated?

-- 
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/a4cbdf90-bd62-46a7-9657-1c7ba39509c2n%40googlegroups.com.


Re: Use include template tag in another app template folder

2022-09-02 Thread Wazed Khan
My Bad

On Fri, Sep 2, 2022, 4:23 PM Wazed Khan  wrote:

> You can set custom template folder in you project directory
>
> From there you can use any template for any app
>
> Change template path from setting
> You can look into documentation.
>
> On Fri, Sep 2, 2022, 4:09 PM Abdul Qoyyuum Haji Abdul Kadir <
> abdul.qoyy...@gmail.com> wrote:
>
>> It would be problematic. Just copy and paste the template file from one
>> app into the other.
>>
>> Abdul Qoyyuum Bin Haji Abdul Kadir
>> about.me/qoyyuum
>>
>> On Fri, Sep 2, 2022, 5:22 PM mohamed khaled <
>> mohamed.khaled33...@gmail.com> wrote:
>>
>>> I have two apps each one has template folder I want to use *include 
>>> *template
>>> tag to get template from other app how can I handle that
>>>
>>> --
>>> 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/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%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/CANVqoJ_L04oFerwgjod3hTUgvOfoDUb2kW8mn%3Dt1pxvsC8swjQ%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/CALWCTKj11DqTUZMXDp2bXfr5%3D_sEoTWxMD7%3DqKUXKC_VyptK_g%40mail.gmail.com.


Re: Use include template tag in another app template folder

2022-09-02 Thread Wazed Khan
You can set custom template folder in you project directory

>From there you can use any template for any app

Change template path from setting
You can look into documentation.

On Fri, Sep 2, 2022, 4:09 PM Abdul Qoyyuum Haji Abdul Kadir <
abdul.qoyy...@gmail.com> wrote:

> It would be problematic. Just copy and paste the template file from one
> app into the other.
>
> Abdul Qoyyuum Bin Haji Abdul Kadir
> about.me/qoyyuum
>
> On Fri, Sep 2, 2022, 5:22 PM mohamed khaled 
> wrote:
>
>> I have two apps each one has template folder I want to use *include *template
>> tag to get template from other app how can I handle that
>>
>> --
>> 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/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%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/CANVqoJ_L04oFerwgjod3hTUgvOfoDUb2kW8mn%3Dt1pxvsC8swjQ%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/CALWCTKj0TMxt8vBmtncX3-FswzZ7T5J%2B5F6ofd5fjFngzQYoqw%40mail.gmail.com.


Re: Use include template tag in another app template folder

2022-09-02 Thread Abdul Qoyyuum Haji Abdul Kadir
It would be problematic. Just copy and paste the template file from one app
into the other.

Abdul Qoyyuum Bin Haji Abdul Kadir
about.me/qoyyuum

On Fri, Sep 2, 2022, 5:22 PM mohamed khaled 
wrote:

> I have two apps each one has template folder I want to use *include *template
> tag to get template from other app how can I handle that
>
> --
> 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/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%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/CANVqoJ_L04oFerwgjod3hTUgvOfoDUb2kW8mn%3Dt1pxvsC8swjQ%40mail.gmail.com.


Use include template tag in another app template folder

2022-09-02 Thread mohamed khaled
I have two apps each one has template folder I want to use *include *template 
tag to get template from other app how can I handle that 

-- 
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/91eeb0b2-304a-4fef-94b1-e407ef82fbfcn%40googlegroups.com.


Re: Checking API Results before saving

2022-09-02 Thread lone...@gmail.com
Ok, I have a CreateView.  The process I have now is:
blank form is created by CreateView
After I submit the data to the form, I have a post_save that calls a 
function that queries the API based on the values entered in the form.

When and how do I call the serializer during this process?

On Friday, September 2, 2022 at 3:15:00 AM UTC-4 amarb...@gmail.com wrote:

> Hello ,
>
> You can design a serializer for each api endpoint and use it in your view 
> to validate your data like validating forms data :
> Pseducode :
> res = requests.post(url+some_endpoint, data)
> endpoint_serializer.validate(res.data)
> if serializer.is_valid():
> #do your stuff
> else :
> #do something 
>
> Best Regards 
>
> Ammar Mohammed
>
> On Fri, 2 Sep 2022, 01:41 lone...@gmail.com,  wrote:
>
>> Hello all,
>>
>> I am sending an GET request to an external API and I would like to 
>> validate the response before I save it to my model.  How do I do this?
>>
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0b724dc1-cb08-4168-8cc0-a5eac8a7c011n%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/0e1c1af9-f423-4e3a-ba62-55cc60efd8c5n%40googlegroups.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread Wazed Khan
Use
from . import views
Because you are in you app directory
Or use
from tutorial import views

On Fri, Sep 2, 2022, 1:21 PM Pooja Kumari  wrote:

> Hello team,
> please help me with this error.
>
> --
> 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/3e46fc90-4d92-4db9-abed-7733babf7d4dn%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/CALWCTKh9p2OC6MsM_JxCQMzAGznqxV-o2ZXrY_r64Dqds70oXg%40mail.gmail.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread rahul sharma
Ti install in terminal pip install totorial.quickstart


On Fri, Sep 2, 2022, 12:57 rahul sharma  wrote:

> Import module name
>
> On Fri, Sep 2, 2022, 12:21 Pooja Kumari  wrote:
>
>> Hello team,
>> please help me with this error.
>>
>> --
>> 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/3e46fc90-4d92-4db9-abed-7733babf7d4dn%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/CACvpWiqWN54QrAt%3DEoi6Op2%3DN%3Dp0wVFKn9yn%3D52dfo2gU2fRQA%40mail.gmail.com.


Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-02 Thread rahul sharma
Import module name

On Fri, Sep 2, 2022, 12:21 Pooja Kumari  wrote:

> Hello team,
> please help me with this error.
>
> --
> 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/3e46fc90-4d92-4db9-abed-7733babf7d4dn%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/CACvpWio2hupV-zQf3RnHfFS097hDaS_JjB-n89_kagawq6e3VA%40mail.gmail.com.


Re: Checking API Results before saving

2022-09-02 Thread Ammar Mohammed
Hello ,

You can design a serializer for each api endpoint and use it in your view
to validate your data like validating forms data :
Pseducode :
res = requests.post(url+some_endpoint, data)
endpoint_serializer.validate(res.data)
if serializer.is_valid():
#do your stuff
else :
#do something

Best Regards

Ammar Mohammed

On Fri, 2 Sep 2022, 01:41 lone...@gmail.com,  wrote:

> Hello all,
>
> I am sending an GET request to an external API and I would like to
> validate the response before I save it to my model.  How do I do this?
>
> 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/0b724dc1-cb08-4168-8cc0-a5eac8a7c011n%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/CAHs1H7spUzCOMX%2BDs9%3D25ackprZ86GPBBBwS5a_ig9Ca%3DzTMog%40mail.gmail.com.