Skip to content

Commit

Permalink
rename to pyup-django
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfk committed Feb 2, 2017
1 parent 049dfed commit f9b52f8
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* safety-django version:
* pyup-django version:
* Django version:
* Python version:
* Operating System:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
deploy:
true:
condition: $TOXENV == py27
repo: pyupio/safety-django
repo: pyupio/pyup-django
tags: true
distributions: sdist bdist_wheel
password:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
recursive-include safety_django/templates *
recursive-include pyup_django/templates *
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
*Note: safety-django is currently in its early stages. It's probably no even installable and likely that there are some false positives and missing packages.*
*Note: pyup-django is currently in its early stages. It's probably no even installable and likely that there are some false positives and missing packages.*

[![PyPi](https://img.shields.io/pypi/v/safety-django.svg)](https://pypi.python.org/pypi/safety-django)
[![Travis](https://img.shields.io/travis/pyupio/safety-django.svg)](https://travis-ci.org/pyupio/safety-django)
[![PyPi](https://img.shields.io/pypi/v/pyup-django.svg)](https://pypi.python.org/pypi/pyup-django)
[![Travis](https://img.shields.io/travis/pyupio/pyup-django.svg)](https://travis-ci.org/pyupio/pyup-django)

# About

Safety for Django checks your installed dependencies for known security vulnerabilities and displays them in the admin area.
Checks your installed Django release for known security vulnerabilities and displays a warning in the admin area.

# Installation

Install `safety-django` with pip:
Install `pyup-django` with pip:

```
pip install safety-django
pip install pyup-django
```

and add it to your `INSTALLED_APPS`, before `django.contrib.admin`

```
INSTALLED_APPS = [
'safety_django',
'pyup_django',
'django.contrib.admin',
]
```
Expand All @@ -31,5 +31,5 @@ INSTALLED_APPS = [

# Support

If you are using `safety` in one of your projects, please consider getting a paid
If you are using `pyup-django` in one of your projects, please consider getting a paid
[pyup.io](https://pyup.io) account. This is what makes projects like this possible.
File renamed without changes.
6 changes: 3 additions & 3 deletions safety_django/admin.py → pyup_django/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def has_module_permission(self, request):
def get_urls(self):
urls = super(StatusAdmin, self).get_urls()
return [
url(r'^safety/$', self.admin_site.admin_view(self.registration_status_view),
name="safety"),
url(r'^pyup/$', self.admin_site.admin_view(self.registration_status_view),
name="pyup"),
] + urls

def registration_status_view(self, request):
Expand All @@ -35,7 +35,7 @@ def registration_status_view(self, request):
"template": template,
"run_again_at": time.time() + 60 * 60 * 24
}
request.session["safety_django"] = data
request.session["pyup_django"] = data
return HttpResponse(json.dumps(data), content_type="application/json")

admin.site.register(Status, StatusAdmin)
4 changes: 2 additions & 2 deletions safety_django/apps.py → pyup_django/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

class DjangoUpdaterAppConfig(AppConfig):

name = 'safety_django'
verbose_name = "Safety for Django"
name = 'pyup_django'
verbose_name = "pyup.io for Django"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
{{ block.super }}
<style>

.safety-insecure{
.pyup-insecure{
background: #ff1325 !important;
}

.safety-header{
.pyup-header{
width: 100%;
color: white;
overflow: hidden;
padding: 0px 10px 20px 40px;
}
.safety-header.dj-18{
.pyup-header.dj-18{
padding: 0px 10px 10px 10px;
}

#safety-show{
#pyup-show{
cursor: pointer;
}

#safety-vulns{
#pyup-vulns{
padding: 10px;
display: none;
}

#safety-chevron{
#pyup-chevron{
font-size: 8px;
}

Expand All @@ -39,7 +39,7 @@
document.addEventListener("DOMContentLoaded", function(event) {

function check() {
var path = '{% url "admin:safety" %}';
var path = '{% url "admin:pyup" %}';
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState === 4) {
Expand All @@ -56,22 +56,22 @@
function displayBanner(data) {
var header = document.getElementById("header");
if (data.insecure) {
header.className += "safety-insecure";
header.className += "pyup-insecure";
header.outerHTML += data.template;
document.getElementById("safety-show").onclick = function(e){
document.getElementById("pyup-show").onclick = function(e){
// show the table view
document.getElementById("safety-vulns").style.display = "block";
document.getElementById("pyup-vulns").style.display = "block";
// hide the clickable text
document.getElementById("safety-show").style.display = "none";
document.getElementById("pyup-show").style.display = "none";
};
}

}

var nextRunAt = new Date();
//
{% if request.session.safety_django %}
nextRunAt.setTime({{ request.session.safety_django.run_again_at }} * 1000);
{% if request.session.pyup_django %}
nextRunAt.setTime({{ request.session.pyup_django.run_again_at }} * 1000);
{% endif %}

if(nextRunAt < Date.now()){
Expand All @@ -80,8 +80,8 @@
}else{
// result of the last run is still valid, use the data from the session to display the message
displayBanner({
"insecure": {% if request.session.safety_django.insecure %}true{% else %}false{% endif %},
"template": '{{ request.session.safety_django.template|safe }}'
"insecure": {% if request.session.pyup_django.insecure %}true{% else %}false{% endif %},
"template": '{{ request.session.pyup_django.template|safe }}'
});
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if vulns %}
<div class="safety-header safety-insecure">
You have {{ vulns|length }} package{{ vulns|length|pluralize }} with known security vulnerabilities installed. <span id="safety-show"> Show <span id="safety-chevron">&#x25BC;</span></span>
<div id="safety-vulns">
<div class="pyup-header pyup-insecure">
You have {{ vulns|length }} package{{ vulns|length|pluralize }} with known security vulnerabilities installed. <span id="pyup-show"> Show <span id="pyup-chevron">&#x25BC;</span></span>
<div id="pyup-vulns">
<table>
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tag = True
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:safety_django/__init__.py]
[bumpversion:file:pyup_django/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
]

setup(
name='safety-django',
name='pyup-django',
version='0.1.1',
description="safety-django checks your installed dependencies for known security vulnerabilities and displays them in the admin area.",
description="pyup-django checks your installed dependencies for known security vulnerabilities and displays them in the admin area.",
long_description=readme,
author="pyup.io",
author_email='support@pyup.io',
url='https://github.com/pyupio/safety_django',
url='https://github.com/pyupio/pyup-django',
packages=[
'safety_django',
'pyup_django',
],
package_dir={'safety_django':
'safety_django'},
package_dir={'pyup_django':
'pyup_django'},
include_package_data=True,
install_requires=requirements,
license="MIT license",
zip_safe=False,
keywords='safety_django',
keywords='pyup_django',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ envlist = py26, py27, py33, py34, py35, flake8
[testenv:flake8]
basepython=python
deps=flake8
commands=flake8 safety_django
commands=flake8 pyup_django

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/safety_django
PYTHONPATH = {toxinidir}:{toxinidir}/pyup_django

commands = python setup.py test

Expand Down

0 comments on commit f9b52f8

Please sign in to comment.