Coder Social home page Coder Social logo

viur-framework / viur-base Goto Github PK

View Code? Open in Web Editor NEW
12.0 10.0 11.0 3.5 MB

Start here with your new ViUR project!

Home Page: https://www.viur.dev

License: MIT License

Python 32.75% CSS 24.25% JavaScript 1.92% Shell 2.64% Less 38.45%
viur getting-started python template jinja2 appengine-python framework

viur-base's Introduction

A hexagonal logo of the viur-base

viur-base


This is the place to start your new ViUR project from!

About

viur-base is a template for new ViUR projects and already comes with a default setting to quickly start coding.
The repository is intended to serve as a template, therefore feel free to remove any stuff from it to fit your specific project demands.

Requirements

Before you start, please check out the following preliminaries are met:

  1. You either need Linux, macOS, or Windows with WSL. See awesome-viur for further help and information for specific operating systems.
  2. git, python, pyenv and pipenv should be installed You can use any Python version >= 3.10 with ViUR, we recommend Python 3.11 currently.
  3. install Google Cloud SDK and the required components with the following commands
    gcloud components update
    gcloud components install app-engine-python app-engine-python-extras
    gcloud auth application-default login
    
    or (see here for further help)

Usage

  1. Create a new Google Cloud project here and activate billing.

    We will refer to the name of the project you created as YOUR-APP-ID.

  2. Clone this repository with git clone https://github.com/viur-framework/viur-base.git YOUR-PROJECT.

    This creates a new local folder YOUR-PROJECT. In most cases, YOUR-PROJECT and YOUR-APP-ID should be identical.

  3. cd YOUR-PROJECT

  4. ./clean-base.py -A YOUR-APP-ID

  5. ./viur-gcloud-setup.sh YOUR-APP-ID

  6. Install local development dependencies with pipenv install --dev

  7. Locally run your project with pipenv run viur run or deploy it with pipenv run viur deploy app. Run a pipenv shell to work with the viur-cli command line tool.

See the documentation for further help.

Contributing

ViUR is developed and maintained by Mausbrand Informationssysteme GmbH, from Dortmund in Germany. We are a software company consisting of young, enthusiastic software developers, designers and social media experts, working on exciting projects for different kinds of customers. All of our newer projects are implemented with ViUR, from tiny web-pages to huge company intranets with hundreds of users.

Help of any kind to extend and improve or enhance this project in any kind or way is always appreciated.

We take great interest in your opinion about ViUR. We appreciate your feedback and are looking forward to hear about your ideas. Share your vision or questions with us and participate in ongoing discussions.

License

Copyright © 2024 by Mausbrand Informationssysteme GmbH.
Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.

Licensed under the MIT license. See LICENSE for more information.

viur-base's People

Contributors

achimschumacher avatar akelch avatar arnegudermann avatar cheeaza avatar dependabot[bot] avatar grashalmbeisser avatar kadirbalku avatar klaus-thorres avatar leopoldwichtel avatar melectrik avatar phneutral avatar phorward avatar przybyla86 avatar skoegl avatar sveneberth avatar thevax avatar xnopasaranx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

viur-base's Issues

Update ignite to the latest version

Although the ignite submodule was updated by #36 to almost the latest version, the corresponding changes were not made.
Some structural changes are necessary and the base needs to initialize the ignite elements.

`SkelView` fails with some `RelationalBone`s

The SkelView causes an error if in the skeleton is a

  • non-multiple, not-multilang RelationalBone without an UsingSkel
  • multiple, multilang RelationalBone without an UsingSkel
  • multiple, multilang RelationalBone with an UsingSkel

