|
What are the scaling capabilities of Django?
|
|
|
|
|
When I enter the following into google it seems to return answers.
programming django scaling
|
|
|
|
|
Hello this is Gulshan Negi
Django, a high-level Python web framework, is capable of handling large amounts of data, but it depends on the specific use case and the infrastructure supporting it. Django's architecture is designed to be scalable and efficient, and it provides several features and tools to help manage large amounts of data, including:
1. Object-Relational Mapping (ORM): Django's ORM allows you to interact with databases in a high-level, Pythonic way, rather than writing raw SQL queries. This can make it easier to manage large amounts of data.
2. Database indexing: Django supports database indexing, which can improve the performance of queries on large amounts of data.
3. Caching: Django provides caching support, which can improve the performance of applications with large amounts of data.
4. Scalability: Django can be scaled horizontally, by adding more servers to a load-balanced cluster, to handle increased traffic and data.
Thanks
|
|
|
|
|
I have been working on a script trying to get images sent over to a telegram group. Though I assume it's requiring the use of http://localhost:32168/v1/vision/detection and this does not seem to be working. I have given it my best shot if anyone else can shine some light on this.
# Set the path to the folder of images
$imageFolderPath = "C:\images"
# Set the endpoint URL for the CodeProjectAI detection service
$endpointUrl = "http://localhost:32168/v1/vision/detection"
# Get a list of all the image files in the specified folder
$imageFiles = Get-ChildItem $imageFolderPath -Filter *.jpg,*.png
# Iterate through each image file
foreach ($imageFile in $imageFiles) {
# Read the image file into a byte array
$imageBytes = [System.IO.File]::ReadAllBytes($imageFile.FullName)
# Encode the image byte array as base64
$imageBase64 = [Convert]::ToBase64String($imageBytes)
# Set the POST body for the detection request
$requestBody = @{
image = $imageBase64
objects = @("human", "vehicle")
} | ConvertTo-Json
# Make the POST request to the detection service
$response = Invoke-RestMethod -Method Post -Uri $endpointUrl -Body $requestBody -ContentType "application/json"
# Check the response for detected objects
if ($response.objects) {
# If objects are detected, send the image to the Telegram group using CURL
# Replace YOUR_CHAT_ID and YOUR_BOT_TOKEN with the chat ID and bot token for your Telegram group
$curlCommand = "curl -s -X POST https://api.telegram.org/botYOUR_BOT_TOKEN/sendPhoto -d chat_id=YOUR_CHAT_ID -d photo=`"$($imageFile.FullName)`""
Invoke-Expression $curlCommand
}
# Delete the image file
Remove-Item $imageFile.FullName
}
modified 11-Jan-23 10:19am.
|
|
|
|
|
I have developed an online IDE to develop WEB applications. I just released version 1.0.0 Alpha. Does anyone know how I can find a group of users/people to test the tool to detect deficiencies? Is it allowed on this site to post the URL of my tool?
modified 24-Nov-22 17:41pm.
|
|
|
|
|
|
Thanks for the reply, I'm new to CodeProject. I will go to the forum that you indicate me. Thank you
modified 25-Nov-22 12:02pm.
|
|
|
|
|
I'm going to be developing a .Net Core Web API. I'm not really sure what the best approach is for hosting it. I'd like to get your input. If you need more info, please ask.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
There is no universal "best" anything. As always, the answer depends on your situation.
There are many questions you need to ask yourself before you can pick the right approach for your specific situation. For example:
- Do you already have a Windows or Linux server you can use?
- If not, what's your budget and requirements for hosting?
- If you're using a database, which DBMS are you using, and where is the database located?
- If you're collecting any data on your API's users, have you researched whether there are legal requirements to host it in a specific country or region?
- Do you need any of the features that IIS offers[^] which Kestrel doesn't (or vice-versa)?
- Are you using any platform-specific APIs?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I don't really know the answers. I'm building a prototype/POC WPF app for a potential client, and I want to host the back end API somewhere where they can get to it.
I probably need some form of cloud based hosting but I don't know much about the topic.
- I'm planning to use ASP.Net Core
- I'll be looking to use SQL Server
- As far as budget, probably not much as it's a POC
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
The good news is that ASP.NET Core can be hosted on Linux (so long as you avoid Windows-specific APIs) which will probably be cheaper than Windows hosting.
SQL Server 2022 can also run on Linux.
So it comes down to whether you want to rent and manage your own VM somewhere in the cloud, or use something like Azure or AWS to host it. The VM would give you more control, but you'd have to set up and manage the server yourself, and you'd probably end up paying a flat rate. With Azure/AWS, you'll likely be charged for what you use, so if you only use it for a couple of hours a month, that's all you'll pay for.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks. I'll look into AWS
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Which is the best library for frontend developer
|
|
|
|
|
The one that meets the requirements of the project, works in all the browsers that project needs to support, and is still being actively maintained.
Seriously, how do you expect anyone to answer such a vague question? Only you and your team know what your project entails, so you need to do your own research.
There is no universal "best" anything.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The best for me might be lousy for you and what might be best for you I might not like at all.
|
|
|
|
|
Great - now I've got the theme tune from Diff'rent Strokes[^] stuck in my head!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
jQuery... it's new and all the rage.
Seriously though, don't use a library at first. Just learn JavaScript itself.
Jeremy Falcon
|
|
|
|
|
Oh and after you've mastered vanilla JavaScript... study React. But not until you can do what you need to do without it.
Jeremy Falcon
|
|
|
|
|
Hello again...
[Thought I could do this on my own in Adobe Dreamweaver, but I guess not]. I need a basic (responsive) html template whereby everything on the page is centered vertically in divs...both image & text content. (I believe I need what is known as a 'wrapper'...that can be set to a certain width...& then all other content would be centered in that wrapper)
If someone can just get me started, w/ just a few centered divs in a wrapper for placement of images & text, I can learn from that basic code & just add content as I go (& will be very appreciative of any effort, from anyone here).
thanx,
mwForman
modified 8-Nov-22 22:32pm.
|
|
|
|
|
Centering in CSS: A Complete Guide | CSS-Tricks - CSS-Tricks[^]
For example:
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
display: grid;
height: 100%;
}
body > div {
margin: auto;
}
</style>
</head>
<body>
<div>
Everything in this element is centered, both horizontally and vertically.
</div>
</body>
</html> Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard...
Thanx. I don't need horizontal centering, tho...only vertical (i.e., all content would be centered on the page vertically, but would be positioned at the top of each div). What would that page code look like?
Thanx again,
MF
|
|
|
|
|
Member 14987492 wrote: I don't need horizontal centering
...
all content ... would be positioned at the top of each div
Those two statements don't match. If you want content positioned at the top, then it's the vertical centering that you don't want. If you don't want the horizontal centering, then you want the content positioned on the left-hand side.
So which is it?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I was pretty clear (I thought). You gave me a code page whereby content was centered on the page but then also centered vertically in the container. I want all the containers (divs) to be centered, but I want the content inside those divs at the *top* of the centered div, not in the *middle* of it.
thanx
|
|
|
|
|
But that's exactly what I gave you.
The content isn't vertically centered within the <div> ; it's just that the <div> is only as tall as the content. If you make it taller, the content will still be at the top of the <div> .
body > div {
margin: auto;
min-height: 5em;
outline: 4px dotted green;
} Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Just to add to Richard's great answer, you may wish to adjust your styles:
html,
body {
display: grid;
height: 100vh;
margin: 0;
padding: 0;
}
Technically, having height 100% on the body works out to be the same in that context. But it means 100% of the parent element. If there is a lot of content this may not mean center on the screen - which can be a good thing. Just depends on your use case. The 100vh always means 100% of the viewport height regardless the size of the body container.
Also, the margin and padding is set to zero to avoid the doubling up of the scrollbar.
Jeremy Falcon
|
|
|
|