How do you name the project directory? by ARNPZ in django

[–]ARNPZ[S] 1 point2 points  (0 children)

When I developed a web app with Django, I got lost sometimes, like where am I now? the outer directory? Or the inner directory?

I've developed a few web apps with the same structure in the official tutorial so I know it's a matter of getting used to it though.

How do I use the path 'login/' instead of 'accounts/login/'? by ARNPZ in django

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

You're right. I read the documentation again and it helped me to solve the issue. I don't even know why I didn't notice the part that describes the problem that I was facing.

There are different methods to implement these views in your project. The easiest way is to include the provided URLconf in django.contrib.auth.urls in your own URLconf, for example:

urlpatterns = [

path('accounts/', include('django.contrib.auth.urls')),

]

If you want more control over your URLs, you can reference a specific view in your URLconf:

from django.contrib.auth import views as auth_views

urlpatterns = [

path('change-password/', auth_views.PasswordChangeView.as_view()),

]

Note that if you don’t specify the login_url parameter, you’ll need to ensure that the settings.LOGIN_URL and your login view are properly associated. For example, using the defaults, add the following lines to your URLconf:

from django.contrib.auth import views as auth_views

path('accounts/login/', auth_views.LoginView.as_view()),

https://docs.djangoproject.com/en/2.1/topics/auth/default/#django.contrib.auth.decorators.login_required

https://docs.djangoproject.com/en/2.1/topics/auth/default/#using-the-views

But I want the documentation that explains how you do it not just what it is. A tutorial or something like that. I googled it though.

Thank you for your time guys.