FAQ
Last updated
Last updated
Table of contents:
There are often a case when CSS is not being loaded properly on development. Why is this happening :thinking:? If we look at Network tab in Developer Tools, we see that many GET
requests are ending up as 404
.
This is happening due to your local static file not built correctly.
To fix this issue, try to run gulp buildDev
again in your static_src folder and clear your browser's cache!
(This trick works if you run docker-compose in detached mode (docker-compose up -d
))
You can use pdb
to debug python code (quick intro) (think of gdb
for your python code). Add the following line to where you want to debug the code:
This will stop the code execution, but now we need to attach our terminal to the running django container. Before we do so, make sure the following two lines are in docker-compose.yml
under django
container config that allows the container to be attached for debugging:
If those are in right place, run the code until execution hit the pdb.set_trace()
line.
Run docker attach --detach-keys z ubyssey-dev
to start debugging, and exit out of the debugging session by pressing z
button
Whenever we want to update our database scheme, Django require us to do this through migrations :snake:
Normally you would run python manage.py migrate
to run mingrations in typical Django migrations in your local machine. However, because our applications live inside Docker containers, we need to somehow apply changes to the container image instead of your local machine. Use these commands to do so:
You might run into an error that look something like this in gulp container while using our Docker setup:
In that case, change a line in your docker-compose.yml
file where it says:
to
When the admin page looks blank, that means the dispatch version is out of sync with ubyssey.ca repo
Solve this by going into dispatch folder, and running python setup.py develop
In order to inspect local DB in docker, you need to attach command line session to running docker container. Run the following:
Once you're in, run the usual mysql command to run the console