Live data from Hacker News

Django 3.2

djangoproject.com

141–150 of 195 posts

Re: Django 3.2

#141

Earlier quoted context omitted.

I had similar issues with Django where I felt that running on localhost was fine, but getting it production ready was a headache. Huge shoutout to dokku[1] which I used on my latest deployment and it makes it super easy. Lets encrypt support was the easiest I've seen and you redeploy with git push. [1] https://dokku.com/docs/getting-started/installation/

Interesting. How does dokku work with regards to mixed multi-hosting (Apache virtual hosting) on a server? For example, you have five sites, three are PHP and two are Django. Can it deal with that? Also a neat "for free" feature of CPanel hosting is that you get super easy email hosting. This can save a lot of money for small and medium businesses. While some would be interested in using Django on these systems, it i…

Dokku will allow you to host multiple applications on subdomains for which you can create CNAMEs in your DNS settings. Dokku is more of a mini self hosted Heroku without a dashboard so you'll lose out on cpanel features like email hosting.

But If you're not uncomfortable using docker, you can check out Cloudron [0] which handles email [1] and gives you access to quite a few web apps you can easily install on your server. It supports PHP app deployments [2] out of the box but for Django, you'll have to dig a bit deeper into their docs to learn how to deploy a custom docker based app [3].

[0] https://www.cloudron.io/

[1] https://docs.cloudron.io/email/

[2] https://docs.cloudron.io/apps/lamp/

[3] https://docs.cloudron.io/custom-apps/tutorial/

Re: Django 3.2

#142

Earlier quoted context omitted.

I had similar issues with Django where I felt that running on localhost was fine, but getting it production ready was a headache. Huge shoutout to dokku[1] which I used on my latest deployment and it makes it super easy. Lets encrypt support was the easiest I've seen and you redeploy with git push. [1] https://dokku.com/docs/getting-started/installation/

Interesting. How does dokku work with regards to mixed multi-hosting (Apache virtual hosting) on a server? For example, you have five sites, three are PHP and two are Django. Can it deal with that? Also a neat "for free" feature of CPanel hosting is that you get super easy email hosting. This can save a lot of money for small and medium businesses. While some would be interested in using Django on these systems, it i…

I am definitely not a dokku expert (for that I would recommend reaching out to their Slack channel[1] - a lot of great support for an open source project).

But in an attempt to answer your questions:

- Yes, you can host multiple sites on one server in dokku.

- That's a good point, I'm sure a lot of people like that about CPanel hosting. Maybe something like this poste.io implementation[2] would be what you are looking for?

- Dokku has the benefits of heroku but without the vendor lock in/pricing. Pick your preferred VPS host that runs for a few dollars a month and you are set.

[1] https://dokku.com/docs/getting-started/where-to-get-help/#th...

[2] https://github.com/D1ceWard/dokku-posteio

Re: Django 3.2

#143

Earlier quoted context omitted.

A couple of years ago(2014) I made my first Python website and really enjoyed, however when it was time to put it onlin I quickly discovered that setting up hosting and configuring it was as large a task in getting to know pip, env, unicorn, apache2 and a plethora of other software to host it, is this still the case? Becaue this is what keeps me of hosting websites with python.

I was in a similar position a few years ago too, until I forced myself to learn Docker. Now, all my projects are started from the same building blocks: Docker + Django + Gunicorn + Nginx + Postgres. And I love it. Now I have traefic at the top of My to-learn list so that I can host multiple projects in the same VPS. Last weekend I learned to use 11ty — the first static site generator I managed to grasp — and I'll ent…

If you don't want to go the docker route, there's a few Django boilerplates around with an Ansible configuration

Re: Django 3.2

#144

A couple thoughts on django as a long time user. First, the good: - Django was the first framework i learned when learning to code. It's documentation was amazing, and it made conceptualizing an MVC framework really easy. - Django's ORM is phenomenal for managing migrations of a relational database, especially postgres with stuff like jsonb. I've even included it in non-python projects, just to handle table migration…

