These are chat archives for django/django

5th
Nov 2016
Simon Frid
@fridiculous
Nov 05 2016 06:39
has anyone been ever dynamically set Storage objects with inherited models, while setting FileField columns?
I can do it with the upload_to param, because it can accept a callable, but i'm wondering about the storage param
Wagner Macedo
@wagnerluis1982
Nov 05 2016 14:43
People, the LocaleMiddleware can be parametrized? I mean, can I set to look language only in the session (and not in the cookie nor in the request header)?
Hammad
@hammadzz
Nov 05 2016 17:14

I am building a project in DJANGO and was reading the Two Scoops book. I am a bit confused if I should have two apps or one.

My project will have a RESTful API along with a frontend. The models will be shared between both. Should I make two apps or one?

Simon Frid
@fridiculous
Nov 05 2016 17:43
@hammadzz it depends on what you intend to do this your project. Ideally, you want smaller modular reusable apps in a single django project.
Hammad
@hammadzz
Nov 05 2016 18:09
I want my app to be able to create events with set locations and set groups by certain users. These events can be created and served through restful API.
@fridiculous
Simon Frid
@fridiculous
Nov 05 2016 19:11
so a web app isn't necessarily a django app, in django parlance
but based on what i'm hearing you say, you can do it muliple ways
you can make an api with django e.g. using django-rest-framework http://www.django-rest-framework.org/ . You can the write a second clientside app that will pull data from the django api
Simon Frid
@fridiculous
Nov 05 2016 19:17
you don't have to it that way, you can also build your templates and serve them with django as well @hammadzz