4.2 KiB
About
Cedar-Django is a fork of Closedverse with custom features added to it.
Theme changing
Just like in Indigo, you can change the color of your theme. While this is only visible to each user specifically, a global theme can be set in Settings.py.
Overhauled admin panel
The admin panel has been changed completely. You can now do a lot more things in a much easier way. The intention behind this redesign is to reduce the need to use the normal Django admin panel.
Community creation
You can have your users make communities. Each user by default can make one community. User communities can be changed by the owner of said community.
Password resetting within the settings page
This should've been a thing since day one. Instead of being forced to reset your password through your email, you can now change it via settings.
Admins can change the sidebar on the front of the page.
There are two types: welcomemsgs and MOTDs
welcomemsgs are visible on the front page when you aren't signed in.
MOTDs are visible when signed in.
Other features include:
- Mods can warn users.
- Better audit logging system.
- Purging is much easier now.
- You can fucking ban people now without the Django panel.
- Each and every ban is an IP ban automatically.
- A page where every user can view collected data tied to their account.
Can you rewrite this?
YOU NEED
- Cloudflare
- A server (obviously)
- Terminal access (also, obviously)
- Python 3
Install time
SSH into your server.
Time to update
sudo apt update && sudo apt upgrade
You need Pip
sudo apt install pip
Get everything else you need.
pip3 install Django==3.2.2 urllib3 lxml passlib bcrypt pillow django-markdown-deux django-markdown2 whitenoise django-colorfield django-admin-interface
Clone the clone!
git clone https://github.com/Mistake35/Cedar-Django
5.5 (recommended). You should use FileZilla or some other SFTP client to make things easier in the future.
Navigate to Cedar-Django
cd Cedar-Django
Edit the settings.py file.
nano closedverse/settings.py
Fill everything out as needed. Be sure to generate a secret key and paste it in too.
Now it's time for the good stuff!
Let's build the database
python3 manage.py migrate
Do the static files or no CSS or JS.
python3 manage.py collectstatic
Test the server!
Be sure to replace "IP-HERE" with your public IP and make sure it's running on port 80.
python3 manage.py runserver IP-HERE:80
Troubleshooting time!
Q: "HELP, I'M GETTING A BAD REQUEST (400) ERROR!"
A: Add your public IP to the ALLOWED_HOSTS bit in settings.py along with your domain that you'll be using.
Q: "django.db.utils.OperationalError: no such table: ban_usersban" A: You forgot to migrate and make the database.
Q: "Why is the page white, with no color or style at all?" A: You need to collect the static files as mentioned prior.
Q: "KeyError: HTTP_CF_CONNECTING_IP" A: Cloudflare is needed for this shit to work properly.
You may have to do some additional troubleshooting, and that's the joy of web-hosting. Fixing problems yourself is a great way to learn how this shit works.
Yet even more steps
So your server is running, the URL works and everything? Good.
Now it's time to create your account.
python3 manage.py createsuperuser
Enter your username, and password.
Make sure it's working by signing in.
Alright now it's time to do some fun stuff! We're going to try and make this run at boot with systemd.
sudo nano /etc/systemd/system/django.service
Paste this in! Now it's time to change this if needed.
[Unit]
Description=Django Application
After=network.target
[Service]
User=root
WorkingDirectory=/root/Cedar-Django
ExecStart=/usr/bin/python3 manage.py runserver IP-HERE:80
[Install]
WantedBy=multi-user.target
Pop these in!
sudo systemctl daemon-reload
sudo systemctl enable django
sudo systemctl start django
Make sure it works too!
sudo systemctl status django
The final stretch! Set up your server with Cloudflare. You need a domain name, and you need patience, as this can take some time to take effect. If you do this final step right, Cedar should be working fine, and it should have HTTPS working too!