Kubusnet
Main development directory (base): dev/dkbn2
.
Main entry point: dev/dkbn2/dkbn2/settings.py
(check names of database user, etc.).
Example server (to see what works right now): https://kubusnet.loca.lt/
Deployment is on linux, but I also got it to work on windows.
Getting started:
- Install python. I am using python 3.9 and 3.8 (development/deployment). I don't think 3.11 has issues
- I use most recent versino of django (4.x)
- I use pycharm, but it is not important. If you use pycharm, start project at another location on your computer, and add the kubusnet directory as a sources location in the project structure (ctrl+alt+s). This will make sure your pycharm config files are not commited to the repository and will cause conflict. Pycharm has a web-development-extension in the professional version, but I am not seeing a ton of benefit, and I have not gotten the debugger to work with Django (but if you can, it will help you a lot).
- Run the django guide for the first webapp using postgresql as backend:
- Then clone this repo using
git clone
.push
/pull
very frequently to main branch to avoid conflicts, as I will likely also make changes. - run
pip install -r requirements.txt
to get most dependencies. Keep this up to date if you spot something that is missing. - Add a configuration specific to your computer to
settings.py
(check how I have two settings for linux/win right now). This will allow us to use a single branch. Use same user/password for postgresql for simplicity. -
python manage.py migrate
actually installed all tables in the db for me on the deployment server. I am not familiar with themakemigrations
/migrate
stuff beyond this, it is a new thing in Django. -
python manage.py check
will check install. This should give an ok. -
python manage.py runserver
should work (as in the guide). Your first (admin) user will not have a profile, but this will be automatically created the first time you try to select a project. - Use admin panel to add users/project. Do this by first creating a project, then use mass
add user
functionality (bottom link). This will generate passwords, etc. correctly.
Fixing bugs
- The code used to work, so the root cause of bugs are changes in Django since 0.9.x and libraries changing. Right now all generic views must be changed (from functional to class-based), and many/all urls are broken. These are reasonably easy to fix by using standard guides for upgrading between django versions and naming urls in
urls.py
. Note templates must be updated as well to use the new names (as in the tutorial). - First goal is to get the main pages working (meetings, communication, tasks, notepads, mindmap). Most will hopefully be very quick individually, but overall it will require a lot of work.
- I had to re-order the code into many web-apps to get it to work which is not optimal; the code layout is pretty wonky, as is the location of templates, etc. We just have to live with that.
- Note the code was written for an old version of python and some of it is pretty bad because I was learning python at the time. UTF8 encoding also used to be a problem in older versions. Most strange things are not clever, they are just strange.
- I think the biggest problems will be in changes to Djangos models, and changes in javascript libraries. I had to update
jquery
to get the datapicker to work, and there are a few places where I usejquery
for dynamical stuff. The file upload may also cause problems. - Once the main things work, we need to fix some of the UI issues that has cropped up (help pages spill into html, forms that are organized poorly)
- Then remove functionality that is not necesary anymore/simplify. Probably a good idea to print out all pages and pin them to a bulletin board to get an overview of current functionality.
Notes:
postgres (win) postgres / gummiand port: 5432 Postgres user for kubusnet: kubusnet/gummiand. Database name: kubusnet.
kubusnet_media is user uploaded files kubusnet_static is (development) static files kubusnet_static_col is automatically generated using
Use this to create admin login user (tue/gummiand)
python manage.py createsuperuser
python manage.py collectstatics python manage.py check