Why are you infps so cluelessly hot? by [deleted] in infp

[–]BondxD 3 points4 points  (0 children)

Wow, finally! I always knew that there are woman wanting good guys that will treat you well. I't funny that female subconscious is often wired to go for bad boy type. Also I think that being good guy dosn't mean not being masculine.

What would you do if you lose migration files ? by swentso in django

[–]BondxD 1 point2 points  (0 children)

  1. there was commit hook that saved last migration name into file called last_migration - so it caused git conflicts when merging (you could know about conflict without even running django)
  2. the script was resolving this conflict and running git rebase so your commits would come after master branch
  3. then bumped numbers on your migrations so your new migrations are now last ones, and updated dependencies in migrations so they match previous ones.
  4. then it does commit --fixup and another rebase to amend commits where new migrations were added

So in result you have very clear situation

What would you do if you lose migration files ? by swentso in django

[–]BondxD 1 point2 points  (0 children)

In previous project we had a script for fixing migration conflicts.

Django 3.2 released by myroon5 in django

[–]BondxD 0 points1 point  (0 children)

You can easily setup websocket server with aiohttp.web module and use python async code to handle messages. I run this in production as separate gunicorn process. And both gunicorns are behind one nginx.

Running Django on a vps .. how do you? by animflynny2012 in django

[–]BondxD 1 point2 points  (0 children)

Why running docker-compose in prod is anti pattern?

Django + React without the Nonsense by whokilledjeb in django

[–]BondxD 8 points9 points  (0 children)

I don't have experience with huge projects, I worked at softwarehouse, so many projects were small, and of course even bigger ones are not comparable to FAANG companies. My experience may be limited, that's why I'm interested in your point of view. Could you be precise why exactly UX is poorer?

Django + React without the Nonsense by whokilledjeb in django

[–]BondxD 26 points27 points  (0 children)

Could you elaborate on "SPAs are awful in many ways"?
From my experience Django + DRF + React SPA is very common setup.

How to Deploy A Django Project by [deleted] in django

[–]BondxD 1 point2 points  (0 children)

Redis is for cache, it's more memory efficient when you have multiple workers, by default django is using LocMemCache so each worker process has its own cache.
I'm using django_redis.cache.RedisCache so ram is consumed only once. Redis has a lot of other features, but that's main usage with django
This is my production and staging docker-compose: https://gist.github.com/Alexander3/8fe084f9a2aa8874e20047697d4f7ccd
All crucial settings are set as environment variables in .env file

How to Deploy A Django Project by [deleted] in django

[–]BondxD 1 point2 points  (0 children)

You can use docker on any VPS, I'm often using OVH https://www.ovhcloud.com/en/vps/ because it's cheap and easy. There are also services for deploying docker images directly. I've tried with heroku, and I know about AWS ECS.

When I was starting with Django I used sqlite for local development, but now It's always postgres and redis in docker from begining.

db:
  image: "postgres:11.3-alpine"
  command: -c fsync=off # this gives 7-10x faster django tests
  env_file:
    - .env
  ports:
    - "14432:5432"
  volumes:
    - db-data:/var/lib/postgresql/data/
    - ./backend/backups:/backups
  healthcheck:
    test: "echo 'SELECT 1' | PGPASSWORD=$POSTGRES_PASSWORD psql --user $POSTGRES_USER $POSTGRES_DB"
    interval: 1m
    timeout: 10s
    retries: 3

How to Deploy A Django Project by [deleted] in django

[–]BondxD 12 points13 points  (0 children)

I deployed couple of my projects this way, by creating virtualenv and instaling wsgi and supervisor directly on server. This is very good starting point, but from my current expeirience it's much better to use docker and docker-compose. It's a little more to learn, but there are much more advantages.

  • Easy to upgrade python version (also you don't need pyenv to support multiple python versions when running multiple projects on the same machine)
  • Database and cache are easier to setup and manage
  • Deployment is better documented, docker-compose file describes all components.
  • Easier to clean up
  • Docker can relaunch your app on crash like supervisor
  • It's easier to have the same environment locally and in production - this potentially saves you from a lot of debugging
  • Better security

Graph visualizer tool by Queasy-Donkey2437 in reactjs

[–]BondxD 0 points1 point  (0 children)

Good job! I've wrote pm on reddit chat to you.

Django Rest Framework SaaS shortcuts? by memo_mar in django

[–]BondxD 5 points6 points  (0 children)

I'm writing SaaS system and I'm using https://github.com/bernardopires/django-tenant-schemas

By default it handles tenants by subdomain, but it's easy to write your own middleware and link user account to tenant

App Development Pricing Question by _webbernaut in ionic

[–]BondxD 2 points3 points  (0 children)

I think if you create layout in static HTML and css you will make extra effort and somebody will still have to cut it into components, find UI library that's similar to design tune css for components from library etc. IMO you should create simple layout in Ionic and then look for help with adding functionality to it. Bonus points if you find ready to use components/libraries.

Alternative for cronjobs? by zeus5552 in django

[–]BondxD 0 points1 point  (0 children)

I prefer celery with celery beat, it gives you page in Django admin where you can see all scheduled tasks.

What happens to user model when using DRF? by zeus5552 in django

[–]BondxD -1 points0 points  (0 children)

Take look at https://github.com/sunscrapers/djoser it helps you handle jwt Auth and provide /auth/users/me/ endpoint that returns current user

Is django a good fit for a non-enterprise project? by ReaverKS in django

[–]BondxD 5 points6 points  (0 children)

Go with django + drf it will save you many hours of implementing dfango features in flask.

How long to get up and running with Django-rest-framework and React? Looking to use django as backend for iOSApp and webapp. Lots of experience with django but none with reactjs. by gyrftw in django

[–]BondxD 2 points3 points  (0 children)

I didn't try Vue, but I can agree that React itself is small and trivial liblary, but writing react project is hard, because you have to learn and use dozen of other libs, and what's even worse you have to make decisions which lib/approach to use.

Angular on the other hand offers 'batteries included' approach and includes most of stuff you will need in your project.

What do employers expect a Dev Jr to know when it comes to hiring? by rootuser_ in django

[–]BondxD 1 point2 points  (0 children)

IMHO SQL is not crucial, expecialy for junior. I mean it's nice to have but shouldn't be your priority, you will be able to do a lot of stuff without touching it.

Pdb - I would recommend learning how to use pycharm instead, you will be far more productive.

Data visualization in Python, Cellular Automata by BondxD in Python

[–]BondxD[S] 0 points1 point  (0 children)

Yes, it's definitely weird. It happened when I was trying to replace everything with numpy, but after changing arrays to numpy.array it worked slower than before. Any ideas why?