Skip to content

Comment on Ask HN: How do you handle user-generated content in your apps?parent

Comments

We use Django's authentication, authorisation, and session management and it's rock solid. I can highly recommend it.

Did you have to create all the usual routes and views for the typical auth flow like signup, login, logout, change-password etc yourself?

I did a quick test like this:

    apt install -y python3-django
    django-admin startproject mysite
    cd mysite
    python3 manage.py migrate
    python3 manage.py runserver 0.0.0.0:80
And it serves a Django site but there seem to be no routes for users to sign up, log in etc.

The urls.py file contains only this one route it seems:

    urlpatterns = [
        url(r'^admin/', admin.site.urls),
    ]

Django provides views for all of these things that you can inherit from to customise if you want.

We happen to deviate from Django's norms enough that we've written our own, but there are a lot of benefits to basing your own on Django's because they have already solved some more subtle security issues like rotating session keys at the right stages.

I digged a bit deeper now and see Django indeed offers default views.

But it does not offer default templates, so you still have to write those from scratch, right?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.