I have used pipenv, so it should be enough to set up a new pipenv virtual environment and then run pipenv install to download all dependencies.
All the following commands are counting with all dependencies from virtual environment, so one has to run the following command to enter it
(or pehaps it is sufficient to simply prepend pipenv run):
pipenv shellPrepare local SQLite DB for loca testing using:
python manage.py migrateAfter setting up clean DB, one has to create a new super-user to enable access to site admin using the following command and then following up on-screen instructions:
python manage.py createsuperuserTODO: fixtures
Generate MO file (so-called machine object file) to enable basic czech localization (to be seen in site admin) by running:
python manage.py compilemessages --locale csRunning all unit tests:
pytestTo start the server locally, run:
python manage.py runserver 8000And then the following URLs shall be available:
- admin/backoffice (http://www.localhost:8000/site-admin)
- GraphQL endpoint (http://api.localhost:8000/gql)
- GraphiQL for testing only with enabled debug mode (http://api.localhost:8000/giql)
Running:
python manage.py graphql_schema --schema apps.api.graphql.schema.schema --out ./assets/schema.graphqlshould generate GraphQL schema in SDL format within assets/ directory.
Localization is using basic django mechanism based on gnugettext. For localization process are used PO (aka Portable Object) files. But the server itself requires MO (aka Machine Object) files that are compiled out of PO files.
To extract new messages for localization out of project's source code into PO file:
python manage.py makemessages --locale csTo compile MO file out of PO file after the localization process:
python manage.py compilemessages --locale csLets add a brand-new app called abc:
mkdir apps/abc
python manage.py startapp abc apps.abcThen one correction has to be done manually -- go to apps/abc/apps.py and prepad apps. to the value of attribute name of your AppConfig.
- basic site admin for models of apps carpool and reservation
- custom time-oriented list filters in admin of reservation (rent time and/or return time in the given time interval, rent duration in the given range)
- basic czech localization of site admin
- generated GraphQL schema (for cooperation with FE platforms - CLI, web app, mobile apps)
- pytest-based unit tests with checking of exceptions and captured logs
- REST API endpoints
- OpenAPI for REST API
- user authentication and authorization
- mocks for 3rd party testing
- integration testing
- "dockerization"
- fixtures for additional features + manual testing and trials
- pre-commit hook running some external tools like
- pre-commit
- code formatter (black)
- type-checker (mypy) ?!
- linter (flake8, perhaps ruff)
- import sorting (isort)
- prepare CI workflows