Saravanan666/pypi-org huggingface dataset:
Package: django-describer
django_describerAn easy-to-use tool to auto-generate GraphQL API from Django models. More APIs TBD.Get startedInstalldjango_describervia PyPI, e. g.pip install django_describer.Addgraphene_djangoto yourINSTALLED_APPSin Django settings. Otherwise, the template for GraphQL would be invisible.UsageWrite your Django models:fromdjango.dbimportmodelsclassPublisher(models.Model):name=models.CharField(max_length=50)@propertydefshort_books(self):returnself.books.all().filter(page_count__lt=300)def__str__(self):returnself.nameclassBook(models.Model):name=models.CharField(max_length=50)page_count=models.IntegerField()publisher=models.ForeignKey(Publisher,on_delete=models.CASCADE,blank=True,null=True,related_name="books")def__str__(self):return"{}({})".format(self.name,self.publisher)Now write a Describer for it. You can specify:which fields (and model properties) are exposed to the API and who can access themwhich CRUD operations are allowed for each model and who can perform themextra actions on each modelPer-request field specification, ordering, filtering and pagination are for granted.fromdjango_describer.actionsimportDetailActionfromdjango_describer.datatypesimportQuerySetfromdjango_describer.describersimportDescriberfromdjango_describer.permissionsimportIsAuthenticatedfromuser.modelsimportUserclassUserDescriber(Describer):model=Userextra_actions={"myself":DetailAction(permissions=IsAuthenticated,fetch_fn=lambdarequest,pk:request.user,id_arg=False)}Import all describers into yoururls.pyand create a URL for the api:fromdjango.contribimportadminfromdjango.urlsimportpathfromdjango_describer.adapters.baseimportgeneratefromdjango_describer.adapters.graphql.mainimportGraphQLfromcourse.describersimport*fromuser.describersimport*urlpatterns=[path('admin/',admin.site.urls),path("graphql/",generate(GraphQL)),]Now you can do things such as:query q{
  UserMyself{
    id
    username
  }
}

mutation m{
  UserCreate(data: {username: "John", password: "asdf"}){
    object{
      id
    }
  }
}
Package: django-designer
Allow designers to work on your templates without having to run
the Django development server, database etc.Designer’s workflow:Pulls repoEdits template, makes it look prettyRuns manage.py command to render template and produce html filePoints browser to fileViews pretty rendered template in browserRepeats steps 2 and 3, refreshes browserCommits and pushes pretty templatesNote: To state the obvious, context variables are not rendered on page.
View functions are not called.  Context variables are often not needed
when a desinger is viewing templates for design purposes.InstallInstall package:pip install django-designerUsageRun:$ ./manage.py render_template your_app/templates/home.html
file:///Users/you/Projects/your_project/your_app/templates/home_rendered.htmlCopy-paste output into browser address bar and view rendered template.Recommend you add*_rendered.htmlto your .gitignore.
Package: django-detailed-request-logging
django-detailed-request-loggingReleasesThis project follows thesemantic versioning specificationfor its releases.DevelopmentRequirementsPython >=3.7Django >=3.2django-rest-framework >=3.12SetupCreate and activate a python3 venv.Install the library in the editable modepip install -e .[test,stubs]Install dev requirementspip install -r requirements-dev.txt.Install git hooks to automatically format code using black withpre-commit installInstallationFrom git inrequirements.txtTo install this package from this git repository, add thedjango-detailed-request-loggingpackage to therequirements.txtfile.To use it, add the following entry toMIDDLEWAREinside of yoursettings.pyfile:MIDDLEWARE=[...,"django_detailed_request_logging.middleware.LoggingMiddleware",]Then, add a new entryLOGGING_REQUEST_MIDDLEWAREto yoursettings.pyfile, changing the value ofappsto the
names of the apps you want to log requests on and changing the value ofskip_methodsto include all HTTP methods
you doNOTwant to get logged:LOGGING_REQUEST_MIDDLEWARE={"apps":("projects",),"skip_methods":("OPTIONS",),}
Package: django-detect
Installationpip install django-detectUsage# ####### Device、OS #######
# Windows
request.Windows
# Linux
request.Linux
# iMac/iPhone/iPad/iPod
request.iMac
request.iPhone
request.iPad
request.iPod
# PC
request.PC = request.Windows or request.Linux or request.iMac
# iOS
request.iOS = request.iPhone or request.iPad or request.iMac or request.iPod
# Android and Version
request.Android
request.Android.version

