Saravanan666/pypi-org huggingface dataset:
Package: django-phonenumbers
Installationrun  pip install django_phonenumbersConfigure settings.pyAdd django_phonenumbers to INSTALLED_APPSmanage.pyrun manage.py collectstaticsettings.pyPHONE_NUMBER_REGION='GE'PHONE_NUMBERS_FORMATS_BY_REGION={'GE':{'pattern':'(\\d{3})(\\d{2})(\\d{2})(\\d{2})','format':'\\1\\2-\\3-\\4','prefix_format':'+%s(%s)'},'US':{'pattern':'(\\d{3})(\\d{3})(\\d{4})','format':'\\1\\2-\\3','prefix_format':'+%s(%s)'},}“PHONE_NUMBER_REGION” determines which country region will be selected in admin’s corresponding phone number field“PHONE_NUMBERS_FORMATS_BY_REGION” is used in “phone_number_format” filterModel#models.pyclassMyModel(models.Model):...phone_number=PhoneNumberField()...def__str__(self):returnstr(self.phone_number)“phone_number”field’s type will be“PhoneNumber”classPhoneNumber:def__init__(self,country_code=None,region_code=None,phone_number=None):"""
        :type country_code: str
        :type region_code: str
        :type phone_number: str
        """self.country_code=country_codeself.google_phone_number=Noneself.region_code=region_codeself.phone_number=phone_number“__str__” and “__repr__” functions are overridden to return “country_code”+” “+”phone_number”model.fields.PhoneNumberFieldis usingform.fields.PhoneNumberFieldin admin by defaultmodel.fields.PhoneNumberFieldandform.fields.PhoneNumberFieldis validating and formatting(in national format) entered numberTemplate example<li>{{ number.phone_number }}
            // {{ number.phone_number.region_code }}
            // {{ number.phone_number.country_code }}
            // {{ number.phone_number.phone_number }}<div>{% load phone_numbers_extra %}<h4>Filter<small>{{ number.phone_number|phone_number_format }}</small></h4><h4>Simple tag<small>{% phone_number number.phone_number pattern='(\\d{3})(\\d{3})(\\d{3})' number_format='\\1 \\2-\\3' prefix_format='+%s (%s)' %}</small></h4></div></li>phone_number_formatusesPHONE_NUMBERS_FORMATS_BY_REGIONfrom settings.py to determine phone number formatExample'GE': {  'pattern': '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', 'format': '\\1 \\2-\\3-\\4', 'prefix_format': '+%s (%s)'},‘GE’ : region code‘pattern’'(\\d{3})(\\d{2})(\\d{2})(\\d{2})'is regex. this regex will split phone number in 4 groups:3 digits2 digits2 digits2 digits‘format’ :'\\1\\2-\\3-\\4'numbers are groups mentioned above. for example if you want to put last 2 digits in scopes you should write ‘\1 \2-\3-(\4)’ and result will be xxx xx-xx-(xx)‘prefix_format’ : ‘+%s (%s)’ first “%s” is country code second mobile operator or city code for example +995 (595) where 995 is my country code and 595 my mobile operator’s code you can change formatting fore example ‘[%s] [%s]’ will give [995] [595] this resultwith this simple tag you can specify format inline{%phone_numbernumber.phone_numberpattern='(\\d{3})(\\d{3})(\\d{3})'number_format='\\1\\2-\\3'prefix_format='+%s(%s)'%}
Package: django-phonotactics
=====Phonotactic Probability Calculator for Serbian Language=====Phonotactic Probability Calculator is a Django app for calculating phonotactic probabilities in Serbian language.Quick start-----------PREREQUISITES:- Django 1.10- Django “form tools” app-----------0. Install prerequisites and the phonotactics app with pip::pip install django django-formtools django-phonotactics1. Add prerequisites and "phonotactics" app to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'formtools','phonotactics',]2. Include the phonotactics URLconf in your project urls.py like this::url(r'^', include('phonotactics.urls')),3. Run `python manage.py migrate` to create the phonotactics models.4. Run `python manage.py loaddata words.json` to load the basic corpus.
Package: django-photofolio-ds
django-photofolio_dsdjango-photofolio_ds 는 photofolio-pro v4.8.0을 장고에 맞게 포팅한 장고앱이다.프로젝트에 설치하기settings.py에 다음 설정을 추가한다.importos...INSTALLED_APPS=[...'demian_parts','photofolio',]...# static 파일을 _static 폴더에 저장하도록 설정STATICFILES_DIRS=[os.path.join(BASE_DIR,'_static/'),]...# 팝업창 모듈에서 이미지를 업로드 하기 위해MEDIA_URL='/media/'MEDIA_ROOT=os.path.join(BASE_DIR,'media/')X_FRAME_OPTIONS='SAMEORIGIN'프로젝트의 urls.py에 다음을 추가한다.fromdjango.urlsimportpath,includefromdjango.confimportsettingsfromdjango.conf.urls.staticimportstatic...urlpatterns=[...path('',include('photofolio.urls')),]# 팝업창 모듈에서 이미지를 업로드 하기 위해ifsettings.DEBUG:urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)데이터 베이스를 생성한다.python manage.py makemigrations photofolio demian_parts
python manage.py migrate
python manage.py createsuperuser프로젝트의 구조를 생성한다._data 폴더를 생성하고 contents.py내에 데이터를 형식에 맞게 입력한다.
_static 폴더를 생성하고 각종 이미지 등을 형식에 맞게 저장한다.
필요하면 admin으로 접속하여 팝업창을 생성한다.참고 : SCSS 설치하기 - 프로젝트에 SCSS를 설치해야 앱이 작동한다.https://www.accordbox.com/blog/how-use-scss-sass-your-django-project-python-way/django_compressor, django-libsass를 설치한다. (photofolio 앱을 설치하면 자동 설치)pip install django_compressor django-libsasssettings.py에 다음 세팅을 추가하여 compressor가 캐시할 수 있도록한다.importosINSTALLED_APPS=[...'compressor',]COMPRESS_PRECOMPILERS=(('text/x-scss','django_libsass.SassCompiler'),)STATICFILES_FINDERS=['django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder','compressor.finders.CompressorFinder',]# compressor 앱을 실행하기 위해서는 STATIC_ROOT가 설정되어 있어야 한다.STATIC_ROOT=os.path.join(BASE_DIR,'staticfiles')
Package: django-photogallery
Photogallery is Django app to allow users to look through pictures
and posts created by admin.Quick startInstall photogallery:pip install django-photogalleryAdd “photogallery” to INSTALLED_APPS:INSTALLED_APPS = [
    ...
    'photogallery',
]Add photogallery URLconf to urls.py:path('photogallery/', include('photogallery.urls')),Runpython manage.py migrateto create models.Start the server and add post onhttp://127.0.0.1:8000/admin/after enabling Admin app.Visithttp://127.0.0.1:8000/photogallery/to look through all added picture posts.
Package: django-photologue-addons
Author:Colin PowellDate:2011-04-26by:One Cardinal Web Developmentlicense:BSDThis project exists mostly to provide a way to have useful tools for photologue without cluttering the core repo, and also to allow these utilities to be used with any recent version of django-photologue.TagsCurrently the only thing in the project are two new tags:get_public_photosget_galleryThey allow you to embed photologue photos and galleries into whatever other pages on your site you’d like them to appear on, such as a flatpage.Checkout the templatetags/photologue_extra_tags.py file for more information.
Package: django-photologue-praekelt
PhotologuePowerful image management for the Django web framework.Installation============Offical releases are available from: http://code.google.com/p/django-photologue/Source Distribution-------------------Download the .zip distribution file and unpack it. From within the extracted directory run the following command:python setup.py installTracking the Development Version--------------------------------The current development version of Photologue can be checked out via Subversion from the project site using the following command:svn checkout http://django-photologue.googlecode.com/svn/trunk/ photologue-trunkThen either copy the photologue-trunk/photologue directory or create a symlink to the photologue-trunk/photologue directory somewhere on your python path, such as your Django project or site-packages directory.You can verify Photologue is available to your project by running the following commands from within your project directory:manage.py shell>>> import photologue>>> photologue.VERSION(2, 0, 'rc1')Configure Your Django Settings------------------------------Add 'photologue' to your INSTALLED_APPS setting:INSTALLED_APPS = (# ...other installed applications,'photologue',)*** Confirm that your MEDIA_ROOT and MEDIA_URL settings are correct. ***Register Photologue with the Django Admin-----------------------------------------Add the following to your projects urls.py file:from django.contrib import adminadmin.autodiscover()Sync Your Database------------------Run the Django 'syncdb' command to create the appropriate tables. After the database in initialized, run the following command to initialize Photologue:python manage.py plinitInstant Photo Gallery---------------------To use the included photo gallery templates and views you need to first add photologue to your projects urls.py file.# urls.py:urlpatterns += patterns('',(r'^admin/(.*)', admin.site.root),(r'^photologue/', include('photologue.urls')),)Once your urls are configured you need to copy the directory photologue/templates/photologue to your projects "templates" directory:myproject/myapp/...templates/photologue/...If you'd rather, you can also add the absolute path to the photologue/templates directory to your TEMPLATE_DIRS setting.# settings.py:TEMPLATE_DIRS = ('/path/to/photologue/templates',)Additional Documentation and Support------------------------------------Offical docs:http://code.google.com/p/django-photologue/w/listIf you have any questions or need help with any aspect of Photologue please feel free to join the discussion group:http://groups.google.com/group/django-photologue
Package: django-photos
InstallationInstalldjango-photosviapipfrom the repository:pip install -e hg+http://bitbucket.org/feuervogel/django-photos#egg=django-photosor frompypi:pip install django-photosIt comes withdjango,pil,easy_thumbnailsanddjango-taggit.Add all apps to your INSTALLED_APPS in yoursettings.py:INSTALLED_APPS = (
        # ...,
        'photos',
        'taggit',
        'easy_thumbnails',
        # ...,
)Runpython manage.py syncdbto sync the database:python manage.py syncdbTake care that MEDIA_ROOT and MEDIA_URL are set and the files are served.Finally addphotos.urlsto yoururls.py:urlpatterns = patterns('',
        # ...,
        (r'^photos/', 'photos.urls'),
        # ...,
)For more information read the (not yet available) docs.NewsVersioning is in themajor-minor-micro-style. Only minor updates are mentioned here, because micro-Versions include bugfixes only.0.2Release date: 30-Sep-2010Security enhancements (security by obscurity)Bugfixes (deleting model instance deletes all thumbnail variants from disk)Photo.namewill be calculated from filename if not given.Admin has a thumbnail now0.1Release date: 28-Sep-2010Basic functionality
Package: django-phrase
django-phrasedjango-phraseis the official library for integratingPhrase Strings In-Context EditorwithDjango:scroll: DocumentationPrerequisitesTo use django-phrase with your application you have to:Sign up for a Phrase account:https://app.phrase.com/signupUse theDjangoframework for PythonDemoYou can find a demo project in thedemofolder, just run follow theREADME.mdin that folderInstallationNOTE: You can not use the old version of the ICE with integration versions of >2.0.0, you have to instead use 1.x.x versions as beforevia pippipinstalldjango-phraseConfigureAdd phrase to the list of installed apps::INSTALLED_APPS = (
        'phrase',
    )Add the following template snippets to your layout filetemplates/base_generic.htmlor equivalent{% load phrase_i18n %}
    {% phrase_javascript %}Then use{% load phrase_i18n %}in your templates, e.g.demo/ice_demo/templates/index.htmlAnd the following config to yoursettings.py# Phrase In-Context Editor settingsPHRASE_ENABLED=TruePHRASE_ACCOUNT_ID="YOUR_ACCOUNT_ID"# Set your own account idPHRASE_PROJECT_ID="YOUR_PROJECT_ID"# Set your own project idPHRASE_DATACENTER="eu"# Choose your datacenter 'eu' | 'us'PHRASE_PREFIX="{{__"PHRASE_SUFFIX="__}}"You can find the Project-ID in the Project overview in the PhraseApp Translation Center.
You can find the Account-ID in the Organization page in the PhraseApp Translation Center.If this does not work for you, you can also integrate theJavaScript snippet manually.Old version of the ICE is not available since version 2.0.0. If you still would rather use the old version, please go back to 1.x.x versions.Using the US Datacenter with ICEIn addition to the settings in yoursettings.py, set the US datacenter to enable the ICE to work with the US endpoints.# Phrase In-Context Editor settingsPHRASE_ENABLED=TruePHRASE_ACCOUNT_ID="YOUR_ACCOUNT_ID"# Set your own account idPHRASE_PROJECT_ID="YOUR_PROJECT_ID"# Set your own project idPHRASE_DATACENTER="us"# Choose your datacenter 'eu' | 'us'PHRASE_PREFIX="{{__"PHRASE_SUFFIX="__}}"How does it workWhenPHRASE_ENABLED = Truethis package modifies the returning values from translation functions to present a format which the ICE can read.TestRun unit tests:pythonmanage.pytest:white_check_mark: Commits & Pull RequestsWe welcome anyone who wants to contribute to our codebase, so if you notice something, feel free to open a Pull Request! However, we ask that you please use theConventional Commitsspecification for your commit messages and titles when opening a Pull Request.Example:chore: Update README:question: Issues, Questions, SupportPlease useGitHub issuesto share your problem, and we will do our best to answer any questions or to support you in finding a solution.:memo: ChangelogDetailed changes for each release are documented in thechangelog.
Package: djangophysics
djangophysicsDjango APIs for PhysicsCountriesList of countries according to ISO-3166 and details of a country based on PyCountry module.CurrenciesList of currencies based on ISO-4217Currencies conversion ratesList of conversion rates fetched from BCE APIs.
The module provides a command line for fetching rates from different services. Custom services can be added.
Custom conversion rates can be created by registered users.Systems and UnitsList of unit systems, dimensions, and units based on the excellent Pint library.
Custom units can be created by registered users.ConversionsConversions between currencies, with batch conversion support.
Conversions between units in a unit system with batch conversion supportEvaluationCheck the syntax and dimension of a formula with units, and evaluate its valueInstallpip install djangophysicsDockerdocker is available at fmeurou/djangophysicsUsageRoutesThis package provides a OpenAPI documentation. See urls.example.py for a setup example.AuthenticationThe app provides most services without authentication.
Authentication is required to store custom conversion rates and custom conversion units.
By default, the app is configured to allow authentication through an API token that can be generated for a user on the
Django admin site.API authentication can be achieved with an Authorization header with value Token 
curl -H "Authorization: Token ".Language supportThe app supports translations for countries and units in 15 languages. More languages should be available soon.Fetch ratesThe app uses python-forex as a mecanism to fetch currency rates.
A django command is available to fetch rates from command line :
$ ./manage.py fetch_ratesAboutProject goalsGeophysics aims at bringing physical quantities to Web Services.Project websiteA live version of this service is available athttps://api.geophysics.io.MentionsThis module relies on the great work from the following projects:DjangoDjango Rest FrameworkPintSympyLeadershipThis project is maintained by Frédéric Meuroufm@peabytes.me.
Package: django-picker
Picker - Django Assets ManagerChoose your javascript, css framework into your project.InstallationPython packagepip install django-pickerAdd 'picker' to INSTALLED_APPS:'picker',SettingDefine PICKER_INSTALLED_APPS in settings.pyPICKER_INSTALLED_APPS = (
     'jquery',
 )Use in templatesDefine following tag in templates{% load pickertags %}Define following tag inside body in templates{% load pickertags %}
 <html>
     <head>
         {% load_css %}
     </head>
     <body>
         {% load_js %}
     </body>
 </html>Usable listjquery3.6.0bootstrap5.1.1bootstrap33.2.2bootstrap44.3.1bootstrap55.1.1popper1.15.1bootstrap-theme3.2.2bootstrap-cosmo3.2.2bootstrap4-darkly4.3.1less2.3.1ember1.5.1angularjs1.3.11vuejs2.6.10vuejs-dev2.6.10vue-router3.0.7fontawesome5.9.0
Package: django-pickled-model
Django pickled model provides you a model with dynamic data types.
a field can store any value in any type.You can store Integer, Boolean, String and any other data type just using a single field.
so there is no need to define extra fields and make your model dirty.Quick startInstall django pickled model:pip install django-pickled-modelAdd “pickles” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'pickles',
]Include the pickles URLconf in your project urls.py like this:path('pickles/', include('pickles.api.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create dynamic-type data (you’ll need the Admin app enabled).You can get a list of your pickles by calling the API URL.How it worksAdmin panel is where you can create your objects.
currently supported data types are:STRINGINTEGERFLOATLISTDICTIONARYBOOLEANNow let’s describe each field in admin creation form.namethe key name for your value. considering the schema {name: value}, the name you enter will be replaced.valuevalue is the field that you can enter any data based on thevalue data typethat you choose.forSTRthe value will be like: “my string value”forINTEGERthe value will be like: 1forFLOATthe value will be like: 1.5forLISTthe value will be like: [1,2,3]forDICTIONARYthe value will be like: {“key”: “value”}forBOOLEANthe value will be like: Truevalue data typethis is the field that you must choose your value data type.
Package: django-pickling
Makes django models pickling 2-3 times faster and compact.RequirementsPython 2.7 or 3.3+, Django 1.8+Installation and setup$ pip install django-picklingThen adddjango_picklingto yourINSTALLED_APPS.CAVEATSNo Django version checks are performed.If fields list changes you will see TypeErrors instead of AttributeErrors.In both cases you should wipe your cache or change keys.
Note that you will need to deal with this anyway,
with django-pickling you’ll just get weirder errors.Another thing is that objects with deferred fields are not optimized.
Package: django-pico
1. `pip install django-pico`2. Add "djpico" to your INSTALLED_APPS setting like this:```INSTALLED_APPS = (...'djpico',)```3. Include the polls URLconf in your project urls.py like this::`url(r'^pico/', include('djpico.urls')),`See [Pico](https://github.com/fergalwalsh/pico/) for more information.
Package: django-picsum
=========
django-picsumdjango-picsum is a library which helps you in rendering placeholder or actual imagesin your Djangp Template without much of hassle.. image::https://coveralls.io/repos/github/zostera/django-fa/badge.svg?branch=master:target:https://coveralls.io/github/zostera/django-fa?branch=master.. image::https://travis-ci.org/zostera/django-fa.svg?branch=master:target:https://travis-ci.org/zostera/django-faInstallationInstall using pip:pip install django-picsumAdd to INSTALLED_APPS in yoursettings.py:'image_wrapper',Example template.. code:: Django{% load image_wrapper %}

# Loads the tag

{% pic_rand height=300 width=400 %}

# A random image with a height of 300 and width of 400

{% pic_rand width=300 %}

# A random image with a height and width of 300 (300* 300 ) image 

 {% pix_image q="hi" min_width=100 %}

# A image from Pixabay 

{% pic_rand width=500  class="avatar__img" %} 

# You can pass class and id to the image to control it in your CSS it is completely optional

 To  use images from Pixabay declare your API Key in settings.py INSTALLED_APPS

 PIXABAY_KEY =<YOUR KEY>RequirementsDjango >= 2.0 and a matching Python versionBugs and requestsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/VarthanV/django-picsum/issuesLicenseYou can use this under the MIT License. SeeLICENSE <LICENSE>_ file for details.AuthorDeveloped and maintained byVishnu Varthan Rao  <https://zostera.nl/>_.
Package: django-pieguard
django-pieguard is a simple authorization class for tastypie that uses
django-guardian to handle object permissions.This was inspired by gisthttps://gist.github.com/7wonders/6557760.RequirementsPython 2.7+Django1.7django-guardian1.2.4tastypie0.12.1Not tested in other versions yet.QuickstartInstall django-pieguard:pipinstalldjango-pieguardThen use it in a tastypie project:frompieguard.authorizationimportGuardianAuthorizationfromtastypie.resourcesimportResourcefromdjango.dbimportmodelsclassMyModel(models.Model):classMeta:permissions=(('view_mymodel','View my model'),)classMyResource(ModelResource):classMeta:authorization=GuardianAuthorization# ... your other optionsNotes on permissionsdjango-pieguard uses a specialview_modelnamepermission to control if user
can view that resource or not. As Django only createsadd,changeanddeletepermissions by default, you need to add the relevant permission on
your model Meta class.TODOTestsDocsPython 3 official supportLicenseThis work is licensed under MIT license.History0.0.1 (2014-11-29)First release on PyPI.
Package: django-pigeon
django-pigeonTest utilities for Django projectsInstallation$ pip install django-pigeonUsagedjango-pigeon comes equipped with aRenderTestCasewhich provides an assortment of methods on top of Django'sTestCasethat assist with end-to-end testing of views in Django. Writing a test that verifies a view renders correctly is as simple as:frompigeon.testimportRenderTestCaseclassFooTestCase(RenderTestCase):deftestFooView(self):self.assertResponseRenders('/foo/')You can also inspect the rendered response:deftestFooView(self):response=self.assertResponseRenders('/foo/')self.assertIn('FOO',response.content)By default,assertResponseRendersverifies that the status code of the response is 200, but you can change this by specifying thestatus_codekeyword argument:deftestBarView404(self):self.assertResponseRenders('/bar/',status_code=404)You can also make POST and PUT requests usingassertResponseRendersby providing themethodanddatakeywords arguments:deftestCreateFooView(self):payload={'text':'Hello World!'}self.assertResponseRenders('/foo/create/',status_code=201,method='POST',data=payload)If you are using HTML generated from Django forms, you can sethas_form_error=Trueas a shortcut to check forerrorlistin the resulting HTML:deftestCreateFooViewWithoutText(self):response=self.assertResponseRenders('/foo/create/',method='POST',has_form_error=True)self.assertIn('This field is required.',response.content)UseassertAPIResponseRendersfor JSON responses.json.loadsis automatically called on the response, so the object returned is ready for inspection:deftestFooAPIView(self):payload={'text':'Hello!'}response=self.assertAPIResponseRenders('/foo/',method='POST',data=payload)self.assertEquals(response['text'],'Hello!')You can useassertResponseRedirectsto test redirects:deftestFooRedirects(self):# /foo/ redirects to /bar/self.assertResponseRedirects('/foo/','/bar/')If you have a list of views that you want to verify are rendering as 200 without adding any special assertion logic, you can simply override theget200sandgetAPI200smethods, which should return a list of URLs. django-pigeon will construct test methods that check that rendering all of these URLs results in a 200:classFooTestCase(RenderTestCase):defget200s(self):return['/foo/','/bar/','/foobar/',]defgetAPI200s(self):return['/api/foo/',]Most of the features inRenderTestCaseare actually implemented in the mixin classRenderTestCaseMixin. You can combineRenderTestCaseMixinwith other TestCase classes to get additional functionality:fromdjango.testimportTransactionTestCasefrompigeon.testimportRenderTestCaseMixinclassFooTransactionTestCase(RenderTestCaseMixin,TransactionTestCase):deftestFooView(self):...django-pigeon supports Python 3.5+ and Django 2.2+.