Saravanan666/pypi-org huggingface dataset:
Package: django-gas
GASGeneric Administration Sistem, an alternative to django admin with a set
of generic views.InstalationInstalldjango-gaspackage:pip install django-gasAdd'gas'toINSTALLED_APPSAddgasurls to project'surls.py:import gas.sitesurlpatterns = [
path('control-panel/', include(gas.sites.site.urls)),
]Runpython manage.py migrateConfigurationProject settings can customize thegascontrol panel:GAS_TITLE: Name of the control panel.GAS_LOGO: Icon for the control panel.GAS_MEDIA: A django form's Media like dict with css and js files.
Overrides default css and javascript.GAS_EXTRA_MEDIA: A django form's Media like dict with css and js
files. Extends current css and javascript instead of overriding.The default values of those settings can be viewed in thegas/gas_settings.pyfile.IntegrationCreate a submodulegas.configin your django app.-\ yourapp
        \gas
            __init__.py
            config.py
        admin.py
        models.py
        ...Edit thisconfig.pyfile to register your code intogas. For examples look
atgas.gas.configandgas.gas.usersmodules.Gas comes with a basic user management. To enable this section, importgas.gas.users_configfrom anygas.configof your installed apps.To enable the urls but keep the section out of the menu, just add this to
yourgas.config:site.register_urls('users', 'gas.gas.users.urls')LicensesThe license of the code is GPLv3, but in thegas/static/vendorfolder there
is some external code with different licenses.Changelog0.8.13Fix: set html email template0.8.12Add reset password (thanks Leo!)0.8.11Add preview widget in Image Field Form (thanks Leo!)0.8.10New templatetag to check if user has role0.8.9Bugfix0.8.8Support Django 4.2Use DeleteView.form_valid instead of DeleteView.deleteAdd no-cache headers to login redirects0.8.7Update jquery0.8.6Allow overriding home url0.8.5Limit split_datetime_field time widget to minutes0.8.4Allow setting form id or class on base_form.htmlUse time input_type on split_datetime_field0.8.3Fix password change viewsShow errors on delete view0.8.2Add GASConfig.default_auto_fieldRemove default_app_configAdd admin.py file0.8.1Bugfix0.8form_actions block on delete confirmation templateCancel url for GAS views0.7.3'show_deleted_objects' boolean attribute in GASDeleteView0.7.2Add GET support to AjaxCommandMixinEnhanced json encoder, available in AjaxCommandsMixinAdd Shakarina to collaborators, thanks!0.7.1Fix login viewFix initial roles in user form0.7Enhance sidebar menuUse all css files on login templateMake user admin section optionalShow role description in user edit form0.6Close button for messagesAdd locale files to packageAdd basque translations0.5.1Fix typo0.5Update spanish translationsmultipart/form-data by defaultNew templatetag for pagination0.4Helper function to use SplitDateTimeField for datetimesUpdate spanish translation0.3Allow extending GAS media filesAllow actions in every viewEnhance support for inline formsetsAdd missing templatesAdd help_text to gas views0.2Allow overriding base_form template controlsStyle loginFix migrationAdd spanish translationAdd form.media to base_form.htmlFix license in setup.cfg0.1Initial relase.CollaboratorsShakarinaLeo Hakim
Package: django-gas-drf
GASDRFsupport fordjango-gas.Helps working with an API restricted to gas roles.InstalationInstalldjango-gas-drfpackage:pip install django-gas-drfAddgas-drfurls to project'surls.py:import gas_drf.sitesurlpatterns = [
path('control-panel-api/', include(gas_drf.sites.site.urls)),
]IntegrationCreate a submodulegas.drf_configin your django app.-\ yourapp
        \gas
            __init__.py
            drf_config.py
        admin.py
        models.py
        ...Edit thisdrf_config.pyfile to register your code intogas-drf. For
examples look atdrf_gas.gas.users_drf_configmodule.Gas DRF comes with basic user management. To enable this importgas_drf.gas.users_drf_configfrom anygas.drf_configof your installed
apps.LicensesThe license of the code is GPLv3.Changelog0.1.1Minor bugfixes0.1Initial relase.
Package: django-ga-simpletag
=====Google Analytics simple tag=====Polls is a simple Django app to conduct Web-based polls. For eachquestion, visitors can choose between a fixed number of answers.Detailed documentation is in the "docs" directory.Quick start-----------1. Add "polls" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'gasimpletag',]2. Load templatetags {% load google_analytics %}3. Load Tag set id track {% ga_js 'UA-77777777-1' %}
Package: django-gaston
GastonA django menu generator.CSS ClassesMenuAdepth-{{ depth_count }}CSS class is added to every<ul>, indicating its depth, 0-indexed.SubmenuGaston automatically adds the following CSS classes to yourMenuItemelements:classdescriptionactiveIf the current URL exactly matches theMenuItem's URLselectedIf the current URL contains theMenuItem'surlIf any submenuMenuItem'surlexatly matches the current URLMenu ItemsGaston defines aMenuItemclass. EachMenuItemaccepts the following parameters:ParameterDecsriptionlabelThe label to be displayed.urlThe URL of the menu item.css_classesAdditional CSS classes for the specific element.submenuA list ofMenuItemthat will be rendered as a nested<ul>.AvailabletempaltetagsGaston provides the following templatetags:tagdescriptionmenuRenders a given menu.get_item_css_classesReturns a string with the item's CSS classes.UsageInstallationinstalldjango-gastonAddgastonto yourINSTALLED_APPSinsettings.py:INSTALLED_APPS=[..."gaston",...]DefinitionsDefine amenus.pywith your menu layout:fromdjango.urlsimportreversefromgaston.menuimportMenuItemabout_menu=[MenuItem("Company",url=reverse("company")),MenuItem("FAQ",url=reverse("faq")),]main_menu=[MenuItem("Home",url=reverse("home")),MenuItem("About",url=reverse("about"),css_classes="with-submenu",submenu=about_menu),]Define a context processor inside an app (e.g.PROJECT_NAME/context_processors.py):from.menusimportmain_menudefmenus(request):return{"main_menu":main_menu,}Add the above context processor in your list of context processors (insettings.py):TEMPLATES=[{..."OPTIONS":{"context_processors":[..."APP_NAME.context_processors.menus",],},},]WhereAPP_NAMEis the name of the app where you defined yourmenus.py.TemplatesFinally, loadgaston_tagsinside your template and call it as follows:{% load gaston_tags %}<nav>{% menu main_menu %}</nav>Wheremain_menuis the key from your context processor dictionary.Build and PublishBuildIn the root folder run:python3setup.pysdistbdist_wheelThis will create a folder nameddistwith the code ready to be published to pypi.Publish to PYPIInstalltwinewith pipx by runningpipxinstalltwineRun the command bellow to publish the packagetwineuploaddist/*Username and Password will be asked. For username, use__token__and for password the token that
was generated in the PYPI site.
Package: django-gate2shop
How to installUsing pip:$pipinstalldjango-gate2shopEdit “settings.py”add “g2s” to your “INSTALLED_APPS”add following settings:G2S_MERCHANT_ID="123456"G2S_SECRET_KEY="YourSecretWord"G2S_MERCHANT_SITE_ID="1234567"G2S_CURRENCY='USD'Add to “urls.py” pathsurlpatterns=patterns('',url(r'^g2s/g2s_form/$','g2s_form',name='g2s-form'),url(r'^g2s/',include('g2s.urls')),)Create table in your database$pythonmanage.pysyncdb$pythonmanage.pymigrateCreate/render formCreate an instance of the form in your “views.py” and make render in your templatefromg2s.formsimportG2SFormdefg2s_form(request):# this is what user wants to buyitems_list=[{'item_name':'Test','item_amount':1.11,'item_quantity':1,},]# this data you can get from user profile or from custom user modelpayment_details={'country':'Russia','city':'Moscow','address1':'Moscow, Arbat','zip':'121099','first_name':'Ivan','last_name':'Ivanov','email':'ivanov.ivan@yandex.ru','phone1':'+79031234567','total_amount':1.11,'user_token_id':1,'productId':1,}form=G2SForm(items_list,initial=payment_details)returnrender(request,"g2s/order.html",{"form":form})In “order.html”:{{ form.render }}After payment G2S sends a signal to your server (DMN URL).
The transaction will be saved in the database, then will be send a signal.
You can use it to process your own actions (add amount to users account, etc..)fromdjango.forms.modelsimportmodel_to_dictfromg2s.signalsimportg2s_payment_was_successfulfrompprintimportpprintdeftransaction_result(sender,**kwargs):ifsender.Status=='APPROVED':pprint(model_to_dict(sender))g2s_payment_was_successful.connect(transaction_result,dispatch_uid="demo.models.transaction_result")Demo installation:$pipinstallvirtualenvwrapper$source/usr/local/bin/virtualenvwrapper.sh$mkvirtualenvdjango-gate2shop$gitclonehttps://github.com/gotlium/django-gate2shop.git$cddjango-gate2shop$pythonsetup.pydevelop$cddemo$pipinstall-rrequirements.txt$pythonmanage.pysyncdb--noinput&&pythonmanage.pymigrate--noinput$pythonmanage.pyrunserver>&/tmp/runserver.log&$xdg-openhttp://127.0.0.1:8000/g2s/Full Gateway Specification available at:http://www.g2s.com/documentation/
Package: django-gatehouse
=====Gatehouse=====This is a simple Django application that allows you to add guests and visits.Visits are visible to the people working in the gatehouse.The app also helps the catering staffQuick start-----------1. Install Django Gatehousepip install django-gatehouse2. Add "gatehouseapp" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'gatehouseapp',]3. Include the gatehouse URLconf in your project urls.py like this::url(r'', include('gatehouseapp.urls')),4. Run `python manage.py migrate` to create the gatehouse models.
Package: django-gatehouse3
=====
Gatehouse3
For Django 2.0 and Python3This is a simple Django application that allows you to add guests and visits.
Visits are visible to the people working in the gatehouse.
The app also helps the catering staffQuick startInstall Django Gatehousepip install django-gatehouse3Add "gatehouseapp" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'gatehouseapp',
]Include the gatehouse URLconf in your project urls.py like this::path(r'', include('gatehouseapp.urls')),Runpython manage.py migrateto create the gatehouse models.
Package: django-ga-tracking
django-ga-tracking is a simple Django pluggable app that provides a context
processor and template for addingGoogle Analyticstracking code to your
pages.Alternatives and differencesThere are alternatives likedjango-google-analyticsandDjango Analytics
Middleware, but this project begun as both solutions seem to introduce
unnecessary complexity and/or lack the ability to configure analytics via
Django settings module. The latter factor was particularly important for this
project because hard-coding configuration or storing configuration in a
databaes column was something we absolutely wanted to avoid.InstallationInstall using pip:pip install django-ga-trackingBasic usageAddga_trackingtoINSTALLED_APPS.Next, add thega_tracking_idcontext processor toTEMPLATE_CONTEXT_PROCESSORS:TEMPLATE_CONTEXT_PROCESSORS = (
    ....
    'ga_tracking.context_processors.ga_tracking_id',
)Define aGA_TRACKING_IDsetting and assign your tracking ID to it.  For
example:GA_TRACKING_ID = 'UA-12345678-9'Finally, add the tracker code template somewhere in your own template:{% include "ga_tracking/ga.html" %}Tracking superusersBy default, django-ga-analytics will track superusers. You can disable this by
using theGA_TRACK_SUPERUSERsetting. Setting it toFalsewill cause
the tracking code to not be renedered for any user that hasis_superuserproperty set toTrue.New tracking codeGoogle Analytics offers an alternative tracking code (analytics.js). This
code is also available in django-ga-tracking. Since the tracking code uses both
the property ID and the top level domain, you will need to specify both. So,
add this to your settings:GA_TRACKING_ID = 'UA-12345678-9'
GA_DOMAIN = 'example.com'Next, include the alternative template:{% include "ga_tracking/ga_new.html" %}CustomizationBecause django-ga-tracking uses a simple template to add the code, you can
customize it simply by overriding the template with your own. Thega.htmltemplate contains the default<script>block as provided by Google.The script block isnotrendered at all if theGA_TRACKING_IDsetting is
not present, so you can, for example, set the setting only in production to
avoid development sites from being tracked, or use different tracking codes on
different deployments. For example:# in settings.py
import os

GA_TRACKING_ID = os.environ.get('GA_TRACKING_ID')Customizing the tracking callTracking call itself can be customized. The default tacking calls are:// For old API
_gaq.push(['_trackPageview']);

// For new API
ga('send', 'pageview');These calls are separated out into their own templates:ga_tracking/ga_track.jsandga_tracking/ga_new_track.jsrespectively.
By overriding these templates, you can customize the calls. For more
information on respective APIs, check out the Google Developers documentation
forga.jsandanalytics.js.It should be reiterated that the two partial templates are standard Django
templates, so they have full access to template context should you need to
access any of the context variables for the purpose of customization.Reporting bugsPlease report bugs to Bitbucketissue tracker.
Package: django-gazing-select-widget
django-gazing-select-widgetChoices of select widget changes while the value of another filed changes.Installpipinstalldjango-gazing-select-widgetDjangoGazingSelectWidget Init ParametersclassDjangoGazingSelectWidget(Select):def__init__(self,gazing_field_name,this_field_name,choices_related=None,gazing_related=True,optgroups_related=None,empty_label="-"*10,hide_all_if_empty=True,attrs=None,choices=(),):...gazing_field_name: Name of the gazing field.this_field_name: Name of this field.choices_related: List of tuple (option_value, related_value)It means, if the gazing_field value equals to related_value, then the option with option_value will be show.gazing_related: Default to true, means gazing field is at the same level with this field.If set to false, then the gazing field is always at the top level of the form.empty_label: Defualt to "-"*10. Empty value option for this field.hide_all_if_empty: Default to true. If true, hide all options if gazing value is empty. If false, show all options if gazing value is empty.attrs: Same with system's default Select widget.choices: Same with system's default Select widget.choices can be a callable object, if it's a callable object, it will be called again before get_context.Usage**pro/settings.pyINSTALLED_APPS=[...'django_gazing_select_widget',...]app/admin.pyfromdjango.contribimportadminfromdjangoimportformsfromdjango_gazing_select_widget.widgetsimportDjangoGazingSelectWidgetfrom.modelsimportCategorycat1_choices=[("","-"*10),(1,"1"),(2,"2"),]cat2_choices=[("group1",[(1,"a1"),(2,"b1"),(3,"c1"),(4,"d1"),]),("group2",[(5,"a2"),(6,"b2"),(7,"c2"),(8,"d2"),]),]cat2_choices_related={1:["1"],2:["1"],3:["1"],4:["1"],5:["2"],6:["2"],7:["2"],8:["2"],}classCategoryForm(forms.ModelForm):classMeta:model=Categoryexclude=[]widgets={"cat1":forms.Select(choices=cat1_choices),"cat2":DjangoGazingSelectWidget(gazing_field="cat1",choices=cat2_choices,choices_related=cat2_choices_related,hide_all_if_empty=False),}classCategoryAdmin(admin.ModelAdmin):list_display=["cat1","cat2","name"]form=CategoryFormadmin.site.register(Category,CategoryAdmin)Note:field cat2 is gazing at field cat1.if the field cat1's value is empty, show none options in field cat2.if the field cat1's value is 1, show group1 options in field cat2.if the field cat1's value is 2, show group2 options in field cat2.PreviewReleasesv0.1.2Fix callable problem.v0.1.1Add callable choices support.Add gazing_related support.v0.1.0First release.
Package: django-gbasedbtdb
A database driver for Django to connect to an GBase 8s database via pyodbc.Some limitations:Does not support default valuesGBase 8s automatically creates indexes on foreign keys, but Django attempts to do that
manually; the current implementation here just attempts to catch the error on index
creation. It may unintentionally catch other index creation errors where the index
already exists.Release HistoryVersion 1.10.1Fork from django_informixdbFix 'unsupported column type -114'
Package: django-gcframe
Django utilities for working with Google Chrome Frame.This package provides configurable middleware and decorators for adding and
removing theX-UA-CompatibleHTTP header in view responses. Said header
conditionally activates Google Chrome Frame when installed on Microsoft
Internet Explorer, and conditionally enables a compatibility mode when GCF is
not activated.This package requires Python 2.6 or newer and Django 1.3 or later.Refer to thedocumentationfor further information.
Package: django-gcloud-connectors
Django GCloud Connectors (gcloudc)Note: This project is now living inGitLabThe aim of this project is to create Django database connector / backend for Google Cloud.It currently provides support for Cloud Firestore in Datastore mode.
Note: theOPTIMISTIC_WITH_ENTITY_GROUPSlegacy concurrency mode is not supported.DocumentationIf you are interested in submitting a patch, please refer to theContributingpage.Looking for Commercial Support?Potato offers Commercial Support for all its Open Source projects and we can tailor a support package to your needs.If you're interested in commercial support, training, or consultancy then go ahead and contact us atopensource@potatolondon.com
Package: django-gcm
Google Cloud Messaging Server in DjangoQuickstartInstall the package viapip:pip install django-gcm  --process-dependency-linksAddgcmtoINSTALLED_APPSinsettings.pyAddGCM_APIKEYtosettings.pyfile:GCM_APIKEY="<api_key>"Addgcm urlstourls.pyfile:urlpatterns=[...url(r'',include('gcm.urls')),...]Documentation:https://django-gcm.readthedocs.orgClientSimple client application you can findhere.
Package: django-gcm-android-ios
django-gcm-android-ios is a simple Django app to send a message using GCM HTTP connection server protocol.Detailed documentation is in the “docs” directory.Quick startInstall django-gcm-android-ios:pip install django-gcm-android-iosAdd “gcm” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'gcm',
)Add in setting api keys like this:GCM_DEVICE_MODEL = "DeviceModel" # default gcm.Device
GCM_IOS_APIKEY = "IOS_APIKEY"
GCM_ANDROID_APIKEY = "ANDROID_APIKEY"Include the gcm routers in your project urls.py like this:from gcm.routers import router
url(r'api/', include(router.urls))Runpython manage.py migrateto create the device modelsTo register device:curl -X POST -H "Content-Type: application/json" -H "Authorization: "
 -d '{
    "dev_id": "Device id",
    "dev_type": "ANDROID or IOS",
    "reg_id": "Register id"
   }' 'http://localhost:8001/api/devices'To unregister device:curl -X DELETE -H "Content-Type: application/json" -H "Authorization: "
'http://localhost:8001/api/devices/id_device'
Package: django-gcp
DjangoGCPHelps you to run Django on Google Cloud Platform:Storage (including direct uploads)Events (PubSub)Tasks (ad-hoc and scheduled)Logging (pretty colours and labels) andError Reporting.Read thedocumentation here.This app is maintained by Octue - we're on a mission to help climate scientists and energy engineers be more efficient.Find out more. If you need some help implementingdjango-gcp, or wish to sponsor a feature or any of the issues on the board, we can help! Raise an issue orcontact us.Are you from GCP??If so, get in touch for a chat. We're doing fun things with Google Cloud. Way funner than boring old django... :)All the :heart:This app is based heavily ondjango-storages,django-google-cloud-tasksand uses thedjango-rabid-armadillotemplate. Big love.ContributingIt's pretty straightforward to get going, but it's good to get in touch first, especially if you're planning a big feature.Set upOpen the project in codespaces, a vscode .devcontainer (which is configured out of the box for you) or your favourite IDE or editor (if the latter you'll need to set updocker composeyourself).Create a file.devcontainer/docker-compose.developer.yml. This allows you to customise extra services and volumes you make available to the container.
For example, you can map your own gcloud config folder into the container to use your own credentials. This example will get you going, but you can just leave the services key empty.version: "3.8"

services:
  web:
    volumes:
      - ..:/workspace:cached
      - $HOME/.config/gcloud:/gcp/config

    environment:
      - CLOUDSDK_CONFIG=/gcp/config
      - GOOGLE_APPLICATION_CREDENTIALS=/gcp/config/your-credentials-file.jsonInitialise gcloud CLITo sign in (enabling use of the gcloud CLI tool), do:gcloud config set project octue-django-gcp
gcloud auth loginRun the testsRun the tests:pytest .We use pre-commit to ensure code quality standards (and to help us automate releases using conventional-commits). If you can get on board with this that's really helpful - if not, don't fret, we can help.Use the example appYou can start the example app (which is useful for seeing howdjango-gcplooks in the admin.Initially, do:python manage.py migrate
python manage.py createsuperuser
# make yourself a user account at the promptThen to run the app, do:python manage.py runserver...and visithttp://localhost:8000/admin/to sign in.Update the docsWe're pretty good on keeping the docs helpful, friendly and up to date. Any contributions should be
fully documented.To help develop the docs quickly, we set up a watcher that rebuilds the docs on save. Start it with:python docs/watch.pyOnce docs are building, the the vscode live server extension (or whatever the equivalent is in your IDE)
to live-reloaddocs/html/index.htmlin your browser, then get started!
Package: django-gcs
Based onGoogle Cloud Storage JSON API.Written usingGoogle Cloud Python Clientlibrary.Quick start$ pip install django-gcsUpdatesettings.pyDJANGO_GCS={'bucket':'bucket-name','http':get_http_credentials}SettingsDJANGO_GCS={'bucket':None,'project':'','credentials':None,'http':None,'cache_control':['no-cache']}bucketname of the bucket on google cloud storage.projectgoogle project name (not required).credentialsoauth2 credentialshttphttplib2.Http instance or callable that returns httplib2.Http instancecache_controlis a list of strings. By default [‘no-cache’]Note: One ofcredentialsorhttpshould be provided for authentication.UsageSet storage globally:DEFAULT_FILE_STORAGE='django_gcs.GoogleCloudStorage'Or per model:fromdjango_gcsimportGoogleCloudStorageclassFileModel(models.Model):file=models.ImageField(storage=GoogleCloudStorage(bucket='some-bucket'))Example how to generate HTTP object to make request.importpickleimporthttplib2defget_http_credentials():withopen('google/oauth2/credentials/file','r')asf:credentials=pickle.load(f)http_credentials=credentials.authorize(httplib2.Http())returnhttp_credentials
Package: django-gddkia-impediments-on-roads
InstallationInstall package viapippip install django-gddkia-impediments-on-roadsConfigurationConfigure cache options# Cache backend name
IMPEDIMENTS_CACHE_BACKEND_NAME = 'default'

# Cache key
IMPEDIMENTS_CACHE_KEY = 'impediments'

# Max time of cache
IMPEDIMENTS_CACHE_TIMEOUT = 3600API Usagefrom dj_impediments import get_impediments

print get_impediments()
Package: django-gdm
GDMis a set of simple Django models for genealogy based data
structures (family trees).Quick startAdd “gdm” to your INSTALLED_APPS setting like this:INSTALLED_APPS=(...'gdm',)Runpython manage.py migrateto create the GDM models.Include the GDM models in your project like this:fromgdm.models.treeimportPerson,FamilyStart the development server and visithttp://127.0.0.1:8000/admin/to create persons and families (you’ll need the Admin app enabled).