, 21 tweets, 9 min read Read on Twitter
@webology @rixxtr @pystar @wsv3000 @epicserve @carltongibson I use cookiecutter which is better than no out of the box experience

What i would like:

1. have 1 simple way to run in 3 modes: localhost, cloud production, on-premises (I modified cookiecutter to have a production-cloud.conf, a production-onpremises.conf, and a local.conf
@webology 2. DRF first class citizen because nowadays API first or decoupled apps are the way to go

3. easy way to use celery (i paid someone to help me setup)

4. easy way to use channels ( about to pay someone to help me)
@webology 5. easy way to use frontend tech like react (I create a new app called frontend and setup a template there calling a dist/main.js)

For production, I use `npm run install` and `collectstatic`

6. easy way to use ssl (cloudflare/letsencrypt i use cloudflare)
@webology 7. easy way to use partial index (i use django-partial-index)

will add more later. To be continued
@webology 8. default to use custom user model

9. default to use strings when call other models as foreign keys to reduce circular imports

`product = models.ForeignKey("products.Product", on_delete=models.CASCADE)`

instead of
@webology `product = models.ForeignKey(Product, on_delete=models.CASCADE)`

10. easy way to use soft delete (I use model_utils)
11. easy way to use timestamped model (I use model_utils)
12. easy way to setup a created_by_id, modified_by_id (i write my own called personstamped)
@webology 13. easy way to use status (I use StatusModel in model_utils)
14. easy way to use activate (I use from django_extensions.db.models import ActivatorModel)
15. default way to import data from excel sheets (I use pandas and openpyxl as a mixture)
@webology 16. provide multiple ways to setup email server (1 for onpremises email server, 1 for cloud service like AWS SES, etc)
17. easy default way to write code that generates email (1 eg for text email, 1 for html email 1 for attachment)
@webology 18. easy way to setup user generated content files (1 for on prem served via nginx, 1 for using S3, 1 for localhost)
19. easy way to setup static files (1 for on prem served via nginx, 1 for using cloud CDN, 1 for localhost)
@webology 20. easy way to setup for multi tenancy ( i write my own heavily inspired by github.com/agiliq/buildin…
@webology something like this:
```
class OrganizationOwnedMixin:
@cached_property
def organization(self):
return Organization.objects.get_organization(self.context["request"])
```
@webology 21. Organization (which is the model for tenant) has multiple domains because staging & production & so on
`
class OrganizationQuerySet(models.QuerySet):
def get_organization(self, request):
return self.filter(domains__name=hostname_from_request(request)).first()
`
@webology by the way, i didn't write the code exactly i did do my own research and hired someone to write it the way i want for multitenancy
@webology 22. easy way to generate reports

by reports I mean just a giant excel table that contains columns with custom header names but the data inside is a data column from my postgres

I have my way but twitter not suitable for me to sahre the code

23. the opposite of 22
@webology basically a way for non-tech users to mass upload data then each column is mapped to a specific column in the database.

in terms of UI i use handsontable the mapping part is another gnarly ball of code not easy to share on twitter. maybe next time
@webology This mass upload is for add. not edit. Which is another headache I haven't solved.

Yet.

I will get there someday.
@webology To be continued and I will continue.

I have to get back to lunch/work cause deadlines
@webology 24. default to use allauth (tho I have yet to use django for consumer facing apps)

25. default to use multiserializer in DRF because sometimes u want list serializer and retrieve serializer to fetch different fields

I use the code from stackoverflow.com/a/22922156/803…
@webology 26. default such that JSONField uses `JSONField(default=dict)` instead of `JSONField(default={})` and `JSONField(default=list)` instead of `JSONField(default=[])`

See docs.djangoproject.com/en/1.11/ref/co… for details

I made this mistake for months before realizing it
@webology 27. default to use pytest as unit testing library for django or make it insanely easy to boot up first test in pytest

28. it's easy to write a gigantic `models.py` so make it even easier to write many, many small app folders (not sure how)
@webology 29. make it easy to use ipdb for debugging (tho recently I have issue with ipdb on 2.2)

30. default to use pactman for consumer driven contract (because trending towards microservices and API first world and e2e tests are slower) github.com/reecetech/pact…
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to KimSia Sim 🇸🇬💻📗
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!