A simple Django back end for my portfolio site.
- InstaArt API: REST API for InstaArt
- Admin page: A dashboard for managing everything in the database
- Django Rest Framework
- Django CORS Headers
- Django Admin Interface
- Django CKEditor
- Django Modern User
- Python Decuple
- Pillow
- Requests
- Black
- Pre-Commit
You'll have to copy the .env.example
file to .env
and fill in the values.
Apps may contain a fixtures/
directory, which contains its test fixtures.
Additionally, there is a media/fixture/
directory which contains the media files for the fixtures. This directory is not ignored by Git.
To use the fixtures, simply run python manage.py testserver [fixture [fixture ...]]
. This command loads the fixtures as test data which can be safely modified on the test server.
Using python manage.py dumpdata -o somefile.json
in Windows (or at least PowerShell) will result in the following error:
(venv) PS C:\...\chriskumm.com_django> python .\manage.py dumpdata art | out-file -encoding UTF8 -noNewLine art_standard.json
CommandError: Unable to serialize database: 'charmap' codec can't encode character '\u02cc' in position 132: character maps to <undefined>
Exception ignored in: <generator object cursor_iter at 0x000001371B9280B0>
Traceback (most recent call last):
File "C:\...\chriskumm.com_django\venv\lib\site-packages\django\db\models\sql\compiler.py", line 1649, in cursor_iter
cursor.close()
sqlite3.ProgrammingError: Cannot operate on a closed database.
One way to get around this is by running the command from a virtual environment in WSL (Windows Subsystem for Linux).