From 86dcc2ecef38d63babde68da9720ac327302bb4f Mon Sep 17 00:00:00 2001 From: minihoot <70825884+minihoot@users.noreply.github.com> Date: Sun, 18 Jan 2026 21:30:46 +1100 Subject: [PATCH] Add instructions for setting it up with MySQL/MariaDB, add updating Django to an idea for README.foreskin, add requirements.txt and update README to use it --- README.foreskin | 1 + README.md | 15 ++++++++++----- closedverse/settings.py | 12 ++++++++++++ requirements.txt | 11 +++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 requirements.txt diff --git a/README.foreskin b/README.foreskin index ba52ce0..1480fad 100644 --- a/README.foreskin +++ b/README.foreskin @@ -30,3 +30,4 @@ Ideas: - "Muting" feature to replace "active" - Make it, so you need to enter your current password to change your email address. - Ways for mods to view who invited who easily. +- Update Django, possibly. diff --git a/README.md b/README.md index a459c5a..63e3190 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ You need Pip 4. Get everything else you need. -`pip3 install Django==3.2.2 urllib3 lxml passlib bcrypt pillow django-markdown-deux django-markdown2 whitenoise django-xff django-cleanup` +`pip3 install -r requirements.txt` 5. Clone the clone! @@ -210,10 +210,15 @@ Q: "I'm using a Cloudflare tunnel." A: Go to Zero Trust, Networks, Overview, Manage Tunnels, View Tunnels, click the 3 dots next to your tunnel that is running Cedar-Django, Configure, Published application routes, Add a published application route, select your domain, and for the service set the type as HTTP with the URL `127.0.0.1:8000` (or `127.0.0.1:80 if you're using the reverse proxy). Make sure your domain is in ALLOWED_HOSTS! -Q: "I'm having trouble, how can I contact you?" - -A: You should use the Issues. That way, if anyone has the same problem as you and you manage to solve it, they can also solve it using your solution. - Q: "How do I edit pages?" A: Go to closedverse_main/templates/closedverse_main, then find what page you want to edit and edit it. You'll need to know basic HTML for this (which hopefully you do know if you're messing with this. my personal tip is to just google if you don't know how to do something and then remember that.) + +Q: "How can I set this up with MySQL/MariaDB?" + +A: By default, this project uses SQLite. To use MySQL or MariaDB (instructions are the exact same since MariaDB is a drop-in replacement for MySQL): Install default-libmysqlclient-dev with `sudo apt install default-libmysqlclient-dev`, run `pip3 install mysqlclient` then go to closedverse/settings.py and comment out the DATABASES with `backends.sqlite3` and uncomment the DATABASES with `backends.mysql`. After that, fill out the NAME, PASSWORD, HOST and PORT accordingly. + +# I'm having issues setting this up, how can I contact you? +**If your problem is with a website that is using Cedar-Django, then contact the owner of that website, an administrator or a moderator. This repository is unrelated to any Cedar-Django instances.** + +If you're having issues setting this up, then make an issue, so that if you solve your issue anyone that has the same issue as you will be able to (hopefully) solve it with your solution. diff --git a/closedverse/settings.py b/closedverse/settings.py index 2213a50..19d2e97 100644 --- a/closedverse/settings.py +++ b/closedverse/settings.py @@ -99,6 +99,18 @@ DATABASES = { 'NAME': os.path.join(BASE_DIR, 'sql.sqlite3'), } } +# Uncomment the below and comment the above DATABASES to use MySQL instead of SQLite. +#DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.mysql', +# 'NAME': 'database-name', +# 'USER': 'username', +# 'PASSWORD': 'user-password', +# 'HOST': '127.0.0.1', +# 'PORT': '3306', +# } +#} + # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..89cfe50 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +Django==3.2.2 +urllib3 +lxml +passlib +bcrypt +pillow +django-markdown-deux +django-markdown2 +whitenoise +django-xff +django-cleanup