pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

Vision, PDF reading and Python

Script to modify PDF file to make it read as you are looking at something at the distance.

https://github.com/ilevd/pdf-binocular

What My Project Does

Duplicate contents on every PDF page for binocular vision.

Target Audience

People that have eyes tension when reading books and want to try something to reduce tension.

Comparison

Probably it's similar to stereo/3d pictures.

/r/Python
https://redd.it/1hvy2ty

Читать полностью…

Python Daily

D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1htw7hw

Читать полностью…

Python Daily

Open sourcing our python browser SDK that allows you use LLMs to automate tasks on any website

# Use Dendrite to build AI agents / workflows that can:

* 👆🏼 Interact with elements
* 💿 Extract structured data
* 🔓 Authenticate on websites
* ↕️ Download/upload files
* 🚫 Browse without getting blocked

Check it out here: [https://github.com/dendrite-systems/dendrite-python-sdk](https://github.com/dendrite-systems/dendrite-python-sdk)

/r/Python
https://redd.it/1hvs9hw

Читать полностью…

Python Daily

Tiny Python library that turns functions into GUI apps


Hey! I made a small tool that lets you create GUI applications just by writing normal Python functions. It's inspired by FastAPI-Typer, but for desktop-mobile GUIs.

# Basic example:

from functogui import App, intUi, boolReturn

def iseven(number: int = intUi(4)) -> boolReturn:
    return number % 2 == 0

App(is
even)

That's it - it creates a complete GUI with a slider and shows the result in real-time. Useful for quick tools and prototypes when you don't want to mess with UI code.

Built with Kivy, supports file handling, image preview, and different input types. Would love to hear your thoughts or suggestions!

Github Repo

/r/Python
https://redd.it/1hve7v7

Читать полностью…

Python Daily

How does the search algorithm work?

I am creating a web application in which registered users will have the opportunity to use a storage in which to store all their mp3 and wav files.
When they memorize them obviously they can listen to them and download them.
I created the user's song search system, so that he can individually select those that interest him more easily. The problem is that my system is very ugly: I take the user's input and check if the string he typed is inside the real_name column (of the file, file names stored in directories are changed to werkzeug.secure_filename) in the database and returns it.
Example: the user writes "I love" and if he presses enter the site returns "I love you.mp3", "I love him.wav", etc.
The problem is that a few small variations are enough to not give anything back.
Example: The user writes "I lo v," and the site returns nothing.
Is there an efficient algorithm?

/r/flask
https://redd.it/1hvob4c

Читать полностью…

Python Daily

WhiteNoise with Nginx for Django

I'm working on deploying a Django application, and I'm trying to figure out the best way to handle static files. Right now, I'm using WhiteNoise to serve static files.

My plan is to use Nginx as a reverse proxy for the Django app (running on Gunicorn) and also to serve static files. However, I'm not entirely sure how to configure Nginx to work alongside WhiteNoise.

1. Should I disable WhiteNoise entirely in production and let Nginx handle all static files?
2. If I keep WhiteNoise enabled, how should the Nginx configuration look?
3. Are there any pros/cons to using both together, or should I stick with one solution?

/r/django
https://redd.it/1hvi8io

Читать полностью…

Python Daily

Electric Vehicles Problems

i wanted to work on web app or SAAS product that is about Electric Vehicles. What kind of problems people are facing frequently. so, that i can put them in my application. can anyone help me out?

/r/djangolearning
https://redd.it/1hsgroa

Читать полностью…

Python Daily

File explorer issue

Hi, im just starting to learn django. the situation is this:

im creating a web and i need to make a button to open the file explorer, but when im trying to test the function the page just broke and never open file explorer, just still loading, any idea what could be and how to resolve? (i dont have the button rn, and i have no idea how to put this func in a button, im so new on web programming). Thank's!

/r/djangolearning
https://redd.it/1hsmqti

Читать полностью…

Python Daily

How to proxy to a flask/gunicorn app at a non-root location?

I have a flask app served by gunicorn that I want to proxy to through Apache (all on the same machine). I need the app to be accessible through `/wsgi` on the server.

So I'm trying this in the Apache config:

ProxyPass "/wsgi" "unix:/var/run/gunicorn/wsgi.sock|http://%{HTTP_HOST}"

This works but the problem is that `flask.url_for()` produces invalid urls because it doesn't know that it lives under `/wsgi`: It starts all generated URLs at `/` instead of `/wsgi`. It seems that I can make flask recognize this by setting the `SCRIPT_NAME` header like so:

<Location "/wsgi">
ProxyPass "unix:/var/run/gunicorn/wsgi.sock|http://%{HTTP_HOST}"
RequestHeader set SCRIPT_NAME /wsgi
</Location>

...but that doesn't work. `SCRIPT_NAME` remains set to the empty string in `flask.request.environ`.

How can this be done correctly? I don't want to do any hackery on the flask side of things (like hard-coding its "subdirectory" into the application).

Also I noticed that the `%{HTTP_HOST}` bit isn't expanded but gets passed as `%{http_host}` (lowercase) into `flask.request.environ`. Is this the intended behavior? I've got to admit that all my attempts so far have been more or less blindly copy-and-pasted from various web searches

/r/flask
https://redd.it/1hv161d

Читать полностью…

Python Daily

I built my own PyTorch from scratch over the last 5 months in C and modern Python.

What My Project Does

Magnetron is a machine learning framework I built from scratch over the past 5 months in C and modern Python. It’s inspired by frameworks like PyTorch but designed for deeper understanding and experimentation. It supports core ML features like automatic differentiation, tensor operations, and computation graph building while being lightweight and modular (under 5k LOC).



Target Audience

Magnetron is intended for developers and researchers who want a transparent, low-level alternative to existing ML frameworks. It’s great for learning how ML frameworks work internally, experimenting with novel algorithms, or building custom features (feel free to hack).

Comparison

Magnetron differs from PyTorch and TensorFlow in several ways:

• It’s entirely designed and implemented by me, with minimal external dependencies.

• It offers a more modular and compact API tailored for both ease of use and low-level access.

• The focus is on understanding and innovation rather than polished production features.

Magnetron already supports CPU computation, automatic differentiation, and custom memory allocators. I’m currently implementing the CUDA backend, with plans to make it pip-installable soon.



Check it out here: GitHub Repo, X Post

Closing Note

Inspired by Feynman’s philosophy, “What I cannot create, I do not understand,” Magnetron is my way of understanding machine learning frameworks deeply. Feedback is greatly appreciated

/r/Python
https://redd.it/1hv14tt

Читать полностью…

Python Daily

Any good resources that I can follow to deploy my application to AWS ECR?

I am using Gitlab CI pipeline. So far I have managed to create the following pipeline.

stages:
  - test
  - build

sast:
  stage: test
include:
  - template: Security/SAST.gitlab-ci.yml
  - template: Security/Secret-Detection.gitlab-ci.yml

variables:
  AWS_REGION: $AWS_ECR_REGION
  AWS_ACCOUNT_ID: $AWS_ACCOUNT_ID
  ECR_REPO_NAME: $ECR_REPO_NAME
  AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
  AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

staging-build:
  image: docker:24.0.5
  stage: build
  environment:
    name: staging
  services:
    - docker:24.0.5-dind
  rules:
    - if: '$CI_COMMIT_BRANCH == "staging"'
      when: on_success
    - when: never
  before_script:
    - apk add --no-cache python3 py3-pip aws-cli
    -

/r/djangolearning
https://redd.it/1huaovk

Читать полностью…

Python Daily

Using Djando in a Full-Stack Application, I want your opinion!

Hello everyone, how are you?

I'm using Django to build a Full-Stack, Frontend and Backend application, using Bootstrap.

The application itself will be two,

1 - School Management System, where there will be everything a management system has.
2 - System for students to see posted classes

Basically, the two complement each other.

In a world where everything is Rest API and Frontend (Vue, React or Angular), building everything Full-Stack has become rarer, at least in my opinion.

Tell me, what are the pros and cons of this? Mainly I would like to hear from those who deal with applications like this on a daily basis and who tend to grow, any tips?

Thanks everyone!

/r/django
https://redd.it/1hup0if

Читать полностью…

Python Daily

I've created a tool to make json prettier ╰(°▽°)╯

Hey everyone,

I just added a JSON Beautifier to my website: https://javu.xyz/json\_beautifier

It takes messy JSON and turns it into nicely formatted, readable JSON. Plus, it has a key case conversion feature! You can select camelCase, snake\\\_case , PascalCase, or kebab-case and transform all keys.

I built this with JavaScript mostly and the Ace Editor library (man it's such a great lib). Ace Editor handles basic JSON syntax error highlighting like a boss.

Here's a peek at some key parts of the code cause i know somes are prob curious!! ( ̄︶ ̄)↗ 

`beautifyJSON()`: Grabs the JSON, reads your selected case preference and parses the JSON. If it's invalid, it will show an error message ( pop up windows )

`convertKeysToCase(obj, converter)`:This recursively goes through every key in the JSON object and applies the selected case conversion using helper functions: `toCamelCase`, `toSnakeCase`, `toPascalCase`, `toKebabCase`. These functions use simple string manipulation, like this:

```javascript

function toCamelCase(str) {

return str.replace(/[-_\]([a-z\])/g, (g) => g[1\].toUpperCase());

}

```

Nothing really fancy ahah (~ ̄▽ ̄)~

Then, `JSON.stringify` with `null, 4` pretty-prints with a 4-space indent.

Event Listeners: "Copy", "Paste", "Clear", "Example", and "Beautify" buttons do what you'd expect! \\\^o\^/

I also added a "Back Home" button that takes you back to the main page of my site.. LOL cause yeah i forgot that

/r/flask
https://redd.it/1hu4sgk

Читать полностью…

Python Daily

Should PyPI allow 2 projects to have the same name for importing

In the install instructions for the ibis framework we read:

> the ibis-framework package is not the same as the ibis package in PyPI. These two libraries cannot coexist in the same Python environment, as they are both imported with the ibis module name.


1. What do you think of authors who knowingly build their package to "stomp" on a pre-existing namespace?
1. should PyPI allow such name collisions to occur?


/r/Python
https://redd.it/1hu7d17

Читать полностью…

Python Daily

Chainmock - Mocking library for Python and pytest

I recently released v1.0 of a mocking library that I've been developing for a while. I use it in multiple projects myself and thought others might find it useful in their projects.

Github: https://github.com/ollipa/chainmock

Documentation: https://chainmock.readthedocs.io

What the project is:

Chainmock allows mocking, spying, and creating stubs. It's fully typed and works with unittest, doctest and, pytest. The syntax works especially well with pytest fixtures. Under the hood Chainmock uses Python standard library mocks providing an alternative syntax to create mocks and assertions. It also comes with some additional features to make mocking and testing easier.

Example:

mocker(Teapot).mock("brew").return_value("mocked").called_twice()

mocker(Teapot).spy("add_tea").any_call_with("green").call_count_at_most(2)


Target Audience:

Python developers who want a more ergonomic mocking API for their test suites. The syntax works especially well for developers using pytest fixtures.

Comparison:

Similar to pytest-mock library, Chainmock cleans up mocks automatically but provides a more ergonomic API and also evaluates assertions lazily.

Chainmock's API is heavily inspired by flexmock. Compared to flexmock, Chainmock has more familiar API if you have been using standard library unittest and also supports async mocking.



/r/Python
https://redd.it/1hu44o4

Читать полностью…

Python Daily

Asking about easy FRONTEND tools.

I have learnd django with REST Framework
Is it necessary to learn JS to build the front end or there is another easy tools.

I know thats important to learn JS, but I want a quick way to view my projects like other sites.


/r/djangolearning
https://redd.it/1hvq5tu

Читать полностью…

Python Daily

Built a Drag-and-Drop GUI Builder for CustomTkinter – Check It Out and Share Your Thoughts!

Hey Python devs!

I recently built a drag-and-drop GUI tool for customTkinter to simplify designing interfaces. It lets you visually create UIs and export the code directly, which has been super helpful for my projects.

I’d love to hear your thoughts and feedback on it! You can check it out on GitHub https://github.com/Proxlight/Buildfy-Free.git

I’m particularly interested in:
• Usability: Is the drag-and-drop interface intuitive?
• Features: What could make it even better?

Feel free to give it a try and let me know what you think. Any feedback would be amazing!

Thanks!

/r/Python
https://redd.it/1hvnyxn

Читать полностью…

Python Daily

Developing locally after deployment? (Oauth issues)

I built my flask app and just deployed it on python anywhere. I updated my oauth credentials to point to the real site rather than localhost.

My login functionality no longer works locally (I'm only supporting Google login, no passwords/email).

How do others get around this? Perhaps have something set in the code so if app is running in debug mode the user skips login?

/r/flask
https://redd.it/1hvppmk

Читать полностью…

Python Daily

Need suggestions on a flask-based cashflow management app with LLM

Hey r/flask folks! About a few months ago I shared my cash flow tracking project post , a modern cash flow management system that leverages AI for financial insights. And got some amazing feedback from you all. I've been coding like crazy since then and wanted to get improvement feedback!

Github repo

🛠️ Tech Stack

Backend: Flask + SQLAlchemy
Frontend: Vanilla JS + Chart.js
Database: SQLite (will use PostgreSQL or MySQL on prod)
AI: Anthropic's Claude 3 Sonnet
Authentication: Flask-Login
Forms: Flask-WTF
Migration: Flask-Migrate
Data Processing: Pandas + NumPy
Visualization: Chart.js + Matplotlib
File Handling: OpenPyXL

🏗️ Architecture

https://preview.redd.it/xaedzaklnhbe1.png?width=1120&amp;format=png&amp;auto=webp&amp;s=8173570a7c7271cb2bb251eb9ffa727d2fc12fae

💡 Key Features

Smart Analysis: AI-powered insights into cash flow patterns Real-time Monitoring: Live tracking of financial metrics Data Visualization: Interactive charts and graphs Bulk Operations: Efficient data import/export Multi-user Support: Secure user isolation and preferences

🔜 Coming Soon

Custom date range analysis API integrations Advanced reporting Team collaboration features Mobile app

Would love to hear your thoughts and suggestions! Feel free to contribute or raise issues on GitHub.

/r/flask
https://redd.it/1hvhx8g

Читать полностью…

Python Daily

Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1hvdxdo

Читать полностью…

Python Daily

py2exe.com - flask app to convert python files to exe online

Hi,

I made a website (https://py2exe.com/) that compiles python to exe in the cloud. It could be useful for someone that wants to make .exe from python on linux, which is quite difficult to do.

The website is written in flask and the compilation is done via pyinstaller through wine. I would really appreciate it if someone could try it out with their project and share their thoughts.

The code is available on github (https://github.com/cenekp74/py2exe). I would love to hear your thoughts on my implementation of celery task queue or any other part of the flask app since I am not an expert and would love to improve.

Thanks!

/r/flask
https://redd.it/1hvcm8o

Читать полностью…

Python Daily

Is my way of validating deletion forms inherently bad?

In a lot of places in the website I'm making, I need to make a button that sends the primary key of an object displayed in a list on the page to the server for it to do an action on the object like deleting it or incrementing the value of one of its fields. In those cases, I make a django form with a "type" and "object\_pk" hidden field.

In my view, I then loop on the queryset of every object I want to display in the list and append a dictionnary containing the object itself and its associated form to a list before passing it to the template as context. In this kind of situation, I can't just pass the form itself as context because its "object\_pk" field needs to have a different value for each object. I then display the submit button of each form to the user.

If the user comes to click on the button (let's say it's a delete button) the pk of the object is then sent to the same view which would resemble something like this:

def my_view(request):
if request.method == "POST" and request.POST["type"]

/r/djangolearning
https://redd.it/1hvf3bv

Читать полностью…

Python Daily

First personal project


Hey guys, I made my first project in django and react. It's a website that scraps IT job offers from all most popular websites in Poland. I want to look for junior role soon and created it to help me with that.

It's easy to have all job offers in one place, you can save job and track your recrutation process, add notes.
I also summarize description to display only essential info, mainly what company needs.

It's supposed to also help me track what skills are in demand currently.
It took longer than I expected, but want to finally be done with it. I would appreciate some suggestions, feedback 😀

https://devradar.work/

/r/django
https://redd.it/1huyeej

Читать полностью…

Python Daily

Python running on Wasm / NEAR under 1MB Challenge

I have tried RustPython and MicroPython and so far. The best result I got with RustPython was 4.3MB and MicroPython got much further (230kb), but there are still some use of unsupported Wasm features or not provided host functions that must be avoided, so here we are with this challenge and a sizeable price for it.

$300k in grants

More details can be found on the GitHub Discussion boards of:

* RustPython: https://github.com/RustPython/RustPython/discussions/5467

* MicroPython: https://github.com/orgs/micropython/discussions/16427

/r/Python
https://redd.it/1huxrs6

Читать полностью…

Python Daily

Tuitorial - I built a terminal-based tool for code presentations because PowerPoint was too painful


# What My Project Does

[Tuitorial](https://github.com/basnijholt/tuitorial) lets you create interactive code tutorials that run in your terminal. The key insight is that you define your code ONCE, then create multiple views highlighting different parts using pattern matching rules - no more copy-pasting code snippets across slides! Features include:

* Write code once, create multiple highlighted views
* Interactive step-by-step navigation
* Rich syntax highlighting
* Support for Markdown and even images
* Configure via Python or YAML
* Live reload for quick iterations

Here's a quick demo: [https://www.nijho.lt/post/tuitorial/tuitorial-0.4.0.mp4](https://www.nijho.lt/post/tuitorial/tuitorial-0.4.0.mp4) which runs [this YAML format presentation `pipefunc.yaml`](https://github.com/basnijholt/tuitorial/blob/main/examples/pipefunc.yaml)

# Target Audience

This is for the 0.1% of people who:

* Are giving technical presentations or workshops
* Love terminal-based tools
* Are tired of copying the same code into multiple PowerPoint slides
* Want version-controlled, reproducible tutorials

It's particularly useful for teaching scenarios where you want to focus attention on specific parts of code while keeping everything in context.

# Comparison to Existing Alternatives

The problem with traditional tools:

* PowerPoint/Google Slides: Forces you to copy-paste code multiple times just to highlight different parts
* Jupyter notebooks: Great for readers, but during presentations there's too much text for the audience to get distracted by
* Spiel: While also terminal-based, it's more for general presentations without code-specific features
* REPLs: Interactive but lack structured presentation
*

/r/Python
https://redd.it/1huqhvc

Читать полностью…

Python Daily

Potato - A Lightweight Tool for Debugging and Testing Python Code

# Potato: A Lightweight Tool for Debugging and Testing Python Code

# What is Potato?

Potato is a Python package designed to halt your code's execution with precision and simplicity. It’s perfect for debugging, testing control flow, or adding a bit of fun to your scripts. The best part? You don’t even have to install it. Python natively supports Potato, thanks to its strict variable naming rules.

Just type potato into your source code and watch the magic happen! Your script will immediately halt with a NameError, leaving your colleagues (or future self) wondering why there's a potato in your code.

# Why Potato?

Zero Dependencies: Potato requires absolutely no installations or updates.
Lightweight: Takes up 0 bytes of storage.
Instant Debugging: Clearly marks the exact point in your code where Potato strikes.
Fun for Everyone: Confuse your friends, co-workers, and even your future self with a well-placed potato!

# Installation

There is no installation. Python comes with Potato pre-installed. Simply open your favorite Python script and start typing potato.

# Usage

# Example 1: Halting a Script

print("Hello, world!")
potato
print("This will never run.")

Output:

Hello, world!
Traceback (most recent call last):


/r/Python
https://redd.it/1huiq1y

Читать полностью…

Python Daily

Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1huld8j

Читать полностью…

Python Daily

Webhooks using python and deployment

I have to make an app in Python that exposes a webhook, processes the request, and makes an HTTP request at the end, which is pretty similar to Zapier/make/n8n.

The app is gonna work on a large scale handling around 1k requests every day. I have experience with Flask, but I am not sure if it is the best choice or should I switch to Django or FastAPI or any other stuff you can recommend, I want to make this app as optimized as possible because it has to replace a make.com scenario. Also, is Python the best choice or I should switch to node.js

Last, I wanna know what can be the best and cost effective deployment solution for it, fly.io, cloud services, render etc.

/r/flask
https://redd.it/1hudyve

Читать полностью…

Python Daily

Guidance on python backend

Hi

I would appreciate some guidance on initial direction of a project I'm starting.

I am an engineer and have a good background in python for running scripts, calculations, API interactions, etc. I have a collection of engineering tools coded in python that I want to tidy up and build into a web app.

I've gone through a few simple 'hello' world flask tutorials and understand the very basics of flasm, but, I have a feeling like making this entirely in flask might be a bit limited? E.g I want a bit more than what html/CSS can provide. Things like interactive graphs and calculations, displaying greek letters, calculations, printing custom pdfs, drag-and-drop features, etc.

I read online how flask is used everywhere for things like netflix, Pinterest, etc, but presumably there is a flask back end with a front end in something else?

I am quite happy to learn a new programming language but don't want to go down the path of learning one that turns out to be right for me. Is it efficient to build this web app with python and flask running in the background (e.g to run calculations) but have a JS front end, such a vue.js? I would

/r/flask
https://redd.it/1hu6syw

Читать полностью…

Python Daily

post response

i need someone's help to handle the response

i only get this response

{
"firstname": "John",
"middle
name": "",
"lastname": "Doe",
"date
ofbirth": "2000-07-14",
"email": "
johndoe@gmail.com"
}


with this serializer

class RegisterUserSerializer(ModelSerializer):
address = AddressSerializer(required=False)
class Meta:
model = CustomUser
fields = ("first
name", "middlename", "lastname", "dateofbirth", "email", "address")

def create(self, validateddata):
address
data = validateddata.pop('address')
user = CustomUser.objects.create(**validated
data)
Address.objects.create(addressdata, user=user)
return user


i want the response something like this

{
"first
name": "John",


/r/django
https://redd.it/1hu84tk

Читать полностью…
Subscribe to a channel