Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I write a theme web for devpi #961

Closed
zhenzi0322 opened this issue Mar 29, 2023 · 10 comments
Closed

How do I write a theme web for devpi #961

zhenzi0322 opened this issue Mar 29, 2023 · 10 comments

Comments

@zhenzi0322
Copy link

How do I write a theme web for devpi

@fschulze
Copy link
Contributor

@zhenzi0322
Copy link
Author

Thank you.

@zhenzi0322
Copy link
Author

There are theme examples, and how can I use them in devpi? Easy to debug operation

@fschulze
Copy link
Contributor

The devpi_example_theme/theme folder can be used with devpi-server --theme when devpi-web is installed. For the other use cases shown in the example you have to install the package and it will work automatically because of this: https://github.com/fschulze/devpi-example-theme/blob/master/devpi_example_theme/__init__.py#L11

@zhenzi0322
Copy link
Author

zhenzi0322 commented Mar 29, 2023

devpi-server --theme ./devpi_example_theme

Invalid modification of style.css style

@fschulze
Copy link
Contributor

Use devpi-server --theme ./devpi_example_theme/theme

@zhenzi0322
Copy link
Author

zhenzi0322 commented Mar 29, 2023

Use devpi-server --theme ./devpi_example_theme/theme

There will be errors when starting this method.

image

error:

 File "notfound_c8e146b183910da68a9a0290a3fa599d.py", line 239, in render
 - Expression: "request.macros['footer']"
 - Filename:   ... WaY0Jl\lib\site-packages\devpi_web\templates\notfound.pt
 - Location:   (line 14: col 33)
 - Source:     ... al:footer use-macro="request.macros['footer']" />
                                        ^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  view: <function ('notfound',) at 0x1e3d8b48dc0>
               renderer_name: templates/notfound.pt
               renderer_info: <RendererHelper ('None',) at 0x1e3d9fdb430>
               context: <HTTPNotFound ('None',) at 0x1e3da112620>
               request: <Request ('None',) at 0x1e3d9fdb580>
               req: <Request ('None',) at 0x1e3d9fdb580>
               get_csrf_token: <partial ('None',) at 0x1e3da0895d0>
               msg: <HTTPNotFound ('None',) at 0x1e3da112620>
               target_language: <NoneType ('None',) at 0x7ffb9fa687f8>
               repeat: <RepeatDict ('None',) at 0x1e3d9fdb460>
               macroname: request.macros['footer']

versin:

devpi-web: 4.2.0
devpi-server: 6.8.0

@fschulze
Copy link
Contributor

I have to look into that error.

Maybe this is a simpler example:
https://github.com/devpi/devpi.net/tree/master/theme

@fschulze
Copy link
Contributor

@zhenzi0322
Copy link
Author

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants