Static files configuration

2019-12-18 Thread Yash Garg
I have to display a HTML page with its supporting css, js and images. So i create a template folder to put HTML in it then i create a static folder in which i create css, js and img folder and put related files into these folders. then I configure the *Settings.py* BASE_DIR = os.path.dirname(os

How to get Latitude and Longitude of a user

2019-12-27 Thread Yash Garg
I want to get Latitude and Longitude of a user to store in my data model fields- latitude= models.FloatField(default=0.0) longitude = models.FloatField(default=0.0) How can i do this without using Google API. -- You received this message because you are subscribed to the Google Gr

How can i update a choice value in Model Field

2019-12-30 Thread Yash Garg
in models.py i have choices in a field- APPROVAL_CHOICES = ( ('APPROVED', 'Approved'), ('PENDING','Pending'), ('REJECTED','Rejected'), ) approval_status = models.CharField(_("Approval Status"),max_length=8,null=False,blank=False,choices=APPROVAL_CHOICES, default='Appr

How to do SEO for my django website

2020-01-03 Thread Yash Garg
Is there any package or module available for SEO of django website ? -- 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. T

Re: How to do SEO for my django website

2020-01-03 Thread Yash Garg
rollyourown.seo in not compatible with latest version of django On Friday, January 3, 2020 at 6:18:11 PM UTC+5:30, sagar ninave wrote: > > https://django-seo.readthedocs.io/en/latest/introduction/tutorial.html > > > On Fri, Jan 3, 2020 at 6:11 PM Yash Garg > > wrote: >

Full Stack Developer (Python/Django) position requirement for US GC/Citizen/Can Citizen

2020-01-03 Thread Yash Garg
For a large multi billion dollar Publishing house in New York, client needs a Full Stack Django Developer with 3+ years of solid Python/Django experience Scope: - Code refinement/linting/unit testing - Django application development - Data ingestion, data transforms - API develop

JSONDecodeError

2020-01-06 Thread Yash Garg
JSONDecodeError Exception Value: Expecting value: line 1 column 1 (char 0) why i'm getting this error? views.py- ip_address = request.META.get('HTTP_X_FORWARDED_FOR', '') response = requests.get('http://freegeoip.net/json/%s' % ip_address) geodata = json.loads(response) print(geodata['ip'])

"This field is required." error in REST

2020-01-11 Thread Yash Garg
I have created a User registration rest api app views.py- class UserRegister(APIView): throttle_classes = [UserRateThrottle] def post(self, request, format='json'): serializer = UserRegisterSerializer(data=request.data) if serializer.is_valid(): user = serializer.save() if user: return Response(

Re: makemessages fails

2020-02-12 Thread Yash Garg
Have you specified path to Locale directory in settings.py? On Wednesday, February 12, 2020 at 7:51:53 PM UTC+5:30, Yves de Champlain wrote: > > Hi > > When I run > > django-admin makemessages -l fr > > I get > > Traceback (most recent call last): > > File > "/opt/miniconda3/envs/cert_tool/l

Re: makemessages fails

2020-02-12 Thread Yash Garg
_DIR > > LOCALE_PATHS = [ > PROJ_DIR('locale'), > ] > > Could it be the source of the problem ? > > Thanks ! > > > > Le mercredi 12 février 2020 12:53:06 UTC-5, Yash Garg a écrit : >> >> Have you specified path to Locale directory in settings.py?

NoReverseMatch at /sitemap.xml

2020-02-19 Thread Yash Garg
When i'm loading sitemap.xml for my site i'm getting this error Reverse for 'blog-detail' with arguments '('This is my title slug', '2020', '2', '19')' not found. 1 pattern(s) tried: ['blog\\/(?P[0-9]+)\\/(?P[0-9]+)\\/(?P[0-9]+)\\/(?P[-a-zA-Z0-9_]+)$'] sitemap.py class BlogSitemap(Sitemap):

Re: NoReverseMatch at /sitemap.xml

2020-02-22 Thread Yash Garg
Please help me to resolve this issue. On Wednesday, February 19, 2020 at 10:13:07 PM UTC+5:30, Yash Garg wrote: > > When i'm loading sitemap.xml for my site i'm getting this error > > > Reverse for 'blog-detail' with arguments '('This is my tit