# ####### APP #######
# Weixin／Wechat and Version
request.weixin
request.weixin.version
request.wechat
request.wechat.versionSettings.py# Use `MIDDLEWARE_CLASSES` prior to Django 1.10
MIDDLEWARE = (
    ...
    'detect.middleware.UserAgentDetectionMiddleware',
    ...
)
Package: django-detective
Django app that tracks all user requests and saves following data to database:userrequest methodresponse status codeIP addressURL pathGET parametersPOST datasessionlanguage codetimezonecontent typeuser agentresponse content (if internal server error occures)is_secure flagis_ajax flagis_debug flagcreated and modified timestampsTested on Django 1.4.5 and Django 1.8.3RequirementsDjangoInstallationInstall python library using pip:pip installdjango-detectiveAdddetectivetoINSTALLED_APPSin your Django settings fileAdddetective.middleware.TrackingMiddlewaretoMIDDLEWARE_CLASSESin your Django settings fileIncludedetective.urlsin your urls.py withdetectivenamespaceSync your databaseSettingsDETECTIVE_SAVE_RESPONSESIf True, response data will be saved in database. Default:False.DETECTIVE_SAVE_ERROR_RESPONSESIf True, internal server error responses with exception (500) are stored in database. Default:True.DETECTIVE_TRACK_AJAX_REQUESTSIf False, ajax requests won’t be tracked. Default:True.DETECTIVE_TRACK_ANONYMOUS_REQUESTSIf False, anonymous requests won’t be tracked. Default:True.AuthorsLibrary is byErik TelepovskyfromPragmatic Mates. Seeour other libraries.
Package: django-dev
https://github.com/idlesign/django-devDescriptionTools to facilitate application development for DjangoConsole utility for those who have more than one Django reusable application to maintain.It allows certain actions to be done in batch mode over all you apps.Supported commands:bootstrapadd_migrationsmake_translist_appslist_venvsinstall_packageRequirementsPython 2.7+, 3.2+Pythonvirtualenvpackage (or just Python 3.3+).How to startMake a new directory, where you want your workspace to be, and step into it;Run>django-devbootstrapto create basic directory structure;Symlink your apps intoappsdirectory (was created by step 2 in your current directory).Example:ln-s/home/idle/dev/django-sitetree/sitetree/home/idle/dev/dj_workspace/apps/sitetreeNotice, that symlinked is a directory containingmodels.py(notsetup.py).Making both South and Django 1.7+ migrationsUseadd_migrationscommand.Relocate old South migrations intosouth_migrationsand create new migrations inmigrations:>django-devadd_migrations--relocate_southCreate/update migrations both for South and Django 1.7:>django-devadd_migrationsCreate/update migrations for certain apps:>django-devadd_migrations--appssitecats siteflagsUpdating translation filesUsemake_transcommand.Update existing .mo and .po files for every locale available in app:>django-devmake_transUpdate/create .mo and .po files for certain locales:>django-devmake_trans ru enUpdate/create .mo and .po files for certain apps:>django-devmake_trans ru--appssitetree sitegateSatisfy your app requirementsUseinstall_packagecommand to install packages into virtual envs to satisfy app requirements.Exact version numbers could be given as in PIP:somedep==1.5.Get involved into django-devSubmit issues.If you spotted something weird in application behavior or want to propose a feature you can do that athttps://github.com/idlesign/django-dev/issuesWrite code.If you are eager to participate in application development, fork it athttps://github.com/idlesign/django-dev, write your code,
whether it should be a bugfix or a feature implementation, and make a pull request right from the forked project page.Spread the word.If you have some tips and tricks or any other words in mind that you think might be of interest for the others — publish it.
Package: django-dev-admin
Django Dev AdminThis project gives you a middleware that allow you to login to any user via django command.InstallationInstallpip install django-dev-adminAdddjango_dev_adminto yourINSTALLED_APPSINSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    ...,
    "django_dev_admin",
]Adddjango_dev_admin.middleware.DevAdminMiddlewareto yourMIDDLEWAREafterdjango.contrib.sessions.middleware.SessionMiddlewareMIDDLEWARE = [
    ...,
    "django.middleware.security.SecurityMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django_dev_admin.middleware.DevAdminMiddleware",
    ...,
]SettingsIf you are not using default development hostname and port. Please put this option in yoursettings.pyDEFAULT_DEV_SERVER = "http://localhost:8000"Use commandpython manage.py login_as

