Departure from our old symfony internal site
There are two ways to get symfexit running locally:
Both are described below.
If your editor supports devcontainers this is the easiest way to start working.
The specifics vary between editors, but you probably need to install a plugin or extension to support devcontainers. For VSCode, you need the Remote - Containers extension.
On your machine you need to have Docker installed.
Then, the steps are as follows:
- Clone the repository:
git clone https://github.com/roodjong/symfexit.git - Open the repository in your editor.
- You should see a notification that a devcontainer configuration is available. Click on the notification to open the repository in a devcontainer.
- The devcontainer will build and start, and you will be in a shell inside the devcontainer.
You may need to configure VSCode to use the .venv uv created, so that Pylance can follow the dependencies.
Continue following the first time setup steps below.
The recommended setup for running symfexit locally is to use uv
Of course, you can use other tools for working with Python, but the instructions below are for uv.
- Install uv following their instructions: https://docs.astral.sh/uv/getting-started/installation/
- Clone the repository:
git clone https://github.com/roodjong/symfexit.git - Change into the repository:
cd symfexit - Run
uv sync --python 3.13 --devto install the dependencies.uvwill also install Python 3.13 for you. A virtual environment will be created at.venv. - Source the virtual environment:
source .venv/bin/activate(this differs per shell, for example for fish it issource .venv/bin/activate.fish)
You now have the Python environment set up. You also need a local database. Use your preferred way to install PostgreSQL, only version 17 is currently recommended, as symfexit is known to work with it.
By default settings.py is configured to connect with your unix user to the database symfexit.
If you want to use this setup, you need to have a PostgreSQL user with the same name as your unix user, and a database named symfexit owned by that user.
brew install postgresql@17
LC_ALL="C" /opt/homebrew/opt/postgresql@17/bin/postgres -D /opt/homebrew/var/postgresql@17If you installed PostgreSQL on MacOS using Homebrew, you already have a user with the same name as your unix user. In that case you only need to create the database.
You also probably need to install libmagic separately:
brew install libmagicOn Linux, you probably have to prefix the commands with sudo -u postgres.
You may also have to start the PostgreSQL service with sudo systemctl start postgresql.
# On linux, you may have to prefix these with sudo -u postgres
createuser $(whoami)
createdb -O $(whoami) symfexitIf you have different users for PostgreSQL, you can set the DATABASE_URL environment variable to the correct value.
The default value is postgres:///symfexit.
You need to have Node.js installed. The version of Node.js is not very important. Tailwindcss says it should work with a Node version of 12 or higher, but you can install your distribution's default version as it should probably work.
Then, you can install the dependencies with:
cd symfexit/theme/static_src
npm installTo start the server, run:
python manage.py developIf you haven't started the server before, the command will prompt you to run the migrations. You can do this by running:
python manage.py migrateThis will start the webserver, the worker for the background tasks, and the watcher for Tailwind.
Whenever you make changes to the Python code, the server will automatically reload. The watcher for Tailwind will also automatically rebuild the CSS.
To test emails and how they look, you can also use mailhog. Run mailhog in a docker and approach it on localhost:8025
docker run -p 8025:8025 -p 1025:1025 mailhog/mailhogAnd add these config in settings.py
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_URL = "127.0.0.1"
EMAIL_PORT = 1025All strings are currently in English by default, and have localizations to Dutch. To translate newly added strings, you need to do the following steps:
- Generate the list of strings to be translated by running:
python manage.py makemessages -l nl-
Translate the strings in the
django.pofiles. Django tries to guess the translations based on previously translated strings. These translations are labeled with "fuzzy", and are ignored when compiling. So after checking and correcting these translations, the "fuzzy" tag should be removed. -
Compile the translation files:
python manage.py compilemessagesMore information can be found on the Django documentation site: https://docs.djangoproject.com/en/dev/topics/i18n/translation/