My first ViUR Project¶
After completing the first steps in the Google Cloud Console you can start programming your first ViUR Application. To start, you will need to set up you ViUR system localy.
Before performing the following steps, please make sure to visit Awesome ViUR
and perform the ViUR setup steps for your operating system.
Start with ViUR¶
Install the ViUR CLI Tool in your standard python environment:
pip install viur-cli
Check your installation success
# The console output should look like this:
Create a new local ViUR project for the appengine project you have already created
If you don’t know about this, please revisit “ViUR and the Google Cloud Console”viur create projectname
This commmand will prompt you to enter a application name and a develop version name. We recommend naming the application name after your appengine project. The develop version name should be the same, but with a “-dev” postfix.application name: projectname develop version name: projectname-dev
3.1. Choose if you want to use a prebuild version of ViUR Vi
3.2. Choose if you want to add ViUR Vi as a git submodule
3.3. Choose if you want to configure your project as a new gcloud project
Install your development dependencies
Since we want to have the flexibility to work on different versions of our software, we use virtual environments. You can find more information about pipenv here.pipenv install --dev
Check your installation success.
Your output should look like this.[[source]] url = "https://pypi.org.sample" verify_ssl = true name = "pypi" [packages] viur-core = "*" [dev-packages] viur-cli = "*" pycodestyle = "*" watchdog = "*" [requires] python_version = "3.11"
Start your pipenv
This command will start a new virtual environment, installing packages in this environment will not install anything globally. So feel free to fool around and experiment with packages.
Finish you GCloud setup
#This script enables API's and configures some more appengine stuff ./viur-gcloud-setup.sh projectname
Try out your installation by running your dev server
WarningOn the first start of your development server, the debug output will show you username and password credentials for an automatically generated admin user.You can log into the Vi and change both the username and password by hand afterwards.It will look similar to this:#ViUR created a new admin-user for you! #Username: email@example.com #Password: ThisIsARandomStr1ng!
After your first deployment open https://appspot.com
Visit the IAM & Admin and press the “+ GRANT ACCESS” Button
Select the user: “firstname.lastname@example.org”
Assign following roles:
Cloud Datastore User
Storage Object Admin
Reset my admin user:¶
In case you have locked yourself out of your own system. There is a possible way back in, but you will need to sacrifice all your user data and log ins.
All your user data will be deleted in the Appengine and it will not be recoverable. We only recommend this, if you see no other option of logging into your administration system
The ViUR-Developers recommmend the usage of a Password Manager
Open https://console.cloud.google.com and navigate to your project
Navigate to the Datastore Entities Site of your project.
Search and delete all entries of the kind user
Search and delete all entries of the kind user_name_uniquePropertyIndex
Start your dev server again
Recover from stress and anxiety