Re: Can you people explain why the def _str_() method is used below?

2018-01-06 Thread James Schneider
https://docs.djangoproject.com/en/2.0/intro/tutorial02/#playing-with-the-api https://docs.djangoproject.com/en/2.0/ref/models/ instances/#django.db.models.Model.__str__ -James On Jan 6, 2018 8:32 PM,

Can you people explain why the def _str_() method is used below?

2018-01-06 Thread utpalbrahma1995
from django.db import models class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() def __str__(self): # __unicode__ on Python 2 return self.name class Author(models.Model): name = models.CharField(max_length=200) e

Select random blog post Object from "Post" Model and render In View/Template

2018-01-06 Thread Ronnie Raney
Greetings! My first time using this forum. Using Django 2.0 for a project. I'm a beginner so I appreciate your patience. I have a type of blog app, but I don't want the routing/url to be traditional. I want the user to be able to hit a button that says "Random Post" which takes them to a rando

MongoDB and Django

2018-01-06 Thread Mark Phillips
Is anyone on the list using MongoDB with Django? I see the MongoDB-django engine is no longer in active development, so I am not sure if I want to start using it as no one is supporting it. There are other python mongodb options, and some django rest mongo options. I am curious what, if anything,

How do I use Django to execute PostGIS query to get polygons within four points?

2018-01-06 Thread Tom Tanner
Here's a sample PostGIS query I use to get geometries within four points: SELECT * FROM myTable WHERE ST_MakeEnvelope(-97.82381347656252, 30.250444940663296, - 97.65901855468752, 30.29595835209862, 4326) && ST_Transform(myTable.geom, 4326); With this query, I can get all rows within

Re: StopIteration exception upon loading form template (url issue)

2018-01-06 Thread Luna Tuna
Okay, placed {% csrf_token %} in form and Remember to reload the page! Now my view function gets called. So {% url 'publish' %} is the only format that will work for me. On Saturday, January 6, 2018 at 1:07:04 PM UTC-8, Luna Tuna wrote: > > Now getting this: > > Forbidden (403) >> CSRF verif

Re: StopIteration exception upon loading form template (url issue)

2018-01-06 Thread Luna Tuna
Now getting this: Forbidden (403) > CSRF verification failed. Request aborted. > Help > Reason given for failure: > CSRF token missing or incorrect. > In general, this can occur when there is a genuine Cross Site Request > Forgery, or when Django's CSRF mechanism >

Re: StopIteration exception upon loading form template (url issue)

2018-01-06 Thread Luna Tuna
seems to work. \ o / -- 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 post to this group, send email

StopIteration exception upon loading form template (url issue)

2018-01-06 Thread Luna Tuna
My IDE highlights this line: and it has something to do with the url. I've tried mathdata:publish as well. My mathdata/urls.py is: urlpatterns = [ path('/', views.proof, name='proof'), path('content-edit//', views.content_edit), path('publish/', views.publish, name='publish') ]

Django Translation

2018-01-06 Thread prajwal.pathak2698
What is Django Translations? -- 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 post to this group, send email to djan

Disallowed User Agents | Force To upgrade

2018-01-06 Thread Ruchit Bhatt
In my new Django project, i am planning to use CSS Grid for template layout. To make site responsive without using bootstrap. So here i want to know how can i block or force to upgrade those browser which doesn't support CSS grid ?? For testing purpose i tried this in *settings.py* but noth

Re: Links to files

2018-01-06 Thread Jani Tiainen
If those files are really static you don't need Django to serve them (maybe on development phase). You shouldn't put those files in static files if files are not really static (created before your app is ever launched). If you create files on the fly, you probably better to serve them as a media fi

Re: Handling Celery Connection Lost Problem

2018-01-06 Thread Mukul Mantosh
I tried googling Matemática A3K but did not find any proper response but finally i came to know that i need to manage high availability redis or rabbitmq clusters. If there is any such option given by celery to simply skip the task if any broker fails then it would have solved my problem. Thank