- Python 70.2%
- HTML 19.3%
- SCSS 8%
- JavaScript 2%
- Shell 0.3%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
CI for Duk Op / ci (push) Has been cancelled
Reviewed-on: https://codeberg.org/dukop/django-dukop/pulls/153 |
||
| .forgejo/workflows | ||
| media | ||
| src/dukop | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .travis.yml | ||
| deploy.sh | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| LICENSE | ||
| manage.py | ||
| MANIFEST.in | ||
| pytest.ini | ||
| README.md | ||
| setup.cfg | ||
| setup.py | ||
dukop.dk
Collaborate calendar for local spheres, such as "DukOp Copenhagen" or "DukOp Århus".
Development (Docker)
If you don't have Docker, skip to the next section.
# Create the database
docker compose run app /app/manage.py migrate
# Create your own superuser
docker compose run app /app/manage.py createsuperuser
# Create some events (re-run this later if you need more!)
docker compose run app /app/manage.py calendar_fixtures
# Run the server, now go to http://127.0.0.1:8000
docker compose up
Development requirements (no Docker)
What you are now looking at is a Python package, structured as a Django project. The various other Python packages that it depends on will be installed while you install the package itself.
These are the system requirements necessary for running the below Quickstart:
- Python 3.10+ (is already on your system)
- Postgres (only for deployment, not needed for development)
Other requirements are specified as Python packages in the Quickstart below and will be installed in a virtual environment.
Quickstart
Install the project and the development dependencies into a virtual environment:
From a commandline, run:
# Create the virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate
# Upgrade to the latest Python dist tools (pip etc)
python3 -m pip install --upgrade pip setuptools wheel
# Install the package in development mode, meaning that you can keep editing
# the sources and not have to re-install.
python3 -m pip install --editable ".[dev]"
# Run the migration script to create the database
python3 manage.py migrate
# Create a superuser account so you can also log in for the first time.
python3 manage.py createsuperuser
# Generate some random event data
python3 manage.py calendar_fixtures
The development environment is now ready with an empty database and a single
admin user. To run the server and access it from your browser, use the
runserver command:
./manage.py runserver
After running the server for the first time, consider logging in on http://127.0.0.1:8080/admin/ to create some data for development.
Updating from git
Once in a while, you will probably pull the latest master. In this case, you could need to run the migration script in order to update your local development database:
./manage.py migrate
Running tests
More details to come, but for now, just open a PR and wait for Travis or run this:
pytest
Starting a New App
First create a new directory in the apps directory:
mkdir src/dukop/apps/name
Then pass the path to the new directory to the startapp command:
mkdir src/dukop/apps/<name>
python manage.py startapp name src/dukop/apps/<name>
API
On https://dukop.dk/api/v1/, you'll find Duk Op's API endpoints.
It's very basic and needs requests from users of the API to improve.
You can access API docs here:
In order to test the API, please always create unpublished events.
All endpoints are private, so you need to generate a user token to access them.
Tokens are created on /users/tokens/.
The API is intended for creating events.
- Create an event with times
- Upload an image to an event
- Edit an event (but not the times)
It is strongly suggested that users go to the website, check all auto-created events and publish them manually.
We can probably add more, but it's pretty minimal for now.
- Edit event times
- Create/edit recurring series
However, these are pretty advanced uses, which are probably better for users to do manually on the site.