Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
15fc26f5
Commit
15fc26f5
authored
Feb 07, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up packaging and staticfiles changes. Fixes #155. Fixes #153. Fixes #150.
parent
87ef8558
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
75 deletions
+160
-75
CHANGELOG.rst
+1
-0
MANIFEST.in
+2
-2
djangorestframework/static/css/djangorestframework.css
+57
-0
djangorestframework/templates/api_login.html
+40
-50
setup.py
+60
-23
No files found.
CHANGELOG.rst
View file @
15fc26f5
...
@@ -9,6 +9,7 @@ development
...
@@ -9,6 +9,7 @@ development
- Easier to override. Won't conflict with customised admin styles (eg grappelli)
- Easier to override. Won't conflict with customised admin styles (eg grappelli)
* Drop implied 'pk' filter if last arg in urlconf is unnamed.
* Drop implied 'pk' filter if last arg in urlconf is unnamed.
- Too magical. Explict is better than implicit.
- Too magical. Explict is better than implicit.
* Tider setup.py
* Bugfixes:
* Bugfixes:
- Bug with PerUserThrottling when user contains unicode chars.
- Bug with PerUserThrottling when user contains unicode chars.
...
...
MANIFEST.in
View file @
15fc26f5
recursive-include djangorestframework/static *.ico *.txt
recursive-include djangorestframework/static *.ico *.txt
*.css
recursive-include djangorestframework/templates *.txt *.html
recursive-include djangorestframework/templates *.txt *.html
recursive-include examples .keep *.py *.txt
recursive-include examples .keep *.py *.txt
recursive-include docs *.py *.rst *.html *.txt
recursive-include docs *.py *.rst *.html *.txt
include AUTHORS LICENSE requirements.txt tox.ini
include AUTHORS LICENSE
CHANGELOG.rst
requirements.txt tox.ini
djangorestframework/static/css/djangorestframework.css
View file @
15fc26f5
...
@@ -1129,6 +1129,58 @@ fieldset.monospace textarea {
...
@@ -1129,6 +1129,58 @@ fieldset.monospace textarea {
float
:
right
;
float
:
right
;
}
}
body
.login
{
background
:
#eee
;
}
.login
#container
{
background
:
white
;
border
:
1px
solid
#ccc
;
width
:
28em
;
min-width
:
300px
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-top
:
100px
;
}
.login
#content-main
{
width
:
100%
;
}
.login
form
{
margin-top
:
1em
;
}
.login
.form-row
{
padding
:
4px
0
;
float
:
left
;
width
:
100%
;
}
.login
.form-row
label
{
float
:
left
;
width
:
9em
;
padding-right
:
0.5em
;
line-height
:
2em
;
text-align
:
right
;
font-size
:
1em
;
color
:
#333
;
}
.login
.form-row
#id_username
,
.login
.form-row
#id_password
{
width
:
14em
;
}
.login
span
.help
{
font-size
:
10px
;
display
:
block
;
}
.login
.submit-row
{
clear
:
both
;
padding
:
1em
0
0
9.4em
;
}
/* Overrides specific to REST framework */
/* Overrides specific to REST framework */
#site-name
a
{
#site-name
a
{
...
@@ -1147,6 +1199,11 @@ fieldset.monospace textarea {
...
@@ -1147,6 +1199,11 @@ fieldset.monospace textarea {
}
}
/* Custom styles */
/* Custom styles */
.version
{
.version
{
font-size
:
8px
;
font-size
:
8px
;
}
}
.form-row
{
border-bottom
:
0.25em
!important
;
}
djangorestframework/templates/api_login.html
View file @
15fc26f5
{% load static %}
<html>
<html>
<head>
{% if ADMIN_MEDIA_PREFIX %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{ADMIN_MEDIA_PREFIX}}css/base.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{ADMIN_MEDIA_PREFIX}}css/forms.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{ADMIN_MEDIA_PREFIX}}css/login.css'
/>
{% else %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{STATIC_URL}}admin/css/base.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{STATIC_URL}}admin/css/forms.css'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{{STATIC_URL}}admin/css/login.css'
/>
{% endif %}
<style>
.form-row
{
border-bottom
:
0.25em
!important
}
</style>
</head>
<body
class=
"login"
>
<div
id=
"container"
>
<div
id=
"header"
>
<div
id=
"branding"
>
<h1
id=
"site-name"
>
Django REST framework
</h1>
</div>
</div>
<div
id=
"content"
class=
"colM"
>
<div
id=
"content-main"
>
<form
method=
"post"
action=
"{% url djangorestframework.utils.staticviews.api_login %}"
id=
"login-form"
>
{% csrf_token %}
<div
class=
"form-row"
>
<label
for=
"id_username"
>
Username:
</label>
{{ form.username }}
</div>
<div
class=
"form-row"
>
<label
for=
"id_password"
>
Password:
</label>
{{ form.password }}
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</div>
<div
class=
"form-row"
>
<label>
</label><input
type=
"submit"
value=
"Log in"
>
</div>
</form>
<script
type=
"text/javascript"
>
<head>
document
.
getElementById
(
'id_username'
).
focus
()
<link
rel=
"stylesheet"
type=
"text/css"
href=
'{% get_static_prefix %}css/djangorestframework.css'
/>
</script>
</head>
</div>
<body
class=
"login"
>
<div
id=
"container"
>
<div
id=
"header"
>
<div
id=
"branding"
>
<h1
id=
"site-name"
>
Django REST framework
</h1>
</div>
</div>
<div
id=
"content"
class=
"colM"
>
<div
id=
"content-main"
>
<form
method=
"post"
action=
"{% url djangorestframework.utils.staticviews.api_login %}"
id=
"login-form"
>
{% csrf_token %}
<div
class=
"form-row"
>
<label
for=
"id_username"
>
Username:
</label>
{{ form.username }}
</div>
<div
class=
"form-row"
>
<label
for=
"id_password"
>
Password:
</label>
{{ form.password }}
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</div>
<div
class=
"form-row"
>
<label>
</label><input
type=
"submit"
value=
"Log in"
>
</div>
</form>
<script
type=
"text/javascript"
>
document
.
getElementById
(
'id_username'
).
focus
()
</script>
</div>
<br
class=
"clear"
>
</div>
<div
id=
"footer"
></div>
</div>
<br
class=
"clear"
>
</body>
</div>
<div
id=
"footer"
></div>
</div>
</body>
</html>
</html>
setup.py
100644 → 100755
View file @
15fc26f5
#!/usr/bin/env
/
python
#!/usr/bin/env
python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
setuptools
import
setup
from
distutils.core
import
setup
import
re
import
os
import
sys
import
os
,
re
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'djangorestframework'
,
'__init__.py'
)
def
get_version
(
package
):
init_py
=
open
(
path
)
.
read
()
"""
VERSION
=
re
.
match
(
"__version__ = '([^']+)'"
,
init_py
)
.
group
(
1
)
Return package version as listed in `__version__` in `init.py`.
"""
init_py
=
open
(
os
.
path
.
join
(
package
,
'__init__.py'
))
.
read
()
return
re
.
match
(
"__version__ = ['
\"
]([^'
\"
]+)['
\"
]"
,
init_py
)
.
group
(
1
)
def
get_packages
(
package
):
"""
Return root package and all sub-packages.
"""
return
[
dirpath
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
package
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
dirpath
,
'__init__.py'
))]
def
get_package_data
(
package
):
"""
Return all files under the root package, that are not in a
package themselves.
"""
walk
=
[(
dirpath
.
replace
(
package
+
os
.
sep
,
''
,
1
),
filenames
)
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
package
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
dirpath
,
'__init__.py'
))]
filepaths
=
[]
for
base
,
filenames
in
walk
:
filepaths
.
extend
([
os
.
path
.
join
(
base
,
filename
)
for
filename
in
filenames
])
return
{
package
:
filepaths
}
version
=
get_version
(
'djangorestframework'
)
if
sys
.
argv
[
-
1
]
==
'publish'
:
os
.
system
(
"python setup.py sdist upload"
)
print
"You probably want to also tag the version now:"
print
" git tag -a
%
s -m 'version
%
s'"
%
(
version
,
version
)
print
" git push --tags"
sys
.
exit
()
setup
(
setup
(
name
=
'djangorestframework'
,
name
=
'djangorestframework'
,
version
=
VERSION
,
version
=
version
,
url
=
'http://django-rest-framework.org'
,
url
=
'http://django-rest-framework.org'
,
download_url
=
'http://pypi.python.org/pypi/djangorestframework/'
,
download_url
=
'http://pypi.python.org/pypi/djangorestframework/'
,
license
=
'BSD'
,
license
=
'BSD'
,
description
=
'A lightweight REST framework for Django.'
,
description
=
'A lightweight REST framework for Django.'
,
author
=
'Tom Christie'
,
author
=
'Tom Christie'
,
author_email
=
'tom@tomchristie.com'
,
author_email
=
'tom@tomchristie.com'
,
packages
=
[
'djangorestframework'
,
packages
=
get_packages
(
'djangorestframework'
),
'djangorestframework.templatetags'
,
package_data
=
get_package_data
(
'djangorestframework'
),
'djangorestframework.tests'
,
test_suite
=
'djangorestframework.runtests.runcoverage.main'
,
'djangorestframework.runtests'
,
'djangorestframework.utils'
],
package_dir
=
{
'djangorestframework'
:
'djangorestframework'
},
package_data
=
{
'djangorestframework'
:
[
'templates/*'
,
'static/*'
]},
test_suite
=
'djangorestframework.runtests.runcoverage.main'
,
install_requires
=
[
'URLObject>=0.6.0'
],
install_requires
=
[
'URLObject>=0.6.0'
],
classifiers
=
[
classifiers
=
[
'Development Status :: 4 - Beta'
,
'Development Status :: 4 - Beta'
,
'Environment :: Web Environment'
,
'Environment :: Web Environment'
,
'Framework :: Django'
,
'Framework :: Django'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment