Skip to content

Commit

Permalink
EDIT settings.py & _base.html
Browse files Browse the repository at this point in the history
  • Loading branch information
BrilliantPhoenix2024 committed Jul 27, 2022
1 parent 2d5a990 commit f4c0dfa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 4 additions & 2 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

# Authentication settings
AUTH_USER_MODEL = 'accounts.CustomUser'
LOGIN_REDIRECT_URL = 'home'
LOGIN_REDIRECT_URL = 'book_list'
LOGOUT_REDIRECT_URL = 'login'

# crispy forms setting
Expand All @@ -144,7 +144,9 @@

# static files config
STATIC_URL = '/static/'
STATICFILES_DIR = [str(BASE_DIR.joinpath('static'))]
STATICFILES_DIRS = [str(BASE_DIR.joinpath('static'))]





Expand Down
16 changes: 12 additions & 4 deletions templates/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-info" dir="rtl">
<div class="container">
<a class="navbar-brand" href="#">
<img src="icons/book.png" alt="" height="30"
<img src="{% static 'icons/book.png' %}" alt="" height="30"
class="d-inline-block align-text-top">
</a>
<a class="navbar-brand mx-3" href="#">کتاب یار</a>
Expand All @@ -29,11 +29,19 @@
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link active" aria-current="page" href="#">خانه</a>
<a class="nav-link" href="#">اضافه کردن کتاب</a>
<a class="nav-link active" aria-current="page" href="{% url 'book_list' %}">خانه</a>
<a class="nav-link" href="{% url 'book_create' %}">اضافه کردن کتاب</a>
</div>
</div>
<div class="mx-2 text-white">خوش آمدی محمدهادی | <a class="link-light text-decoration-none" href="#">خروج</a>
<div class="mx-2 text-white">
{% if user.is_authenticated %}
خوش آمدی {{ user.username }} |
<a class="link-light text-decoration-none" href="{% url 'logout' %}">خروج</a>
{% else %}
<a class="link-light text-decoration-none" href="{% url 'login' %}">ورود</a>
|
<a class="link-light text-decoration-none" href="{% url 'signup' %}">ثبت نام</a>
{% endif %}
</div>
</div>
</nav>
Expand Down

0 comments on commit f4c0dfa

Please sign in to comment.