Saravanan666/pypi-org huggingface dataset:
Package: bayes-splicing
bayes-splicingPython package for Bayesian inference of splicing distributionsThis package implements an efficient Sequential Monte Carlo Sampling (SMC) algorithm. Splicing models, also called composite models, are fitted to the data and compared using Bayesian statistics toolsThis package is the result of my paper "Sequential Monte Carlo Sampler to fit and compare insurance loss models". To install simply runpip install bayes-splicing.For example, imagine we have a sample of insurance losses and we would like to fit a composite model based on the exponential and Pareto distributions.importbayes_splicingasbsimportpandasaspdimportnumpyasnp# Definition of the exponential-Pareto composite modelf1,f2=bs.loss_model("Exp",["lambda"]),bs.loss_model("Pareto-Tail",["alpha"])# Type of composite models include "disjoint", "simple" and "continuous"model_type="continuous"f=bs.spliced_loss_model(f1,f2,model_type,thresh_name="gamma")# We will fit the above model to the famous danish fire insurance data set# danish = pd.read_csv("data/danish.csv").x# X = danish.valuesparms_true=np.array([1/3,2,1])X=f.sample(parms_true,1000)# Prior distributions over the model parameterslambda_prior=bs.prior_model('gamma','lambda',1,1)alpha_prior=bs.prior_model('gamma','alpha',1,1)gamma_prior=bs.prior_model('uniform','gamma',min(X),max(X))prior_spliced_model=bs.independent_priors([lambda_prior,alpha_prior,gamma_prior])# The smc function deliver the trace, the log marginal likelihood along with some information criteriapopSize=2000trace,log_marg,DIC,WAIC=bs.smc(X,f,popSize,prior_spliced_model)# The posterior distributionsbs.posterior_plots(f,trace)# The trace plotbs.trace_plots(f,trace)# The quantile-quantile plotf.set_ppf()bs.qq_plot(X,f,trace.mean().values)
Package: bayessynth
bayessynth:BSC Models in PythonThe bayessynth package is a Python implementation of the Bayesian Synthetic Control (BSC). BSC is a probabilistic method for quantitative social science, developed inTuomaala (2019)[1]. It includes tools to estimate the BSC model with Markov Chain Monte Carlo (MCMC) sampling and to analyze and visualize the results.DocumentationLimited documentation for the library is available separately within this git repository.DependenciesFitting of the BSC model is done usingpymc3, which itself uses depends ontheanoandscipy. Other fundamental dependencies includenumpy,pandas, andsklearn, as well as the visualization librariesmatplotlibandseaborn.AuthorElias TuomaalaWebsite:www.eliastuomaala.comEmail:mail@eliastuomaala.comLicenseThe bayessynth copyright belongs to Elias Tuomaala (2020). It is released under the MIT License.Exampleimport numpy as np
import pandas as pd
import bayessynth as bs

data_source, target_country, cutoff_year = 'gdp.csv', 'DEU', 1990
factors = 4
prior_distribution = {
                      'sigma_gamma': 500,
                      'k_mu': 16000,
                      'k_sd': 7000,
                      'k_gamma': 7000,
                      'alpha_sd': 30000,
                      'alpha_mu': 0,
                      'b_mu': 0,
                      'b_sd': 1,
                      'b_gamma': 1,
                      'delta_mu': 0,
                      'delta_sd': 10000
}
data = pd.read_csv(data_source)

