Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

License

NotificationsYou must be signed in to change notification settings

GoogleCloudPlatform/django-demo-app-unicodex

Repository files navigation

Unicodex is a demo database-backed serverless Django application, that uses:

Deployment

This demo can be deployed by multiple different methods: via the Cloud Run button, through Terraform, or manually via a guided tutorial.

Automated

Run on Google Cloud

Seeapp.json and the.gcloud/ folder for implementation details.

Terraform

Seeterraform/ for configuration details.

Manual

Don't forget tocleanup your project resources when you're done!

Live deployments

There are no current live deployments of this demo.

Application Design

Unicodex itself

Emojipedia curates information about emoji and how they are represented on different platforms. E.g. theSparkles emoji (✨) is mostly represented by three golden stars in a cluster, but this has changed over the years (click the sparkle image marked "Google" and you'll see how Sparkles has appeared in every version of Android over the years. It used to lookvery different!)

In Unicodex, these relations are represented by acodepoint (Sparkles) having multipledesigns (images). Each image represents aversion from avendor (e.g. Google Android 9.0, Twitter Twemoji 1.0, ...). These relations are represented by four models:Codepoint,Design,VendorVersion andVendor, respectively. Designs have a FileField which stores the image.

In the Django admin, an admin action has been setup so that you can select a Codepoint, and run the "Generate designs" actions. This will -- for all configured vendors and vendor versions -- scrape Emojipedia for the information, including uploading images. Alternatively, you can enter this information manually from the django admin.

Service design - one deployment per Google Cloud project

Unicodex runs as a Cloud Run service. Using the Python packagedjango-storages, it's been configured to take aGS_BUCKET_NAME as a storage place for its media. Using the Python packagedjango-environ it takes a complexDATABASE_URL, which will point to a Cloud SQL PostgreSQL database. Thesettings.py is also designed to pull a specific secret into the environment. These are all designed to live in the same Google Cloud Project.

In this way, Unicodex runs 1:1:1 -- one Cloud Run Service, one Cloud SQL Database, one Google Storage bucket. It also assumes that there isonly one service/database/bucket.

Other service designs

It is possible to host multiple instances of Unicodex on the one project (where the service name, bucket name, and database name, and django database username have different appended 'slugs', and all share one instance), but this configuration is out of scope for this project.

You can host multiple versions of Unicodex using project isolation (one Google Cloud account can have multiple projects) without any code editing, but this may not work for your own project.Read more about project organisation considerations

Demo instances

This repo was configured to automaticallybuild, migrate, and deploy unicodex via Cloud Build in different demo projects.

The different deployment methods (Terraform, Cloud Run Button, and manual) were tested weekly by creatingephemeral projects, deploying the application, testing it, then deleting the project. If the tests or deployment fails, the deletion doesn't happen and the issue can be investigated.

Feel free to use these implementations as a basis for your own processes, as with all other code in this repo.

Contributions

Please see thecontributing guidelines

License

This library is licensed under Apache 2.0. Full license text is available inLICENSE.

About

No description or website provided.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp