![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
django-cprofile-middleware
Advanced tools
This is a simple profiling middleware for Django applications. I wrote it because I got tired of printing "start" "stop" "stop 2" in my programs to find the bottlenecks.
I found a simple example on @dcramer's slideshare and modified it to support sorting.
$ pip install django-cprofile-middleware
Then add django_cprofile_middleware.middleware.ProfilerMiddleware
to the end your MIDDLEWARE
in settings.py. This option was called MIDDLEWARE_CLASSES
in versions of Django before 1.10.
For example:
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'startup.do.work.FindProductMarketFitMiddleware',
...
'django_cprofile_middleware.middleware.ProfilerMiddleware'
)
The profiler will only be available when the Django setting DEBUG
is set to True
. By default it's also required to be an authenticated user with is_staff
set to True
which is making the request to be profiled. The is_staff
check can be configured as follows:
DJANGO_CPROFILE_MIDDLEWARE_REQUIRE_STAFF = False
Once you've installed it, log in as a user who has staff privileges and add ?prof
to any URL to see the profiler's stats. For example to see profile stats for http://localhost:8000/foo/
, visit http://localhost:8000/foo/?prof
.
You can also pass some options:
count: The number of results you'd like to see. Default is 100.
sort: The field you'd like to sort results by. Default is time
. For all the options you can pass, see the docs for pstats.
download: Download profile file, that can be visualized in multiple viewers, e.g. SnakeViz or RunSnakeRun
Email me with any questions: omar.bohsali@gmail.com.
FAQs
Easily add cProfile profiling to django views.
We found that django-cprofile-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.