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

Implementing custom templates tags #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Ngazetungue
Copy link
Collaborator

@Ngazetungue Ngazetungue commented Nov 16, 2022

The branch created for purpose of implementing custom templates tags .

@k4ml
Copy link
Contributor

k4ml commented Nov 16, 2022

Got this error when starting new project:-

gitpod /workspace $ cookiecutter labzero/
project_name [myapp]: 
project_author_name [My Name]: 
project_author_email [[email protected]]: 
project_version [0.0.0]: 
project_description [Some description]: 
project_slug [myapp]: 
Traceback (most recent call last):
  File "/home/gitpod/.local/bin/cookiecutter", line 8, in <module>
    sys.exit(main())
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/cli.py", line 194, in main
    cookiecutter(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/main.py", line 114, in cookiecutter
    result = generate_files(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/generate.py", line 373, in generate_files
    generate_file(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/generate.py", line 173, in generate_file
    tmpl = env.get_template(infile_fwd_slashes)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/loaders.py", line 138, in load
    code = environment.compile(source, name, filename)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile
    self.handle_exception(source=source_hint)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "src/{{cookiecutter.project_slug}}/templates/index.html", line 1, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'load'.
  File "src/{{cookiecutter.project_slug}}/templates/index.html", line 1
    {% load custom_tags %}

@Ngazetungue
Copy link
Collaborator Author

Can you please try again.

Ngazetungue and others added 4 commits November 16, 2022 11:20
update index page with the latest information . load custom tag. and 500.html page created.
I added raw block to index.html page
.DS_store delete. this is a file that automatically created by macOS
@Ngazetungue Ngazetungue changed the title new branch created Implementing custom templates tags Nov 23, 2022
The content in the file removed. It has to be empty.
@Ngazetungue
Copy link
Collaborator Author

Got this error when starting new project:-

gitpod /workspace $ cookiecutter labzero/
project_name [myapp]: 
project_author_name [My Name]: 
project_author_email [[email protected]]: 
project_version [0.0.0]: 
project_description [Some description]: 
project_slug [myapp]: 
Traceback (most recent call last):
  File "/home/gitpod/.local/bin/cookiecutter", line 8, in <module>
    sys.exit(main())
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/cli.py", line 194, in main
    cookiecutter(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/main.py", line 114, in cookiecutter
    result = generate_files(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/generate.py", line 373, in generate_files
    generate_file(
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/cookiecutter/generate.py", line 173, in generate_file
    tmpl = env.get_template(infile_fwd_slashes)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/loaders.py", line 138, in load
    code = environment.compile(source, name, filename)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile
    self.handle_exception(source=source_hint)
  File "/home/gitpod/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "src/{{cookiecutter.project_slug}}/templates/index.html", line 1, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'load'.
  File "src/{{cookiecutter.project_slug}}/templates/index.html", line 1
    {% load custom_tags %}

The error fixed.

@Ngazetungue Ngazetungue reopened this Nov 23, 2022
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

Successfully merging this pull request may close these issues.

2 participants