python manage.py login_as -u <username>ProductionPlease disable this module in production
Package: django-devapp
Django DevAppBasic tools to manage a django application outside of a Django project.Inspired from:"How to Write an Installable Django App"."Packaging Python Projects"Help$ dev --help
Usage: dev [OPTIONS]

Options:
  -a       Create Application
  -b       Run Black  [default: black]
  -bb      Build Application
  -m       Make Migrations
  -M       Migrate
  -n TEXT  The name of the application or DEVAPP_NAME env variable.
           [required]
  -pp      Upload to Pypi
  -s       Run Django Shell
  --help   Show this message and exit.Example$ tree
.
├── LICENSE
├── pyproject.toml
├── README.md
└── setup.cfg

$ export DEVAPP_NAME=app
$ dev -a

$ tree
.
├── db.sqlite3
├── LICENSE
├── pyproject.toml
├── app
│   ├── admin.py
│   ├── apps.py
│   ├── __init__.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── README.md
└── setup.cfg
Package: django-devartis-admin
+ pip install https://github.com/devartis/django-devartis-admin/archive/0.1.6.zip+ Add devartis-admin before contrib.adminINSTALLED_APPS = ('devartis_admin','django.contrib.admin',+ Make sure you have sites app installed and you added a SITE_ID on your settingsINSTALLED_APPS = (...'django.contrib.sites',...SITE_ID = 1
Package: django-dev-commands
Useful yet simple commands for developing Django applications.InstallationTo install, simply run:$pipinstalldjango-dev-commandsSeeproject’s websitefor more information.History1.1.0 (Wed Mar 12 12:09:23 CET 2014)Support for passing arguments to scripts when using theruncommand1.0.1 (Mon 27 Jan 2014 12:27:58 PM CET)Fix a syntax error bug incommandscommandAdded pretty printing inconfcommand1.0.0 (Tue 14 Jan 2014 11:05:32 AM CET)First version!
Package: django-developer-toolkit
Django utility app for Django developers with these features:settings constantsrequest object datadebugging email configurationinternal server error template viewraise exception viewenvironment constantsTested on Django 1.4.5 and Django 1.8.2RequirementsDjangoInstallationInstall python library using pip:pip installdjango-developer-toolkitAdddeveloper_toolkittoINSTALLED_APPSin your Django settings fileIncludedeveloper_toolkit.urlsin your urls.pyRecommendationYou may like to add toolkit features to admin. To do so, follow these steps:Addos.path.join(ABSOLUTE_PATH_TO_DEVELOPER_TOOLKIT,'templates'),toTEMPLATE_DIRSin your Django settings file, where ABSOLUTE_PATH_TO_DEVELOPER_TOOLKIT is absolute path to developer toolkit library. For example:'/home/project/environment/lib/python2.7/site-packages/developer_toolkit'(If you have a better idea how to do that, please let me know. Thanks.)SetTEMPLATE_DEBUGto TrueAuthorsLibrary is byErik TelepovskyfromPragmatic Mates. Seeour other libraries.
Package: django-developmentEmailDashboard
django-developmentEmailDashboardA django email backend that saves the emails to database instead of sending them
and can view the emails in a web-browser:warning: disclaimer: do not use this in production or on any public server.
this app hardly has any security protocols inplace since
this is meant to be used in development and values ease of use over security.
for example there is no password required to view a users inbox or to create a new one
or for anything else.Installationprerequisitesmust have static files configuredoptional to get windows notifications install zroyapip install zroyarunpip install django-developmentEmailDashboardAdd 'developmentEmailDashboard' to your INSTALLED_APPS setting.Add urls (only add the urls file that you plan on using)from django.conf import settings...if settings.DEBUG:
urlpatterns.append(path('emails/', include('developmentEmailDashboard.urls')))set the email backend in settings.pyif DEBUG:
EMAIL_BACKEND = 'developmentEmailDashboard.emailbackend.developmentEmailBackend'Run the commandmanage.py migrate.now every time you send an email it will show up on your website athttp://localhost:8000/emails/there is no validation on the emails that get created in the dashboard.
for example you can create a inboxtestor@@@and it will work this is done for convenience
if users want this functionality to be changed that can be doneconfigurationget notified when you receive an emailin settings.py setDEVELOPMENT_EMAIL_DASHBOARD_SEND_EMAIL_NOTIFICATION = Trueto get a windows notification
every time an email is receivedmust have zroya installed |pip install zroyachangelog2.0.0added windows notificationsfixed bug where text based emails don't display new lines properlyfixed bug where deleting inbox creates does not exist error2.0.1fixed bug where when zroya init fails to send email notification it raises 500 error now ignores it2.0.2when zroya init fails to load still tries to send notificationstill left to doamazing documentation100% testing coveragefix icons displaying centeredrender emails as they will be displayed in a email application not just htmloption to show raw email with headersadd email attachmentsallow browser to send html emails not just view emails with html sent by websitesmanagement command to delete database tables, clear tables, create tables againAny contribution is welcome just make a pull request, and I will try to add your feature in the next version as soon as possible.
Package: django-development-fabfile
A fabfile to ease many tasks during development and deployment of Django
projects.InstallationJust adddjango-development-fabfileto yourrequirements.txtand
install it viapip install-rrequirements.txt.Then create the following files in your project root (usually the folder where
yourmanage.pyfile resides):fabfile/
-- __init__.py
-- your_own_fab_tasks.pyIf you are on Django < 1.6, put the following code in yourfabfile/__init__.py:# flake8: noqa
from myproject import settings
from django.core.management import setup_environ
setup_environ(settings)