bs.fit(data, target_country, cutoff_year, prior_distribution)
trace = bs.read_tracefile(target, data, factors)
result_summary = bs.summarize_ppc(target_country, data, trace, factors)
bs.plot(result_summary, cutoff_year, target_country, output='display')[1]: Elias Tuomaala. (2019) "The Bayesian Synthetic Control: Improved Counterfactual Estimation in the Social Sciences through Probabilistic Modeling."Arxiv Open Access.
Package: bayes-tda
bayes_tdaThis module contains classes to implement a marked Poisson process model for Bayesian inference with persistence diagrams. The model relies on mixed Gaussian assumptions. For a full description of the model, please refer tohttps://arxiv.org/abs/1901.02034.InstallationUse the package managerpipto install bayes_tda.pipinstallbayes_tdaClassesClass nameDescriptionMethodsWedgeGaussianGaussian density restricted to upper half of $\mathbb{R}^2$.evalPriorMixed Gaussian prior intensity.evalPosteriorMixed Gaussian posterior intensity.evalUsagefrombayes_tdaimport*importmatplotlib.pyplotaspltimportnumpyasnpx=[0,0]# a point in birth-persistence coordinateswg=WedgeGaussian(mu=[0,0],sigma=1)# Gaussian densities restricted to the upper half planed=wg.eval(x)# evaluates the Gaussian density at xmeans=np.array([[0,0],[6,6]])ss=[1,1]ws=[1,1]pri=Prior(weights=ws,mus=means,sigmas=ss)d_pri=pri.eval(x)b=np.linspace(0,10,50)p=np.linspace(0,10,50)B,P=np.meshgrid(b,p)Z=list()forindinrange(len(P)):l=list()foriinrange(len(P)):l.append(pri.eval([B[ind][i],P[ind][i]]))Z.append(l)plt.style.use('seaborn-white')plt.contourf(B,P,Z,20,cmap='twilight')plt.colorbar()plt.show()noise=Prior(weights=[0],mus=[[30,30]],sigmas=[10])post=Posterior(prior=pri,clutter=noise,Dy=[[1,5],[5,1]],sy=1)peval=post.eval(x)Z=list()forindinrange(len(P)):l=list()foriinrange(len(P)):l.append(post.eval([B[ind][i],P[ind][i]]))Z.append(l)plt.style.use('seaborn-white')plt.contourf(B,P,Z,20,cmap='twilight')plt.colorbar()plt.show()Reporting BugsReport any bugs by opening an issue athttps://github.com/coballejr/bayes_tda/.LicenseMIT
Package: bayestestimation
Class method for Bayesian estimation and comparison of meansFree software: MIT licenseFeaturesClass method that acts as a wrapper for a pystan formulation of a Bayesian ‘t-test’ using the BEST implementation.Estimates the posterior distributions of the mean and standard deviation parameters for two samples, A and B.Estimates the posterior distribution of the difference in mean parameters for two samples, A and B.Provides summary statistics and visualisations for the estimated parameters.The prior parameters, sample count, random seed, credible intervals, HDI and parameter names can all be customised.The stan model object and stan model fit object can be still accessed and edited using pystan methods directly.
Package: bayes-toolbox
bayes-toolboxbayes-toolbox(aka, Bayesian Statistics Toolbox [BST]) is a Python package for running sophisticated Bayesian analyses in a simple, straight forward manner.DocumentationThe documentation forbayes-toolboxis hostedhere.InstallationThe recommended method of installing bayes-toolbox is withpip:pip install bayes_toolboxSee theinstallation instructionsin thedocumentationfor more detailed information.Citing bayes-toolboxIf you usebayes-toolboxin your work, please cite our Journal of Open Source Software (JOSS) article:APA format:Kim, H. E. (2023). bayes-toolbox: A Python package for Bayesian statistics. Journal of Open Source Software, 8(90), 5526.https://doi.org/10.21105/joss.05526BibTeX format:@article{Kim_bayes-toolbox_A_Python_2023,
author = {Kim, Hyosub E.},
doi = {10.21105/joss.05526},
journal = {Journal of Open Source Software},
month = oct,
number = {90},
pages = {5526},
title = {{bayes-toolbox: A Python package for Bayesian statistics}},
url = {https://joss.theoj.org/papers/10.21105/joss.05526},
volume = {8},
year = {2023}
}LicenseThis work is distributed for free under aMIT license.AcknowledgmentsThank you to the following people for generously sharing their work and knowledge:John KruschkeRichard McElreathJordi WarmenhovenPyMC developersArviZ developersContributorsSee theCONTRIBUTORS.mdfile for a regularly updated list of contributors.
Package: bayes-traj
bayes_trajAlgorithms and tools for Bayesian trajectory modelingpipinstallprovenance_tools
pipinstallbayes_trajOverview of codemult_dp_regression.pyis the current non-pyro model
"multivariate Dirichlet process regression"generate_prior.pycreates a prior file.viz_data_prior_draws.pyprior predictive checks.bayes_traj_main.py --out_model PICKLE_FILEsaves a trajectory model
configured by other tools.
This inputs a prior file.viz_model_trajs.pyis posterior predictive check,
visualizes the learned clusters.sumarize_traj_model.pyprints additional info.assign_trajectory.pyreads in the model + data.csv and outputs a
data.csv file with one appended column that is the assigned trajectory.Other files are legacy.Running testspytestor when debuggingpytest-vsx--pdb
Package: bayesvalidrox
BayesValidRoxAn open-source, object-oriented Python package for surrogate-assisted Bayesain Validation of computational models.
This framework provides an automated workflow for surrogate-based sensitivity analysis, Bayesian calibration, and validation of computational models with a modular structure.Authors@faridInstallationThe best practive is to create a virtual environment and install the package inside it.To create and activate the virtual environment run the following command in the terminal:python3-mvenvbayes_envcdbayes_envsourcebin/activateYou can replacebayes_envwith your preferred name. For more information on virtual environments seethis link.Now, you can install the latest release of the package on PyPI inside the venv with:pipinstallbayesvalidroxand installing the version on the master branch can be done by cloning this repo and installing:gitclonehttps://git.iws.uni-stuttgart.de/inversemodeling/bayesvalidrox.gitcdbayesvalidroxpipinstall.FeaturesSurrogate modeling with Polynomial Chaos ExpansionGlobal sensitivity analysis using Sobol IndicesBayesian calibration with MCMC usingemceepackageBayesian validation with model weights for multi-model settingRequirementsnumpy==1.22.1pandas==1.2.4joblib==1.0.1matplotlib==3.4.2seaborn==0.11.1scikit-learn==0.24.2tqdm==4.61.1chaospy==4.3.3emcee==3.0.2corner==2.2.1h5py==3.2.1statsmodels==0.13.2TexLive for Plotting with matplotlibHere you need super user rightssudoapt-getinstalldvipngtexlive-latex-extratexlive-fonts-recommendedcm-super
Package: bayes-window
Bayes WindowPretty and easy hierarchical Bayesian or linear mixed effects estimation with data overlayFree software: MIT licenseDocumentation:https://bayes-window.readthedocs.io.TODOLess haphasard testingShrinkage layer: Should be as easy as alt.layer with unpooled modelMake sure + works well with facethow is holoviz with coposite overlays? Maybe the facet method is not necessary thenrelated tohttps://github.com/vega/vega-lite/issues/4373#issuecomment-447726094delete facet attribute of chart if independent_axes=TrueFormalize detailed data plot: trial-slope plus box. Try to add posteriors? see notebookRandom-effect plots (eg intercepts): bw.plot_extras?see lfp notebookDecide on Vega themeFeaturesTODOHistory0.1.0 (2021-02-05)First release on PyPI.
Package: bayeux
Bayeux provides a module for generating TAP stream
(http://testanything.org/). Unfortunately, the name tapestry has been
already taken, so I took an inspiration fromhttps://en.wikipedia.org/wiki/Bayeux_Tapestry.Aside from the script for generating the TAP stream programtically,
there is also a version of unittest2 which generates TAP stream instead of
the standard output of unittest.Whole this package is licensed under MIT/X11 license (see header of tap.py
for details).
Package: bayeux-ml
BayeuxStitching together models and samplersbayeuxlets you write a probabilistic model in JAX and immediately have access to state-of-the-art inference methods. The API aims to besimple,self descriptive, andhelpful. Simply provide a log density function (which doesn't even have to be normalized), along with a single point (specified as apytree) where that log density is finite. Then letbayeuxdo the rest!Installationpipinstallbayeux-mlQuickstartWe define a model by providing a log density in JAX. This could be defined using a probabilistic programming language (PPL) likenumpyro,PyMC,TFP, distrax, oryx, coix, or directly in JAX.importbayeuxasbximportjaxnormal_density=bx.Model(log_density=lambdax:-x*x,test_point=1.)seed=jax.random.key(0)opt_results=normal_density.optimize.optax_adam(seed=seed)# OR!idata=normal_density.mcmc.numpyro_nuts(seed=seed)# OR!surrogate_posterior,loss=normal_density.vi.tfp_factored_surrogate_posterior(seed=seed)Read moreDefining modelsInspecting modelsTesting and debuggingAlso seebayeuxintegration withnumpyro,PyMC, andTFP!This is not an officially supported Google product.
Package: bayex
Bayex: Minimal Bayesian Optimization in JAXInstallation|Usage|Contributing|LicenseBayex is a lightweight Bayesian optimization library designed for efficiency and flexibility, leveraging the power of JAX for high-performance numerical computations.
This library aims to provide an easy-to-use interface for optimizing expensive-to-evaluate functions through Gaussian Process (GP) models and various acquisition functions. Whether you're maximizing or minimizing your objective function, Bayex offers a simple yet powerful set of tools to guide your search for optimal parameters.InstallationBayex can be installed usingPyPIviapip:pip install bayexor from GitHub directlypip install git+git://github.com/alonfnt/bayex.gitLikewise, you can clone this repository and install it locallygitclonehttps://github.com/alonfnt/bayex.gitcdbayex
pipinstall-rrequirements.txtUsageUsing Bayex is quite simple despite its low level approach:importjaximportnumpyasnpimportbayexdeff(x):return-(1.4-3*x)*np.sin(18*x)domain={'x':bayex.domain.Real(0.0,2.0)}optimizer=bayex.Optimizer(domain=domain,maximize=True,acq='PI')# Define some prior evaluations to initialise the GP.params={'x':[0.0,0.5,1.0]}ys=[f(x)forxinparams['x']opt_state=optimizer.init(ys,params)# Sample new points using Jax PRNG approach.ori_key=jax.random.key(42)forstepinrange(20):key=jax.random.fold_in(ori_key,step)new_params=optimizer.sample(key,opt_state)y_new=f(**new_params)opt_state=optimizer.fit(opt_state,y_new,new_params)with the results being saved atopt_state.ContributingWe welcome contributions to Bayex! Whether it's adding new features, improving documentation, or reporting issues, please feel free to make a pull request or open an issue.LicenseBayex is licensed under the MIT License. See thefile for more details.
Package: bayfile-uploader
Bayfile UploaderUploads a file tobayfiles.comInstallationpip install bayfile_uploaderor from Github:git clone https://github.com/roymanigley/bayfile_uploader.git
cd bayfile_uploader
python setup.py installUsagefrombayfile_uploader.uploaderimportupload_filelink=upload_file('/path/to/file')print(f'The file is uploaded:{link}')or from the commandlinebayfile_upload --file /path/to/file
Package: bayfox
bayfoxExperimental Bayesian planktic foraminifera calibration, for Python.Please note that this package is currently under development. It will eat your pet hamster.Quick exampleFirst, load key packages and an example dataset:import numpy as np
import bayfox as bfox

example_file = bfox.get_example_data('VM21-30.csv')
d = np.genfromtxt(example_file, delimiter=',', names=True, missing_values='NA')This data (fromKoutavas and Joanides 2012)
has three columns giving, down-core depth, sediment age (calendar years BP) and δ18O forG. ruber(white) (‰; VPDB).
The core site is in the Eastern Equatorial Pacific.We can make a prediction of sea-surface temperature (SST) withpredict_seatemp():prediction = bfox.predict_seatemp(d['d18O_ruber'], d18osw=0.239, prior_mean=24.9, prior_std=7.81)The values we're using for priors are roughly based on the range of SSTs we've seen forG. rubersediment
cores in the modern period, though the prior standard deviation is twice the spread in the modern
record. Let's use δ18O of modern seawater (‰; VSMOW) near the site (LeGrande and Schmidt 2006). We'll assume it's constant -- for simplicity.
We're also not correcting these proxies for changes in global ice volume, so these numbers will be off. Ideally we'd make
this correction to δ18Oc series before the prediction. See theerebusfallpackagefor simple ice-volume correction in Python.To see actual numbers from the prediction, directly parseprediction.ensembleor useprediction.percentile()to get
the 5%, 50% and 95% percentiles. You can also plot your prediction withbfox.predictplot(prediction).This uses the pooled Bayesian calibration model, which is calibrated on annual SSTs. We can consider foram-specific
variability with:prediction = bfox.predict_seatemp(d['d18O_ruber'], d18osw=0.239, prior_mean=24.9, prior_std=7.81, 
                                  foram='G. ruber')which uses our hierarchical model calibrated on annual SSTs. We can also estimate foram-specific seasonal effects with:prediction = bfox.predict_seatemp(d['d18O_ruber'], d18osw=0.239, prior_mean=24.9, prior_std=7.81, 
                                  foram='G. ruber', seasonal_seatemp=True)This uses our hierarchical model calibrated on seasonal SSTs. Be sure to specify the foraminifera if you use this option.You can also predict δ18O for planktic calcite using similar options, using thepredict_d18oc()function.InstallationTo installbayfoxwithpip, run:pip install bayfoxTo installbayfoxwithconda, run:conda install -c sbmalev bayfoxbayfoxis not compatible with Python 2.Support and developmentPlease feel free to report bugs and issues or view the source code on GitHub (https://github.com/brews/bayfox).Licensebayfoxis available under the Open Source GPLv3 (https://www.gnu.org/licenses).
Package: bayhess
The BayHess package uses noisy curvature pairs (noisy gradient differences computed at different points) to compute Hessian approximations. These Hessian approximations can be used to accelerate the convergence in stochastic optimization in a quasi-Newton fashion. To find a Hessian approximation, a posterior distribution of the Hessian is built. The prior distribution is based on the Frobenius norm with determinant constraints to impose extreme eigenvalues constraints and the likelihood distribution is built from the secant equations given the observed curvature pairs. To find the maximizer of the log posterior, the BayHess package uses the Newton-CG method with a homotopy approach to deal with the logarithmic barrier determinant constraints.For a detailed description of the method, convergence analysis and numerical results, check ourmanuscriptnamed “Approximating Hessian matrices using Bayesian inference: a new approach for quasi-Newton methods in stochastic optimization”. This package can be used with theMICEestimator.A BayHess object is created by giving the dimensionality of the problem, and lower and upper bounds of the eigenvalues of the Hessian; i.e., strong convexity and smoothness parameters.>>> bay = BayHess(n_dim=10, strong_conv=1e-3, smooth=1e4)Curvature information is passed using the ‘update_curv_pairs’ method>>> bay.update_curv_pairs(sk, yk)And, finally, computing the Hessian approximation is done by>>> hess = bay.find_hess()Install BayHess from PyPI as>>> pip install bayhessA repository with numerical examples can be found athttps://github.com/agcarlon/bayhess_numericsThe documentation of the BayHess package is available athttps://bayhess.readthedocs.io/
Package: bayis-sqs-callback
SQS Callback decoratorPython decorator for registering message handlers from Simple Queue Service endpoints.decorator register callbacks for specific queueslistento iterate over all callbacks, read messages from queues and dispatchpostto quickly send data to a queue and obtain message IDinstallpipinstallbayis-sqs-callbackusageimportsqsfn@sqsfn.sqs_queue_listener(sqs_queue_name="my-queue-name")defmy_example_queue_listener(data_from_queue):"""process a queue item"""print("recieved data")returnTrueif__name__=="__main__":asyncio.run(sqsfn.listen())multiple queuesimportsqsfn@sqsfn.sqs_queue_listener(sqs_queue_name="queue-a")defmy_example_queue_listener(data_from_queue_a):print("received from queue a")sqsfn.post("queue-b",data_from_queue_a)returnTrue@sqsfn.sqs_queue_listener(sqs_queue_name="queue-b")defmy_example_queue_listener(data_from_queue_b):print("received from queue b")sqsfn.post("queue-c",data_from_queue_b)returnTrue@sqsfn.sqs_queue_listener(sqs_queue_name="queue-c")defmy_example_queue_listener(data_from_queue_c):print("received from queue c")sqsfn.post("queue-a",data_from_queue_c)returnTrueif__name__=="__main__":asyncio.run(sqsfn.listen())success and failure queuestheon_successandon_failoptional parameters accept a function which
will be called on successful processing of the message or otherwise.importsqsfn@sqsfn.sqs_queue_listener(sqs_queue_name="my-queue-name",on_success=lambdax:sqsfn.post("my-success-queue",x),on_fail=lambdax:sqsfn.post("my-fail-queue",x))defmy_example_queue_listener(data_from_queue):"""process a queue item"""print("recieved data")returnTrueif__name__=="__main__":asyncio.run(sqsfn.listen())
Package: baykeshop
baykeShop开源商城系统项目简介baykeShop（拜客商城系统）是一款全开源Python栈商城系统，后端依托django强大的框架体系，本项目融合了django的传统模版体系，同时轻微结合了前后端分离的开发方式，在不同场景选择了不同的技术栈，使其更具学习和研究价值，并且很好的打包为一个Python包文件，使其二次开发以及集成到自身项目更加简便易用，更是python django初学者开发上手学习的不二选择！项目演示商城PC端前台：http://s.bayke.shop视频教程视频教程：django4商城系统开发实战进阶【免费连载中】_哔哩哔哩_bilibili安装配置：https://www.bilibili.com/video/BV1ea4y1X72f/功能使用：https://www.bilibili.com/video/BV1mj411e73h/安装pipinstallbaykeshop配置在项目settings.py中的最后引入# 开发时配置frombaykeshop.conf.developimport*# 或者# 部署时配置frombaykeshop.conf.productionimport*特别说明：本项目覆盖了默认的admin进行了定制，需要将INSTALLED_APPS配置中默认的admin配置注释掉!INSTALLED_APPS = [
    # 'django.contrib.admin',
]项目urls.py中引入urlfromdjango.confimportsettingsfromdjango.conf.urls.staticimportstaticurlpatterns=[path('admin/',admin.site.urls),# baykeshop的全部urlpath('',include("baykeshop.urls")),# 开发时静态文件配置*static(settings.STATIC_URL,document_root=settings.STATIC_ROOT),*static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)]迁移数据pythonmanage.pymakemigrationspythonmanage.pymigrate初始化必要数据pythonmanage.pyinitdata部署部署方式多种多样，本项目作为一个包文件，将不会决定参与到你的部署过程当中，你可以根据你自身项目的需求以及django的官方文档来部署你的项目！在部署过程中如果采用异步asgi的方式部署，可能会有异步安全类错误SynchronousOnlyOperation，根据django官方文档给的提示和解决方案是在项目的settings.py中配置如下代码即可解决：importosos.environ["DJANGO_ALLOW_ASYNC_UNSAFE"]="true"特别说明：项目配置中对缓存并没有特别配置，默认使用了django的内存缓存，部署时建议设置为reids缓存或者数据库缓存，否则邮件验证会有小问题！配置说明邮件配置以及支付宝配置均在后台的系统分类下的广告内容中配置，特别需要注意的是支付宝的应用私钥格式需要转换为PKCS1格式，可使用支付宝开放平台秘钥工具进行转换！DEBUG模式下支付宝默认为沙箱环境，部署时一定要关闭django的DEBUG模式，否则支付不能正确跳转！社交平台微信公众号、头条、西瓜视频、B站、抖音账号均为“轻编程”, 可搜索关注，微信公众号会定期发送福利！赞赏支持如果本项目或教程给您带来了帮助，您可以酌情赞赏创作者！您的赞赏将有利于该项目的持续维护和开发，以及用作文档服务器的延续！作为一名敬业的开发者，不能保证能带着你发财致富，但却可以将我的知识传递给您！如果你也觉得知识就是财富，那么凡赞赏金额大于20元者，将会添加作者微信以及加入微信群与一众志同道合的开发者共同交流，探讨技术，关于该项目作者也会群内答疑，直播答疑，与大家尽情互动！赞赏留言直接备注您的微信号，我会搜索添加哦！如果没有备注，可以私信我哦！赞赏记录微信昵称赞赏金额/元渠道WuRay100微信bin100微信挽风50微信晨希科技50微信知行合一50微信亭长100微信牛腩炖番茄50微信天书50微信Tan大人20+100支付宝+微信Zhao20微信让风告诉你50微信
Package: bayketinymce-django
bayketinymce安装配置安装pipinstallbayketinymce-django配置1、在django项目配置文件settings文件中的INSTALLED_APPS注册app,并设置图片上传保存路径INSTALLED_APPS=[...'tinymce',]MEDIA_URL='media/'MEDIA_ROOT=BASE_DIR/'media'2、上传图片配置在django项目的根urls.py中引入以下urlfromdjango.urlsimportpath,includefromdjango.confimportsettingsfromdjango.conf.urls.staticimportstaticfromtinymce.viewsimportTinyMCEImageUploadurlpatterns=[path('admin/',admin.site.urls),# 富文本编辑器上传图片urlpath("tinymce/upload-image/",TinyMCEImageUpload.as_view(),name="tinymce-upload-image")]# 开发环境下配置静态文件URLifsettings.DEBUG:urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)快速使用在models中使用fromtinymce.fieldsimportTinyMCEFieldclassArticle(models.Model):content=TinyMCEField()在forms表单中中使用# forms.pyfromdjangoimportformsfromtinymce.formsimportTinyMCEFieldfromtinymce.widgetsimportTinyMCEWidgetclassTinyMCEForm(forms.Form):content=TinyMCEField(label="详情")orcontent=forms.CharField(widget=TinyMCEWidget(attrs={"class":'input'},tinymce_config={'menubar':False}))本项目所有的富文本编辑器相关均依赖 TinyMCEWidget 小部件，可以通过定制修改其参数tinymce_config的值（字典）来设置对应的富文本配置，具体配置项请参考tinymce官方配置文档，不支持配置js的方法及函数，仅支持 配置其值为字符串或数组及键值对对象的配置项！修改默认富文本编辑器配置在项目的settings.py中引入 TINYMCE_CONFIG 配置，该值是一个字典！TINYMCE_CONFIG={# 是否开启富文本编辑器菜单,默认关闭，这里的配置会覆盖掉默认配置'menubar':False,}