Open ShaheedHaque opened 10 months ago
OK, this now render the "Hello World!" correctly.
Feedback requested before thinking about tests/docs etc.
Resolved last outstanding comment. And ran black.
If we are to proceed, I'd propose to squash the current commits before thinking about tests/packaging/docs etc. (FWIW, in that regard, I assume the appropriate packaging would be as something like "reactpy_django[jinja]"...but I'm not currently sure how to go about implementing that).
Optional dependencies can be defined within the package in setup.py. For example:
{
"extras_require": {
"encryption": ["cryptography", "pycryptodome"],
},
...
}
Optional dependencies can be defined within the package in setup.py. For example:
{ "extras_require": { "encryption": ["cryptography", "pycryptodome"], }, ... }
Thanks, I'm more or less familiar with this bit. I was more thinking about the new file I have added (and any supporting test file), and whether that could/should be omitted unless "[jinja] was specified?
I have some changes in one of my PRs that will simplify test configuration https://github.com/reactive-python/reactpy-django/pull/190
TLDR: Our test suite can now run multiple different Django settings.py files.
And yes, from the user's perspective we should have all the jinja dependencies be optional via reactpy_django[jinja]
My PR has been merged. All settings_*.py
files within the test app will now automatically run tests against them.
There shouldn't be anything blocking this PR anymore, so you'll need to do the following:
[jinja]
keyword.settings_jinja.py
.settings.py
to conditionally run these tests.mkdocs.yml
nav menu to look something likeGet Started
> Add ReactPy to your ...
> Django Project
Get Started
> Add ReactPy to your ...
> Django-Jinja Project
Noted. I've a full plate right now but have this on my radar.
Description
WORK IN PROGRESS: DO NOT MERGE.
This is incomplete support for Jinja2-based templates. I could use some pointers to finish the missing part (see comments at the end of src/reactpy_django/templatetags/jinja.py).(also missing, docs, packaging and tests)
To reproduce the results to date requires the following example changes on the Django side...
Configure template files ending in ".jinja" to be processed via Jinja:
Add the new app:
File of components in
components.py
:Test view in
views/react.py
:Template for the view
templates/my-template.html.jinja
:project/asgi.py
And finally
project/urls.py
:Once Django is restarted, navigating to the view, you should see
Checklist:
Please update this checklist as you complete each item:
By submitting this pull request you agree that all contributions comply with this project's open source license(s).