Extensive reading in English, it is a mentor to open and record the extensive reading notebook every time you read, and you cannot maintain your motivation. .. .. So I made the Extensive Reader a web application. What I made → https://tadokuapp.herokuapp.com/tadoku/
Since it would be dull to list dates, titles, words, etc. like a paper extensive reader, the number of words is displayed on the calendar. Also, the number of words read each month is output as a bar graph.
python3.7.6 Django3.0.3
Series of making calendars with Django I referred to this person's calendar. I really appreciate it. ~~ I can't make it myself ~~ The number of words read that day is displayed below the date.
For login and logout, use the one that comes standard with Django, and sign up yourself. Also, write html at the top of the page so that "Welcome (username), logout" is displayed when logging in and "Welcome gust, login" is displayed when logging out.
base.html
{% if user.is_authenticated %}
<a href="{% url 'accounts:logout' %}" class='user'>Welcome {{ user.get_username }}, logout</a>
{% else %}
<a href="{% url 'accounts:login' %}" class='user'>Welcome guest, login here!</a>
{% endif %}
Pass the book information of the user who is currently logged in in views to the template. Chart.js is used to draw the graph. In addition, the number of words (monthly and all two), the amount of increase in the number of words from the previous month, and the number of books read (monthly and all two) are displayed below the graph. I also added a tweet button. https://publish.twitter.com/#
I'm lonely with just the user name and user information, so I introduced the user rank ~~ (something like Atcoder's rate) ~~. The user rank is changed to gray, brown, green ... depending on the number of words read.
This is heroku. (I wanted to deploy with DigitalOcean, but I gave up because the payment is credit card or PayPal)
I started studying Django, so it took me an unexpected amount of time, but I'm glad it was completed. There are many improvements, such as speeding up by optimizing queries and introducing cache, and improving usability by improving social authentication and rates (such as lowering if skipped), so I will continue development.
Django is fun.
Recommended Posts