How productive are you with FastAPI compared to Django? I’m thinking of things like forms, error handling and all the other extra stuff that comes with decoupling the frontend and backend.

Re: Django 3.2

#145
post #17

If anyone is curious I just updated my Docker / Django starter project to use 3.2. It uses Docker Compose + Django + Celery + PostgreSQL + Redis + Webpack + TailwindCSS and it's available at: https://github.com/nickjj/docker-django-example As an aside it's also using TailwindCSS 2.1 with the JIT compiler enabled.

Why celery and redis? Couldn’t you consolidate with just redis? Love the stack though

Celery describes itself as a "task queue" but I find it a bit confusing: it's a job manager, which needs a queue from which to pull/push jobs. Redis is this queue

Re: Django 3.2

#146

Any one have any pointers to learn the Django stack from the basics? Any specific video course or a book? "Two Scoops of Django" was recommended to me by someone on HN. I think it is currently being worked on for Django 3. It is on my reading list.

You can also check out William Vincent's books [0]. They're easy to read and follow.

A nice blog to also include in your django learning resources bookmarks is Simple is Better than Complex [1].

[0] http://wsvincent.com/books/

[1] https://simpleisbetterthancomplex.com/

Re: Django 3.2

#147
post #12

I'm more if a flask man myself. Worked with django only when I had to. Maybe I'm wrong?

Depends what you want to do, and why you're doing it. Very often when I make something in Flask, I end up with so many dependencies it might as well be Django (but without the cohesion). On the other hand, Django might be overkill in some situations (e.g. a small API without a relational database backend).

I think one common misconception is that Django can't be used in place of Flask when you want a minimalist set up. And to be fair, I used to think the same until I read Lightweight Django [0]. Their smallest django project code is just a couple of lines:

    import sys
    from django.conf import settings 
    settings.configure(
        DEBUG=True,
        SECRET_KEY='thisisthesecretkey',
        ROOT_URLCONF=__name__,
        MIDDLEWARE_CLASSES=(
            'django.middleware.common.CommonMiddleware',
            'django.middleware.csrf.CsrfViewMiddleware',
            'django.middleware.clickjacking.XFrameOptionsMiddleware',
            ),
        )
        
    from django.conf.urls import url
    from django.http import HttpResponse


    def index(request):
        return HttpResponse('Hello World')
        

    urlpatterns = (
        url(r'^$', index),
    )

    if __name__ == "__main__":
        from django.core.management import execute_from_command_line

        execute_from_command_line(sys.argv)

Granted, it's not as terse as Flask's hello world example but it's still quite short.

[0] https://www.oreilly.com/library/view/lightweight-django/9781...

Re: Django 3.2

#148

Earlier quoted context omitted.

This is awesome, thanks for sharing. I maintain a similar boilerplate (graphene + semantic ui). What's your take on Tailwind so far? I've found the lack of a react offering has really slowed me down.

The creators of TailwindCSS also have a paid offering called TailwindUI (just pre-created components with documentation for your application and marketing site) that has React support. It also comes with Figma mockups for each component. It's a bit pricy but very high quality.

I never used Tailwind but given its popular modern look, I wonder why there is a lack of open source React components built on top of it?

Re: Django 3.2

#149

A couple thoughts on django as a long time user. First, the good: - Django was the first framework i learned when learning to code. It's documentation was amazing, and it made conceptualizing an MVC framework really easy. - Django's ORM is phenomenal for managing migrations of a relational database, especially postgres with stuff like jsonb. I've even included it in non-python projects, just to handle table migration…

[deleted]

Re: Django 3.2

#150

Congratulations to the Django project and contributors on a big LTS release. And a huge thank you for the consistently excellent framework that so many have built their web dev careers on. I'll post this as a Show HN soon, but I'll mention it now as a soft-launch introduction. After a decade of using Django I started a project I always wanted to exist: backported security and bug fixes to old versions that the Django…

I genuinely love the fact that you have been able to build a company providing support for Django. I find that seriously inspiring.
Post reply on HN