(but I didn't tested all combinations).

Traceback (most recent call last):
  File "/.../deploy/viur/core/request.py", line 269, in processRequest
    self.findAndCall(path)
  File "/.../deploy/viur/core/request.py", line 608, in findAndCall
    res = caller(*newArgs, **newKwargs)
  File "/.../deploy/viur/core/prototypes/list.py", line 181, in list
    return self.render.list(res)
  File "/.../deploy/viur/core/render/html/default.py", line 432, in list
    return template.render(skellist=skellist, action=action, params=params, **kwargs)
  File "/.../site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/.../site-packages/jinja2/environment.py", line 926, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "html/list.html", line 2, in top-level template code
    {% from "macros/skelview.html" import SkelView %}
  File "html/viur_base.html", line 119, in top-level template code
    {% block content %}
  File "html/list.html", line 12, in block 'content'
    {{ SkelView(skel) }}
  File "/.../site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "html/macros/skelview.html", line 298, in template
    {{ SkelViewBone(
  File "/.../site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "html/macros/skelview.html", line 234, in template
    {{ SkelViewRelBoneFormat(structure[step]["format"], item, prefix="dest.") }}
  File "/.../site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "html/macros/skelview.html", line 77, in template
    {% for key, val in value.items() %}
  File "/.../site-packages/jinja2/utils.py", line 83, in from_obj
    if hasattr(obj, "jinja_pass_arg"):
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'items'

Upload an project.json template to base

While developing the ViUR CLI i noticed, that we are creating a project.json to via the Cli to the project root directory.
I think the project.json is better suited in the viur base project.
Where the developer is not dependent on the viur cli.

State of `sources`-folder, LESS/gulp in viur-base?

Hello, what's the current state of the stuff in the sources-folder?

  1. It doesn't compile on my machine when I run viur build release, and seems to be hideously old.
  2. I've seen many of our projects, where this sources-setup was taken over and is absolutely useless to the project.
  3. Makes a Vue.JS + Shoelace-based default make sense?

clean-base.py script fails trying to download built /vi

This is my console output:

Rolands-MacBook-Pro:projekt vax$ python clean-base.py
Enter Author Name (leave empty to default to vax):
Enter application-id (leave empty to default to projekt-viur): mb-projekt-viur
Downloading submodules
Submodule 'deploy/server' (https://github.com/viur-framework/server.git) registered for path 'deploy/server'
Submodule 'sources/less/ignite' (https://github.com/viur-framework/ignite.git) registered for path 'sources/less/ignite'
Submodule 'vi' (https://github.com/viur-framework/vi.git) registered for path 'vi'
Cloning into '/Users/vax/Documents/Projects/projekt/deploy/server'...
Cloning into '/Users/vax/Documents/Projects/projekt/sources/less/ignite'...
Cloning into '/Users/vax/Documents/Projects/projekt/vi'...
Submodule 'html5' (https://github.com/viur-framework/html5.git) registered for path 'html5'
Submodule 'logics' (https://github.com/viur-framework/logics.git) registered for path 'logics'
Submodule 'public/icons' (https://github.com/viur-framework/icons.git) registered for path 'public/icons'
Cloning into '/Users/vax/Documents/Projects/projekt/vi/html5'...
Cloning into '/Users/vax/Documents/Projects/projekt/vi/logics'...
Cloning into '/Users/vax/Documents/Projects/projekt/vi/public/icons'...
Removing .git tether
.git remote tether removed
Downloading latest build of vi...Traceback (most recent call last):
File "clean-base.py", line 101, in
urllib.urlretrieve("https://www.viur.is/package/download/vi/latest", zipname)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1263, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 369, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 617, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 846, in do_handshake
self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)

mksetup: resulting setup.py not working

tried to clone and setup a fresh base project, but following the steps described in the readme leaves me with a broken project. It seems like the clean-base script is using different assumptions about the project structure which ultimately messes everything up.

After cloning the repo, I ran "python2 mksetup.py > setup.py", then executed the resulting setup.py, the readme then suggests running clean-base.py to clean up. After running clean-base.py the setup is incomplete and the application cannot be run with local_run.sh, as the directory structure is not as expected. Trying again and not running clean-base.py also results in a broken project.

Cloning the repo and only running clean-base.py results in a working project which can be started through local_run.sh

Add viur form templates

The viur form templates had been removed from viur-core. These should be added to the base project now.

Error 500 happens when logging into freshly cleaned base

image
This error happens because the template user_login_success.html calls the undefined function icon() to render a "check mark" icon. I think this issue belongs to a function that was planned to become part of the server but was not merged yet.

Enable CSP rules

Content security policies are currently entirely disabled in the base repository.
This is not the way it was meant to be, and should be chanced asap.

Viur cant handle google-logging version provided in requirements.txt?

My console output:

Traceback (most recent call last):
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 92, in init_process
    super().init_process()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/workers/base.py", line 133, in init_process
    self.load_wsgi()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/workers/base.py", line 142, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/tmp/tmpAuLxhA/lib/python3.9/site-packages/gunicorn/util.py", line 331, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/marco/Schreibtisch/projects/viur-test/deploy/main.py", line 26, in <module>
    from viur.core import conf, securityheaders
  File "/home/marco/Schreibtisch/projects/viur-test/deploy/viur/core/__init__.py", line 33, in <module>
    from viur.core import request
  File "/home/marco/Schreibtisch/projects/viur-test/deploy/viur/core/request.py", line 11, in <module>
    from viur.core.logging import requestLogger, client as loggingClient, requestLoggingRessource
  File "/home/marco/Schreibtisch/projects/viur-test/deploy/viur/core/logging.py", line 4, in <module>
    from google.cloud.logging.handlers.handlers import EXCLUDED_LOGGER_DEFAULTS
ModuleNotFoundError: No module named 'google.cloud.logging.handlers.handlers'

Seems to be fixed by downgrading the module from version 2.2.0 to 1.15.0

conf["viur.validApplicationIDs"] must be set in main.py

This error occurs now when conf["viur.validApplicationIDs"]is unset.

Traceback (most recent call last):
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 92, in init_process
    super().init_process()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/tmp/tmpt86lyR/lib/python3.9/site-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/user/xxx/deploy/main.py", line 188, in <module>
    app = viur.core.setup(modules, render)
  File "/home/user/xxx/deploy/viur/core/__init__.py", line 248, in setup
    assert projectID in conf["viur.validApplicationIDs"], \

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.