A. Y. Jackson's Chess club website. Built using the Django framework with SQLite3 backend.
Features:
- Announcements with rich text editing
- Lessons with categorisation (beginner, intermediate, hard)
- Comments integrated with announcements, lessons, and tournament posts.
- Custom user profiles with user mention integration
- Chessboard.js integration
Prerequisites:
- Python (3 is recommended)
Make a virtual environment
$ mkdir django-site && cd django-site
$ python -m venv venv
$ source venv/bin/activate
Clone the repo
$ git clone
$ cd
$ pip install -U -r requirements.txt
Add the following to the environmental variables file (.env
). Make sure that you are in the project's root directory.
django_secret=
The following steps are important:
Comment out the urls.py
and views.py
files in app/
and members/
.
This is what is should look like.
views.py
# from foo import bar
...
# class HomeView(ListView):
# model = Announcement
# template_name = "pages/home.html"
# paginate_by = 5
# query_set = Announcement.objects.all()
# context_object_name = "announcements"
# ordering = ["-announcement_date"]
...
urls.py
# from foo import bar
urlpatterns = [
# path("", HomeView.as_view(), name="home")
]
In addition, comment out this particular section in models.py
class Lesson(models.Model):
"""
comment this ↓
"""
# difficulty_levels = lessonDifficulty.objects.all().values_list(
# "difficulty", "difficulty"
# )
# difficulty_levels_list = []
# for difficulty in difficulty_levels:
# difficulty_levels_list.append(difficulty)
"""
add this ↓
"""
difficulty_levels = 0
title = models.CharField(max_length=225)
author = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE)
difficulty = models.CharField(max_length=225, choices=difficulty_levels)
body = RichTextField(blank=True, null=True)
lesson_date = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title + "-" + str(self.lesson_date) + "-" + str(self.author)
def get_absolute_url(self):
return reverse("home")
After that, you can make migrations.
$ python manage.py makemigrations
$ python manage.py migrate
Before uncommenting everything else, create a super user.
$ python manage.py createsuperuser
Run the server
$ python manage.py runserver
Then go into the admin interface and add in the lesson difficulties: "Beginner", "Intermediate", "Advanced".
Then uncomment everything and run the server. Everything should work properly.
View on localhost:8000 or 127.0.0.1:8000
Requires some configuring to make it work, refer to the steps above
Prerequisites:
- Docker
- Docker Compose
To run the Django app without installing anything (assuming you have the prerequisites):
$ sudo docker-compose up --build
View on 0.0.0.0:8000
If you do run into trouble either setting it up, or using the website don't hesitate to open an issue. However, if you don't have a Github account, you can email @yak-fumblepack.
Contributions to this project are appreciated, feel free to make a pull request or open an issue should there be one. Please open the pull request against the dev
branch.
This project is licensed under MIT. See LICENSE file for more details.