Saravanan666/pypi-org huggingface dataset:
Package: django-demian-parts
django-demian_partsdjango-demian_parts is a Django app to use for demiansoft.
(현재 analytics와 popup 구현)Quick startAdd "demian_parts" to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'demian_parts',]코드를 넣고자 하는 위치에 다음을 추가 한다.# 팝업 모듈을 넣기 위해
{% load popup_tags %}
{% show_popup %}

# analytics 모듈을 넣기 위해
{% load analytics_tags %}
{% make_analytics %}데이터 베이스를 생성한다.python manage.py makemigrations demian_parts
python manage.py migrate
python manage.py createsuperuser프로젝트의 urls.py에 summernote를 추가하고 media 경로를 추가한다.fromdjango.contribimportadminfromdjango.urlsimportpathfrom.importviewsfromdjango.confimportsettingsfromdjango.conf.urls.staticimportstaticurlpatterns=[path('admin/',admin.site.urls),path('',views.home,name='home'),]ifsettings.DEBUG:urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)settings.py에 필요한 설정을 추가한다.MEDIA_URL='/media/'MEDIA_ROOT=os.path.join(BASE_DIR,'media/')X_FRAME_OPTIONS='SAMEORIGIN'http://your_url/admin/에 접속하여 popup을 생성한다.context example (analytics 예시)context={'analytics':{'google_id':"UA-16872449-1",'naver_id':"feadf9e1b55868",'ads_id':"AW-1018052709",'ads_conversion':{'cta':"HdrUCNiXsd8DEOWAueUD",'naver':"91WCCPvk6fEBEOWAueUD",'call':"pThXCJXpsN8DEOWAueUD",},},}팝업창을 올바르게 보여주기 위해서는 bootstrap5와 bootstrap-icon이 필요하다.css 변수로 폰트와 색상이 설정되어 있어야한다.font_link에 family=Gugi 를 추가해야 한다. "family=Gugi&":root{--font-default:...;--font-primary:...;--font-secondary:...;}:root{--color-default:#364d59;--color-primary:#feb900;--color-secondary:#52565e;}
Package: django-demirbank
Library django-demirbank=======================Supports only one operation "Selling" (type `Auth`) which includes `Pre-Auth` and `Post-Auth`Supported only following settings``STORE_TYPE = '3d_Pay_Hosting'````TRANSACTION_TYPE = 'Auth'``Library settings================The following settings needs to add inside ``settings/dev.py`` or ``settings/prod.py``=======================================================  ==================================================Name                                                     Value=======================================================  ==================================================DEMIR_BANK_PAY_ACTION_URL                                'url/to/demirbank/proces'DEMIR_BANK_CLIENT_ID                                     12345678 # client idDEMIR_BANK_TRANSACTION_TYPE                              'Auth' # type for Selling operationDEMIR_BANK_INSTALMENT                                    '' # empty string for this parameterDEMIR_BANK_OK_URL                                        'url/to/merchant/success/page'DEMIR_BANK_FAIL_URL                                      'url/to/merchant/error/page'DEMIR_BANK_STORE_TYPE                                    '3d_Pay_Hosting'DEMIR_BANK_LANG                                          'ru' # language of demirbank interfaceDEMIR_BANK_CURRENCY_CODE                                 417 # currency code for SOMDEMIR_BANK_STORE_KEY                                     'KEY VALUE RECEIVED FROM BANK'``DEMIR_BANK_CLIENT_MODEL_PATH``                         'some_app.models' #for example``DEMIR_BANK_CLIENT_MODEL_NAME``                         'Client' #for example``DEMIR_BANK_CLIENT_MODEL_SEARCH_FIELD``                 'phone_number' #for example``DEMIR_BANK_CLIENT_MODEL_UPDATE_BALANCE_METHOD_NAME``   'update_balance' #for example``DEMIR_BANK_DATABASE_CONNECTION_NAME``                  needed for using inside transaction.atomic(using=)=======================================================  ==================================================
Package: django-demo-site
A reusable app to help manage a demo site.DocumentationThe full documentation is athttps://django-demo-site.readthedocs.io.QuickstartInstall django-demo-site:pip install django-demo-siteAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'demo_site.apps.DemoSiteConfig',...)Add django-demo-site’s URL patterns:fromdemo_siteimporturlsasdemo_site_urlsurlpatterns=[...url(r'^',include(demo_site_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2018-10-03)First release on PyPI.
Package: django-denis
Denis helps you recovering accidentally deleted data from a django project.RationaleHumans make mistakes, sometimes they delete data accidentally from thedjango adminand you have to spend your afternoon recovering data from a db dump. Sometimes the human
is called Denis.RequirementsDjango >=1.6Installationpip installdjango-denisUsageGiven a querysetdjango-denisfinds what the django admin would delete and recover
them from a backup database.Here’s an example session:$ python manage.py shell
>>> from denis import Denis
>>> from django.contrib.auth.models import User
>>> User.objects.filter(pk=40182)
[]
>>> qs = User.objects.using('backup').filter(pk=40182)
>>> denis = Denis(qs, using='backup')
>>> denis.recover(using='default')
>>> User.objects.using('default').filter(pk=40182)
<User: cicciopasticcio>The code above assumes a configuration entry calledbackupforDATABASESinsettings.pythat should point to a database containing the data you want to recover.Be cautiousPlease always test (and test again) recovery on a copy of your database so you can double check
that everything works fine before doing it on your production db.Of course we don’t take any responsibility with this code. Use at your own risk!
Package: django-denormalized
django-denormalizedUtils for maintaining denormalized aggregates for Django models.Examplefromdjango.dbimportmodelsfromsrc.denormalizedimportDenormalizedTracker,DenormalizedForeignKeyclassGroup(models.Model):members_count=models.PositiveIntegerField(default=0)points_sum=models.PositiveIntegerField(default=0)classMember(models.Model):group=DenormalizedForeignKey(Group,models.CASCADE,trackers=[DenormalizedTracker(# name of field to store denormalized count of active members"members_count",# callback to determine whether object should be counted or notcallback=lambdaobj:obj.active,# QuerySet filter to count only suitable objectsquery=models.Q(active=True)),DenormalizedTracker(# multiple denormalized fields tracked for single foreign key"points_sum",# Sum/Min/Max is also supportedaggregate=models.Sum("points"))])active=models.BooleanField(default=True)points=models.IntegerField(default=0)
Package: django-departments-ds
django-departments_dsdjango-departments_ds is a Django app to use for demiansoft.Quick startAdd "departments" to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'departments',]코드를 넣고자 하는 위치에 다음을 추가 한다.{% load departments_tags %}
{% make_departments %}context examplecontext={"theme":"mentor_ds","departments":{"title":"Departmetns","subtitle":"Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. ","items":[{"photo":"department-1","title":"Implant","subtitle":"Qui laudantium consequatur laborum sit qui ad sapiente dila parde sonata raqer a videna mareta paulona marka","desc":["Et nobis maiores eius. Voluptatibus ut enim blanditiis atque harum sint. Laborum eos ipsum ipsa odit magni. Incidunt hic ut molestiae aut qui","Est repellat minima eveniet eius et quis magni nihil. Consequatur dolorem quaerat quos qui similique accusamus nostrum rem vero"]},]}}
Package: django-dependency
django-dependencyManage external dependencies hosted through any version control system.InstallationDownload the app add it to your Python path:hg clone https://django-dependency.googlecode.com/hg/ django-dependency
cd django-dependency
python setup.py installAdd to your INSTALLED_APPS:INSTALLED_APPS = (
    # ...
    'deps',
)SetupAdd DEPENDENCIES to your settings fileIf you’re migrating from using svn:externals, there is a script you can use to automatically generate the list of dependencies.  Just run the following command, copy/paste the output into your settings file, and make sure your INSTALLED_APPS is up to date:create_deps.py apps/external_apps libs/external_libsIf you’re not migrating from svn:externals you can set your DEPENDENCIES and INSTALLED_APPS manually like this:import os
import deps
# ...
PROJECT_PATH = os.path.abspath('%s/..' % path.dirname(__file__))
# ...
DEPDENDENCY_ROOT = os.path.join(PROJECT_PATH, 'external')
DEPENDENCIES = (
    # subversion
    deps.SVN(
        #Uncomment to pin to revision 22
        #rev=22,
        'http://code.djangoproject.com/svn/django/trunk/django',
        root=DEPDENDENCY_ROOT,
    ),
    # mercurial
    deps.HG(
        #Uncomment to pin to revision 8ed91139be12
        #rev='8ed91139be12',
        'http://bitbucket.org/jezdez/django-robots/',
        app_name='robots',

        root=DEPDENDENCY_ROOT,
    ),
    # git pinned to a SHA1 id with rev can use HEAD or other tags
    deps.GIT(
        'git://github.com/howiworkdaily/django-faq.git',
        app_name='faq',
        project_name='django-faq',
        root=DEPDENDENCY_ROOT,
        rev='85a23e71ba23d4fc5cd92d81a02c1b9073161a21',
    ),
)
# ...
INSTALLED_APPS = (
    # ...
    'robots',
)Update manage.pyTo dynamically add the dependencies to your python path, add this code to manage.py AFTER importing settings but BEFORE importing anything from Django:import deps
deps.add_all_to_path(projectname.settings, auto_update=sys.argv[1] == 'up')For example, a complete manage.py might look like this:#!/usr/bin/env python

import sys
import os.path
import deps

# remove '.' from the path (you should use the project package to reference
# anything in here)
sys.path.pop(0)
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.dirname(PROJECT_ROOT))

try:
    import projectname.settings
except ImportError:
    import sys
    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r.\ It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
    sys.exit(1)

if len(sys.argv) > 1 and sys.argv[1] == 'up':
    deps.add_all_to_path(projectname.settings, auto_update=True)
else:
    deps.add_all_to_path(projectname.settings, auto_update=False)

from django.core.management import execute_manager
if __name__ == "__main__":
    execute_manager(projectname.settings)Now you can run “./manage.py up” to grab the dependencies!Development sponsored byCaktus Consulting Group, LLC.
Package: django-deploy-asgi
IMPORTANTThis package adds a new command to manage.py for your django project, it does requires root access for deployment and also requires you to have nginx and systemctl
installed on your system. All this project is free and open source, you can see its code inside ofhttps://github.com/n4b3ts3/django-deploy, DO NOT COPY THIS CODE
FROM OTHERS SOURCES THAN PIP OR GITHUB IT MAY BE A MALWAREWARNINGSWhen you runs this commands some warnings may appears, please do not ignore those warnings cause may means potentialy dangerous leaks in your django projectINSTALATIONpip3 install django-deploy-asgiUSAGEMake deployment and run it into your default browser if there is any ;)sudo path_to_venv/bin/python3 manage.py deploy
Show helpsudo path_to_venv/bin/python3 manage.py deploy -hWHY ROOT?We need sudo permissions in order to create a service in /etc/systemd/system so you can create a consistent service that you manually later will enable for persistency
We create files only in the nexts directories using md5 hashes of the DEPLOY_NAME set by the user in settings.py:/etc/systemd/system/*_django_asgi.service|socket/etc/nginx/sites-enabled/*_django_asgi
Package: djangodeployer
djangodeployerDeploy django project with nginx, gunicorn, supervisor, postgresql on debian.Quick startCreates the basic config file.djangodeployerinitEdit the basic configuration dj_config.json.{
    "IP_ADDRESS": "0.0.0.0",        # server public ip address
    "SERVER_NAME": "django-server", # hostname of the server
    "LINUX_USER": "dj",             # server username
    "DJ_PROJ": "djangosite",        # django project name
    "PG_USER": "djadmin",           # postgresql database username
    "PG_DB": "djangodb",            # postgresql database name
    "DOMAIN_NAME": "mywebsite.com"  # domain name
}Deploy with the command:djangodeployerdeployRequirementsPython3.6+Installationpython3 -m pip install djangodeployerAcknowledgmentsMost of the functions use the code from Corey Schafer's youtube channel:https://www.youtube.com/watch?v=Sa_kQheCnds&t=2952shttps://www.youtube.com/watch?v=goToXTC96CoCoreyMSchafer -https://github.com/CoreyMSchaferThe code is wrapped in a python package to automate the deployment.LicenseMIT
Package: djangoDeployGitHook
djangoDeployGitHook is a Django app to automatically update django instance from a git
hook signal.Quick startAdd “djangoDeployGitHook” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'djangoDeployGitHook',
]Include the polls URLconf in your project urls.py like this:path('deploy/', include('djangoDeployGitHook.urls')),Visithttp://127.0.0.1:8000/deploy/test_updatetoo see ‘Hello, From DjangoDeployGitHook!’.
Package: django-deploy-kit
Django DeployFor deploy Django project on Linux server.Features:AutomaticZero downtimeMultiple versionEasy rollbackRequirements on serverNginxAnacondaNodejsPM2Quick startAdd "deploy" to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'deploy',]Configure ssh:add host config in~/.ssh/configHosthost1Hostnamexxx.xxx.xxx.xxxPort2222UserxxxxServerAliveInterval60# IdentityFile ~/.ssh/id_rsa_xxxxxcreate ssh-key filessh-keygen-trsa-C"xxxx@xxxx.com"you could leave a blank for password, when you execute ssh command it will not ask your password againAdd definition in settings of Django appGIT_URL='git@github.com:path/name.git'GIT_DEPLOY_BRANCH='stable'APP_NAME='appname'DEPLOY={"host1":{# same as ssh-config"task_prefix":"app-process",# prefix of process name"home_path":'/path/to/appname/www',# path of each versions"static_path":'/path/to/appname/statics',# path of statics for each versions"conda_path":'/path/to/anaconda3/bin',# path of anaconda bin"nginx_conf":"/etc/nginx/sites-enabled/appname",# enabled site config of Nginx"fixed_deploy_path":'/path/to/appname/fixed',# use to do migrate}}create PM2 and Nginx configure templatecreate directory name ofdeployin your base path of Django appdeploy/
└──templates└──deploy├──ecosystem.config.template└──nginx.conf.templatecontent ofecosystem.config.template...content ofnginx.conf.template
Package: django-deployment
# django-deployment
Use Fabric and Chef-Solo to manage deploymentStart by defining the information for your server. You can do this perhaps in local_settings.py or settings.py.from fabric.api import env
env.hosts = [“server_ip”]
env.user = “user”
env.password = “password”There are a bunch of templates that can be overriden to configure deployment. During the deployment process,
these files are generated and sent up to the server, so Chef can use them. We use Django inheritance, so
any changes you make will be picked up.deployment/local_settings.py.erbdeployment/logrotate.erbdeployment/nginx.conf.erbdeployment/run_celery.sh.erbdeployment/run_gunicorn.sh.erbdeployment/upstart_celery.conf.erbdeployment/upstart_gunicorn.conf.erb
Package: django_deploys
### django_deploysFabric script that deploys git repository based django applications on Linux machines with timestamp directories for releases and shared directories for virtualenvs, logs, gunicorn pids, and settings.Inspired by ruby’s capistrano.#### Usage` fab setup `and` fab deploy `and more.1. Install: pip install django_deploys
1. Configure: Create a directory for your deploy_settings.py
1. Configure: Fill template deploy_settings.py.template and rename as deploy_settings.py in your recently created directory
1. Configure: Copy your django settings.py to be used for your deployment.
1. Configure: Other configuration options include symlinking directories.
1. Run django_deploys.py setup for the initial run
1. Run django_deploys.py deploy or django_deploys.py update for subsequent runs.  deploy will create a timestamped directory in releases and move the current pointer.  update will only update the existing current pointer timestamped directory with code and migrations.
1. run django_deploys.py -l from the directory containing the
deploy_settings.py to see a full list of available options.
Package: django-deprecated-fbv
Deprecated Django function based generic views from Django 1.4 in a neat little package. Ugly little hack for deadlines and emergencies where Django 1.5 or 1.6 is necessary.UsageInstall the package from PIP:pip install django-deprecated-fbvChange imports fromdjango.views.genericintodeprecated_fbv.Consider a more sensible strategy, like fixing your code to get rid of those pesky deprecation errors (yes, I left them in place).
Package: django-deprecate-fields
Django - Deprecate FieldInstallationpip install django-deprecate-fieldsUsageAssume the simple following model:fromdjango.dbimportmodelsclassMyModel(models.Model):field1=models.CharField()field2=models.CharField()In order to removefield1, it should first be marked as deprecated:fromdjango.dbimportmodelsfromdjango_deprecate_fieldsimportdeprecate_fieldclassMyModel(models.Model):field1=deprecate_field(models.CharField())field2=models.CharField()Secondly,makemigrationsshould be called, which will change the field to be nullable. Any lingering references to it
in your code will returnNone(or optionally any value or callable passed todeprecate_fieldas thereturn_insteadargument)Lastly, after the changes above have been deployed,field1can then safely be removed in the model (plus anothermakemigrationsrun)ContributingFirst of all, thank you very much for contributing to this project. Please base
your work on themasterbranch and targetmasterin your pull request.Licensedjango-deprecate-fieldsis released under theApache 2.0 License.
Package: django-deprecation
django-deprecationDeprecate django fields and make migrations without breaking existing code.Installpipinstalldjango-deprecationUsageTL;DR# Before:classAlbum(models.Model):name=models.CharField(max_length=50)# After:classAlbum(models.Model):name=DeprecatedField('title')title=models.CharField(max_length=50)assertalbum.name==album.titleassertlist(Album.objects.filter(name='foo'))==list(Album.objects.filter(title='foo'))Long explanationLet's suppose we have the following models:fromdjango.dbimportmodelsclassMusician(models.Model):name=models.CharField(max_length=50)classAlbum(models.Model):musician=models.ForeignKey(Musician,on_delete=models.CASCADE)name=models.CharField(max_length=100)Now, for some reason, let's suppose we want to rename the fieldAlbum#musiciantoAlbum#artist.So we make the migration using theRenameFieldoperation. The problem is that any existing code that used the old field would break.We could create a property as an alias:classAlbum(models.Model):artist=models.ForeignKey(Musician,on_delete=models.CASCADE)name=models.CharField(max_length=100)@propertydefmusician(self):returnself.artist@musician.setterdefmusician(self,value):self.artist=valueBut any code usingQuerySet#filterwould break if it uses themusicianfield.This is wheredjango-deprecationcomes handy.
We set themusicianfield as aDeprecatedFieldand point it to theartistfield:fromdjango_deprecationimportDeprecatedFieldclassAlbum(models.Model):artist=models.ForeignKey(Musician,on_delete=models.CASCADE)musician=DeprecatedField('artist')name=models.CharField(max_length=100)Now, the following code snippet will work:from.modelsimportAlbum,Musicianalbum=Album.objects.first()assertalbum.musician==album.artistnew_musician=Musician.objects.create(first_name='John',last_name='Doe',instrument='Guitar',)album.musician=new_musicianassertalbum.artist==new_musiciannew_musician_album=Album.objects.filter(musician=new_musician,).first()new_artist_album=Album.objects.filter(artist=new_musician,).first()assertnew_musician_album==new_artist_albumIf you want to control how to report the error,
replace theDeprecatedField.warnfunction with a custom one:fromdjango_deprecationimportDeprecatedFielddefwarn_function(message):# do stuffimportwarningswarnings.warn(message,DeprecationWarning)DeprecatedField.warn=warn_function
Package: django-des
A reusable Django application, admin panel, and EmailBackend that allows
email configuration to be changed while the server is running. The goal
of the project is to be the absolute easiest way to get email configured
across multiple environments.QuickstartInstall Django Dynamic Email Settings:$ pip install django-desAdd it to your `INSTALLED_APPS`:INSTALLED_APPS=(...'des',...)Add the dynamic email configuration email backend to settings.pyEMAIL_BACKEND='des.backends.ConfiguredEmailBackend'Runmanage.py migrate desTo enable test email support, add Django DES’s URL patterns:fromdesimporturlsasdes_urlsurlpatterns=[...url(r'^django-des/',include(des_urls)),]SettingsDES_TEST_SUBJECT: Set to override the default test email subject
line. (Default:"Test Email")Example:DES_TEST_SUBJECT="My New Subject"DES_TEST_TEXT_TEMPLATE: Set to override the template used for
text test emails. Note that this is a template file location, not a
template string. (Default:"des/test_email.txt")Example:DES_TEST_TEXT_TEMPLATE="myapp/email/test_email.txt"DES_TEST_HTML_TEMPLATE: Set to enable HTML emails and use the
template provided as thetext/htmlcontent. (Default:None)Example:DES_TEST_HTML_TEMPLATE="myapp/email/test_email.html"FeaturesConfigure email on the fly, no need to restart the serverSend test emails from the Django Admin panelTest text and HTML email sendingSupports third party mail packages likedjango-mailerSupportPython2.73.43.53.6Django1.81.91.101.112.0Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_dev.txt
(myenv) $ pip install -r requirements_test.txt
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-12-06)First release on PyPI.
Package: django_descope
Descope Django AppDescope is a user management and authentication platform.
This plugin integrates Descope with your Django app.Quick startSign up for Descope and set admin rolesGet your project idCreate two roles in Descope, that will be mapped to Django permissionsis_staffis_superuserMap these roles to any user you would like to make a staff or superuser in your Django app.The names of these roles can be customized in the settings below.Install "django-descope" and add to your INSTALLED_APPS setting like this:poetryadddjango-descope
OR
pipinstalldjango-descopeINSTALLED_APPS = [
   ...
   'django_descope',
   ]Add Descope Middlewareafterthe AuthenticationMiddleware and SessionMiddlewareMIDDLEWARE = [
   ...
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   ...
   'django_descope.middleware.DescopeMiddleware',
   ]Include descope URLconf in your project urls.py like this:path('auth/', include('django_descope.urls')),In your site templates, insert thedescope_flowtag where you want to place your flow{% load descope %}<!-- load the descope registry -->{% if user.is_authenticated %}<h1>Welcome {{ user.email }} you are logged in!</h1><p><ahref="{% url 'logout' %}">Log Out</a></p>{% else %} {% descope_flow "sign-up-or-in" "/" %}<!-- provide the descope flow id, and where to redirect after a successful login-->{% endif %}Start the development server and visit the newly created viewTestingSeetest_admin.pyfor a rudimentary example of
how to utilizeDescope Test Userswhen testing your application with authenticated users.
You can use the helperdjango_descope.authentication.add_tokens_to_requestto add the tokens to the django session[!IMPORTANT]
Remember you must create the relevant roles inDescope Consoleso you can utilize them in your testing.SettingsThe following settings are available to configure in your projectsettings.pyRequiredDESCOPE_PROJECT_IDOptionalDESCOPE_MANAGEMENT_KEY
DESCOPE_IS_STAFF_ROLE
DESCOPE_IS_SUPERUSER_ROLE