- Recent mssql server version (
server:2022-CU16-ubuntu-22.04with mysql-tools-18) - Healthcheck
- Docker engine > 2.7
I'm surely not maintaining this as well as I could. There are also other possible, better integrated solutions, like django-vite, so keep in mind this was supposed to be more of a note to myself than anything :]
This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.
Here's a boilerplate that uses this approach: https://github.com/labcodes/django-react-boilerplate
A couple of things to note:
| // Async await func | |
| async function getTimelineData() { | |
| var response = await fetch('/some-api-url') | |
| return response.json() | |
| } | |
| async function populateTimelineInit() { | |
| var data = await getTimelineData(); | |
| new vis.DataSet(data); |
| from django import template | |
| from django.template import Context | |
| from django.template.base import parse_bits | |
| from wagtail.wagtailimages.templatetags.wagtailimages_tags import ImageNode | |
| from wagtail.wagtailimages.models import Filter, SourceImageIOError, InvalidFilterSpecError | |
| from britishswimming.utils.models import SocialMediaSettings | |
| register = template.Library() |
Bash script to iterate all commits of a given Git repository and extract all files within each commit.
With a Git repository at /path/to/repository and an empty directory at /path/to/output we can run:
./export.sh /path/to/repository /path/to/output| import { AbilityBuilder, Ability } from 'casl' | |
| // Alternatively this data can be retrieved from server | |
| export default function defineAbilitiesFor(user) { | |
| const { rules, can } = AbilityBuilder.extract() | |
| can('read', 'User') | |
| can('update', 'User', { id: user.id }) | |
| if (user.role === 'doctor') { |
| def generate_hex_string(length: int): | |
| """ Generate a randomized hex string. | |
| Parameters | |
| ---------- | |
| length : int | |
| Desired character length of the returned token. | |
| Returns | |
| ------- |
| public class ArchiveContentFinder : IContentFinder | |
| { | |
| public bool TryFindContent(PublishedContentRequest contentRequest) | |
| { | |
| var path = contentRequest.Uri.GetAbsolutePathDecoded(); | |
| var db = ApplicationContext.Current.DatabaseContext.Database; | |
| var archived = db.SingleOrDefault<Archive>("select * from archive where Url = @0 or Url = @1", path, path + "/"); |