These are chat archives for django/django

10th
Apr 2016
Michal Haták
@Twista
Apr 10 2016 14:37
Hello, is it possible to have project-base template which can be used by installed apps ?
Dr M. Kaddour YAHYAOUI
@tuxador
Apr 10 2016 14:40
Try cookiecutter from Fortin @Twista
Michal Haták
@Twista
Apr 10 2016 14:46

definitely will take a look, but its too complex atm i think. i just started with django and trying to build dummy stuff to learn how it works under the hood
i’m trying to make something like

- project_name
    - templates
        - layout.html
    - app_one
        - templates
            - app_one
                - index.hml

where index.html will use (extend) layout.html and i’m still getting TemplateDoesNotExist error

Michal Haták
@Twista
Apr 10 2016 15:02
ha, found it. i had absolute path in DIRS in config
Puneet Aggarwal
@puneetagg
Apr 10 2016 16:39
Hello everyone..
Which is the best Django package for third party logins like Facebook? I am using DRF for all REST APIs at backend and Satellizer package in AngularJS SPA at front end.
cs89gr
@cs89gr
Apr 10 2016 17:21

hello
i want to show some dynamic places in my web site and i follow this toturial geojson geojson

#models.py
class MushroomSpot(models.Model):
geom = PointField()
description = models.TextField()
picture = models.ImageField()

@property
def popupContent(self):
  return '<img src="{}" /><p><{}</p>'.format(
      self.picture.url,
      self.description)
#MushroomSpot is the ForeignKey to other models in my model admin.py
#admin.py
from leaflet.admin import LeafletGeoAdmin
admin.site.register(MushroomSpot,LeafletGeoAdmin)

all work without error code. but in my admin(administrator page) i cant to add points because dont show me the map.
alt

Peter Bittner
@bittner
Apr 10 2016 20:50
@puneetagg django-allauth, or python-socialauth
Ibrahim Ahmed
@ibz096
Apr 10 2016 21:15
hi. I am following the Django tutorial at tutorial.django.org . I am looking at the method str(): and I am wondering what it does ?
Evgeniy
@evgeniy-klemin
Apr 10 2016 22:21
@gmwill92 general communication between backend and frontend is REST API, for django packages: django REST framework, tastypie and othes. Many models from frontend frameworks can send REST requests, or have plugins for that.
Adam Collins
@adc82
Apr 10 2016 23:07
@ibz096 it's invoked in various situations when you need to convert your model to a string. For example if you print an instance of your model whatever is returned in the method will be displayed. One of the most notable places you'll see it is in the admin panel. If you don't specify a str method you'll see the same string for each instance of the model, which can be confusing. It's often uselful to return some identifying string in the method, so you can differentiate between the instances.
Dr M. Kaddour YAHYAOUI
@tuxador
Apr 10 2016 23:31
Hi I'm just asking. How to reload(os) in the settings.py file?
Iforgot to' import os ' first, and even after adding the line in settings i 'm stuck with errorname bug