from development_fabfile.fabfile import *
from .your_own_fab_tasks import *If you are on Django >=1.6, put the following code in yourfabfile/__init__.py:import os

os.environ.setdefault(
    "DJANGO_SETTINGS_MODULE", "myproject.settings")

from development_fabfile.fabfile import *
from .your_own_fab_tasks import *In yoursettings.pyat the very bottom add the following:from fabfile_settings import *  # NOQAThen create afabfile_settings.pynext to yoursettings.pyand add
all necessary settings. As a starting point you can copy thefabfile_settings.py.sampleof this project and change all values to your
project.Python 3Please note, that fabric isn’t working with Python 3. Please usefabric3instead.
Package: django-dev-email
Django Development Email========================This was developed as an alternative to having small if checks to send all mail to a developmentaddress.  We initially wanted to just override the ``_send`` method, but since it's marked as private,we decided to copy the class and rewrite the parts I needed.  We are certainly open to other waysand methods of implementing this.Installation------------pip install django-dev-emailAdd the class to your ``EMAIL_BACKEND`` settingEMAIL_BACKEND = 'dev_email.backends.development.EmailBackend'Add the email address to your settings fileDEV_EMAIL = 'yourdevaddress@whatever.com'Suggestions, Bugs, Comments?  Open a Github issue.What's Next?------------
Package: django-devfixtures
Share development fixtures across your team, with git commit id tracing and autodetect.Free software: BSD licenseInstallationCurrently this package requires git, psql, pg_dump createdb, dropdb and unzip to function.pip install django-devfixturesConfigurationAdddevfixturestoINSTALLED_APPS.settings.DEVFIXTURE_DIR         # path to directory where auto generated fixtures should be stored
settings.DEVFIXTURE_BACKUP_DIR  # path to where backups are stored when running restoreHow it worksWhen youcreatea fixture (without any arguments) the management command will zip MEDIA_FILES and database dump to
a file with naming <AUTHOR_DATE>+<COMMITID>+<CREATED_DATE>+<CREATOR>.zip.The auto restore function will check from HEAD and backards in the commit tree, and when it finds a fixture file with
that commit id, it will restore that version after a backup of the current state has been created. If the restore for
some reason fails, it will attempt to restore the backuped fixture.This works with the following criterias:You will not rebase/rewrite history, as commit ids might no longer matchYou will not delete migrations manuallyIt also have the limitations to unly work with PostgreSQL. And there are some current limitations, due to the fact
that the implementation uses pg_dump etc for creating dumps. Requirements:The database name is defined insettings.DATABASES[‘default’][‘NAME’]The running user have permissions to dropdb/createdbStoring the dev_fixtures in gitDevfixtures can become large, if you have big set of media files. If you use github, you are encouraged to use git-lfs
to store the files. Read about git lfs here:https://git-lfs.github.com/Add devfixtures/* to your tracked git lfs files before you add your first fixture to git.# git lfs track 'dev_fixtures/*'UsageCreate fixture:# ./manage.py devfixture createRestore fixture:# ./manage.py devfixture restoreCreate manual fixture sharing, for example if you have a branch and you want some other developer to take a look
at a bug. Run this and send the zip file to the other developer:# ./manage.py devfixture create -f ~/Desktop/devfixture-for-peter-debugging.zipTo load a shared fixture:# ./manage.py devfixture restore -f ~/Desktop/devfixture-for-peter-debugging.zipWhen running restore, a backup is always created. You can restore it the same way as above.# ./manage.py devfixture -hDocumentationhttps://django-devfixtures.readthedocs.org/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.1.3 (2016-02-02)If pg_dump fails, CommandError is raised.Updated documentation that recommends git lfs if dev fixtures will be stored in your github repo.0.1.1 (2016-02-02)First release on PyPI.
Package: django-deviantart
# django-deviantartOauth2 Django App for Deviantart## Installationpip install django-deviantartadd deviantart to your settings.INSTALLED_APPS = [...'deviantart']Go to [the deviantart developer program](http://www.deviantart.com/developers/register) and registeran application. Don't worry unless you submit it to the gallery no one will see it.Run migrations./manage.py migrateGo back to your settings and add your `client_id`, `client_secret` and some scopes.DEVIANTART_CLIENT_ID = '1234'  # this should be just a numberDEVIANTART_CLIENT_SECRET = 'sha1 hash'  # Press show on the deviantart siteDEVIANTART_SCOPE = ['browse', 'user']  # You can find more informations about the scopes on the deviantart siteAdd the oauth2 urls to your **urls.py**from deviantart import urls as deviantart_urlsurlpatterns += [url(r'^deviantart/', include(deviantart_urls)),]Now open your browser at `deviantart/auth` [Click here if you run the default testserver](http://127.0.0.1:8000/deviantart/auth)If you've done everything right your should be redirected to the deviantart site where you need to press **authorize**## AttentionIf you change your scope you need to reauth your app be open the auth link from above again## Future plans for django-deviantart* make it easier to use* Useable django authbackend for this* reuseable templates* more examples
Package: django-devicetype-templates
django-devicetype-templates is a library that detect device type by browser’s user agent string
and serves different templates for each type.If standard responsive layouts does not fit all of your needs
and if you do not want to use some hacky template loaders with thread locals,
you may find this library useful.RequirementsDjango >= 1.7Tested with Python versions 2.7, 3.3, 3.4, 3.5It usesprocess_template_responsemiddleware method, so your views should returnsTemplateResponse.InstallationInstall from PyPi:pip install django-devicetype-templatesInstall development version to virtualenv:git clone https://github.com/whit/django-devicetype-templates.git
cd django-devicetype-templates
python setup.py developRun tests:pip intsall -r requirements-dev.txt
py.testConfigurationAdd middleware:MIDDLEWARE_CLASSES = (
    ...
    'devicetype.middleware.DeviceTypeMiddleware',
)If you need to use some variables in your templates, you can add devicetype context processor:TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'devicetype.context_processors.devicetype',
)Then, in templates will be available these variables:devicetype,is_mobile,is_tabletandbig_resolution(not implemented yet).Other settingsDEBUG_DEVICETYPE_NOCOOKIEFor development purposes if you want to switch user agents oftenly.
Cookie max age wil be set to 5 seconds.DEVICETYPE_TEMPLATE_PREFIXPrefixes are variable. When you need prefix template file name, use something liketablet-. If you want to have
device-specific templates in subfolders, you can usetablet/prefix for example.Default:{
    'desktop': '',
    'mobile': 'mobile/',
    'tablet': 'tablet/',
}DEVICETYPE_PREFIX_BASENAMEWhen you use folder-like prefix, liketablet/andmobile/, with this setting
you can select how subfolders will be detected.WithDEVICETYPE_PREFIX_BASENAME = False(default):tablet/base.html
tablet/app/app_base.html
tablet/layout/three-cols.html
...WithDEVICETYPE_PREFIX_BASENAME = True:tablet/base.html
app/tablet/app_base.html
layout/tablet/three-cols.html
...DEVICETYPE_MOBILE_PATTERNSandDEVICETYPE_TABLET_PATTERNSYou can override default search patterns. It search in tablet patterns first.Build statusMaster branch: