相关帖子:https://briteming.blogspot.com/2012/10/blog-post_6642.html ,梨花确实漂亮
ppt.cc/fKlBax ppt.cc/fwlgFx ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net ppt.cc/fwpCex ppt.cc/fxcLIx ppt.cc/foX6Ux linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com ppt.cc/ffAGfx ppt.cc/fJbezx ppt.cc/fNIQDx ppt.cc/fCSllx ppt.cc/fybDVx ppt.cc/fIMQxx
相关帖子:https://briteming.blogspot.com/2012/10/blog-post_6642.html ,梨花确实漂亮
Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
You can just fork or clone this repository and use it as is.
✨ It just works. ✨
If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.
But you can do the following:
my-full-stack.my-full-stack:git clone git@github.com:fastapi/full-stack-fastapi-template.git my-full-stackcd my-full-stackgit remote set-url origin git@github.com:octocat/my-full-stack.gitgit remote add upstream git@github.com:fastapi/full-stack-fastapi-template.gitgit push -u origin masterAfter cloning the repository, and after doing changes, you might want to get the latest changes from this original template.
git remote -v
origin git@github.com:octocat/my-full-stack.git (fetch)
origin git@github.com:octocat/my-full-stack.git (push)
upstream git@github.com:fastapi/full-stack-fastapi-template.git (fetch)
upstream git@github.com:fastapi/full-stack-fastapi-template.git (push)git pull --no-commit upstream masterThis will download the latest changes from this template without committing them, that way you can check everything is right before committing.
If there are conflicts, solve them in your editor.
Once you are done, commit the changes:
git merge --continueYou can then update configs in the .env files to customize your configurations.
Before deploying it, make sure you change at least the values for:
SECRET_KEYFIRST_SUPERUSER_PASSWORDPOSTGRES_PASSWORDYou can (and should) pass these as environment variables from secrets.
Read the deployment.md docs for more details.
Some environment variables in the .env file have a default value of changethis.
You have to change them with a secret key, to generate secret keys you can run the following command:
python -c "import secrets; print(secrets.token_urlsafe(32))"Copy the content and use that as password / secret key. And run that again to generate another secure key.
This repository also supports generating a new project using Copier.
It will copy all the files, ask you configuration questions, and update the .env files with your answers.
You can install Copier with:
pip install copierOr better, if you have pipx, you can run it with:
pipx install copierNote: If you have pipx, installing copier is optional, you could run it directly.
Decide a name for your new project's directory, you will use it below. For example, my-awesome-project.
Go to the directory that will be the parent of your project, and run the command with your project's name:
copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trustIf you have pipx and you didn't install copier, you can run it directly:
pipx run copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trustNote the --trust option is necessary to be able to execute a post-creation script that updates your .env files.
Copier will ask you for some data, you might want to have at hand before generating the project.
But don't worry, you can just update any of that in the .env files afterwards.
The input variables, with their default values (some auto generated) are:
project_name: (default: "FastAPI Project") The name of the project, shown to API users (in .env).stack_name: (default: "fastapi-project") The name of the stack used for Docker Compose labels and project name (no spaces, no periods) (in .env).secret_key: (default: "changethis") The secret key for the project, used for security, stored in .env, you can generate one with the method above.first_superuser: (default: "admin@example.com") The email of the first superuser (in .env).first_superuser_password: (default: "changethis") The password of the first superuser (in .env).smtp_host: (default: "") The SMTP server host to send emails, you can set it later in .env.smtp_user: (default: "") The SMTP server user to send emails, you can set it later in .env.smtp_password: (default: "") The SMTP server password to send emails, you can set it later in .env.emails_from_email: (default: "info@example.com") The email account to send emails from, you can set it later in .env.postgres_password: (default: "changethis") The password for the PostgreSQL database, stored in .env, you can generate one with the method above.sentry_dsn: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.Backend docs: backend/README.md.
Frontend docs: frontend/README.md.
Deployment docs: deployment.md.
General development docs: development.md.
This includes using Docker Compose, custom local domains, .env configurations, etc.
Check the file release-notes.md.
from https://github.com/fastapi/full-stack-fastapi-template
Redis has come a long way through an evolution and, by now, it can be placed as your primary database—not just a cache layer. It features added data persistence and replication for durability and availability. Additional modules for JSON support and search make it easier to store and query more complex data. Now, Redis has an Object mapping library, Redis OM, which simplifies things.
In this two-part series, the focus is on the core of Redis. This is the first part, which will guide you through setting up a Redis database and using some basic commands.
First, make sure you have Homebrew installed. From the terminal, run:
brew --versionIf this command fails, you'll need to follow the Homebrew installation instructions.
From the terminal, run:
brew install redisThis will install Redis on your system.
Microsoft provides detailed instructions for installing WSL. Once you're running Ubuntu on Windows, you can follow the steps detailed at Redis Site Installation Steps which are the same steps for installing Redis on Linux to install recent stable versions of Redis from the official packages.
The last option for installing Redis is called Redis Cloud, and that's what you’ll be using here. It allows you to set up a Redis database online. It also comes with Redis insights that can be used to test different commands and visualize your stored data.
To use the Redis database online, follow the steps below:
Sign Up for a Free Redis Account:
Create a Subscription:
Download the Redis App:
Connect to Your Database:
When using your RedisInsights application, navigate to your workbench. You can access your workbench by clicking on this icon:
To set a key-value pair in Redis, follow these steps:
SET key valueReplace key with the name of the key you want to set, and value with the corresponding value you want to assign to that key.
Press CTRL + Enter to execute the command. For example, executing SET name maria will set the value "maria" for the key name.
You should receive the message "OK" in the output section below, confirming that the key-value pair was successfully set.
To verify, go back to the Redis browser, switch to the data view, and refresh the view to see the updated key-value pair.
Error Handling:
If you include a space in your data without quotes, you’ll get a syntax error. To include spaces, enclose the data in quotes.
Example:
SET name "chun li"To retrieve the value of a specific key, use the GET command. In your workbench, type:
GET keyReplace key with the name of the key you want to retrieve. For example, if you have a key named name with the value "chun li", executing GET name will return "chun li". Press CTRL + Enter to execute the command.
To delete one or more keys and their associated values, use the DEL command. In your workbench, type:
DEL key1 key2 key3 ...Replace key1, key2, key3, etc., with the names of the keys you want to delete. For example:
DEL name1 name2Executing this command will delete the keys name1 and name2
along with their respective values. The command will return an integer
indicating the number of keys deleted. For instance, a response of 2 indicates that two keys were successfully deleted. Press CTRL + Enter to execute the command.
To set multiple key-value pairs simultaneously, use the MSET command. In your workbench, use:
MSET key1 value1 key2 value2 key3 value3Replace key1, key2, key3, etc., with the names of the keys you want to set, and value1, value2, value3, etc., with their respective values. For instance:
MSET name1 maria name2 yoshi color green rating 10This command sets the keys name1, name2, color, and rating with their respective values. Press CTRL + Enter. Ensure the key comes first, followed by the value.
To retrieve values for multiple keys at once, use the MGET command. In your workbench, use:
MGET key1 key2 key3Replace key1, key2, key3, etc., with the names of the keys you want to retrieve. For example:
MGET name1 name2 ratingThis command will return the values associated with keys name1, name2, and rating. Press CTRL + Enter. The values "maria", "Yoshi", and "10" will be returned in the output section.
To retrieve a substring of the value of a key, use the GETRANGE command. In your workbench, use:
GETRANGE key start endReplace key with the name of the key, start with the starting index, and end with the ending index. For example:
GETRANGE name 0 4This command will return the substring of the value of name from index 0 to 4. If name has the value "chun li", the command will return "chun ".
In this first part of our Redis for Beginners series, you learned how to set up a Redis database and run basic commands such as setting, getting, deleting, and retrieving multiple key-value pairs. These are basic skills that anyone working with Redis should be conversant with.
In the next part of this series, we will explore more advanced commands, command options, and go into the differences between lists and sets in Redis. Stay tuned!
from https://github.com/topeogunleye/Writing/blob/master/Redis-for-beginners-Part-1.md
---------------
Welcome to the second part of our Redis for Beginners series. In the first part, we covered the basics of setting up a Redis database and executing fundamental commands. In this second part, we will explore advanced command options and delve into the differences between lists and sets in Redis.
Not all commands have options, but a few, for example SET, have certain added features that can be essential.
You can't use NX and XX together because they will conflict with each other. Also, you can use only one option for expiration (EX or PX) at a time. To learn more about the SET command visit here to check out the Redis documentation page.
When executing the following at your workbench, you will define a key with an expiration in Redis:
SET key value EX secondsReplace key with the name of the key that contains the string and value with the new value you would like to store. Replace seconds with the amount of time, in seconds, after which the key should expire.
For example, if you have a key name currently holding the value "Mario", and you want to replace it with "Yoshi" after 7 seconds, run:
SET name Yoshi EX 7This command updates the value of name to "Yoshi" and sets an expiration of 7 seconds from the time the command is executed.
You can set the key conditionally with respect to its existence in Redis by using the options NX, which stands for Not eXists, and XX, which stands for eXists, in the SET command:
Using NX (Not eXists) Option:
SET key value NXkey with the name of the key you want to set.value with the value you want to store in the key.This command sets the value of key to value only if key does not already exist. If key already exists, the command will not perform any action.
Example:
If you want to set a new key username to "alice" only if username does not already exist, you would use:
SET username alice NX**Using `XX
` (eXists) Option:**
SET key value XXThis command sets the value of key to value only if key already exists. If key does not exist, the command will not perform any action.
Example:
If you want to update the value of an existing key username to "bob" only if username already exists, you would use:
SET username bob XXRPUSH, LPUSH, LRANGE, LPOP, RPOP, etc.SADD, SREM, SMEMBERS, SISMEMBER, etc.When deciding between lists and sets, consider the order requirements and the need for uniqueness in your data.
Redis has come a long way through an evolution and, by now, it can be placed as your primary database—not just a cache layer. It features added data persistence and replication for durability and availability. Additional modules for JSON support and search make it easier to store and query more complex data. Now, Redis has an Object mapping library, Redis OM, which simplifies things. In this series, the focus is on the core of Redis.
from https://github.com/topeogunleye/Writing/blob/master/Redis-for-beginners-Part-2.md
With Expo tools, services, and React, you can build, deploy, and quickly iterate on native Android, iOS, and web apps from the same JavaScript codebase.
Access to device capabilities like camera, location, notifications, sensors, haptics, and much more, all with universal APIs.
Build service gives you app-store ready binaries and handles certificates, no need for you to touch Xcode or Android Studio.
Over-the-air updates let you update your app at any time without the hassle and delays of submitting to the store.
Quick Start
If you are already experienced with React and JavaScript tooling and want to dive right in and figure things out as you go, this is the quickest way to get started:
$ npm install -g expo-cli
$ expo init my-project
$ cd my-project
$ expo start