Comments (10)
Hi. That is strange. I've tested with this environment and it worked.
Can you please check if notice exists in HTML code returned by the server?
And please provide your browser and its version.
from django-admin-env-notice.
Chrome Versión 71.0.3578.80 (Build oficial) (64 bits)
| <!DOCTYPE html>
-- | --
|
| <html lang="es-AR " >
| <head>
| <title>Iniciar sesión \| Sitio de administración de Django</title>
| <link rel="stylesheet" type="text/css" href="/static/admin/css/base.css">
|
|
|
| <style type="text/css">
| body:before{
| display: block;
| line-height: 35px;
| text-align: center;
| font-weight: bold;
| text-transform: uppercase;
| color: white;
| content: “Produccion”;
| background-color: #FF2222;
| }
| </style>
|
| <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
| <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/fontawesome.css" integrity="sha384-q3jl8XQu1OpdLgGFvNRnPdj5VIlCvgsDQTQB6owSOHWlAurxul7f+JpUOVdAiJ5P" crossorigin="anonymous">
| <style type="text/css">
| /* shortcuts */
| .admin_shortcuts .shortcuts { background: #50839e; padding: 10px 40px 20px; margin: 0; list-style: none;
| box-shadow: 0 2px 5px rgba(0,0,0,0.2) inset; }
| @media (max-width: 1024px) { .admin_shortcuts .shortcuts { padding-left: 30px; padding-right: 30px; } }
| .admin_shortcuts .shortcuts ul:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0;
| height: 0; }
| .admin_shortcuts .shortcuts ul { padding: 0; margin: 5px 0 0 0; list-style: none; }
| .admin_shortcuts .shortcuts h2 { color: #fff; border-bottom: 1px solid #6093ae; line-height: 24px; margin: 10px 0 5px; }
| .admin_shortcuts .shortcuts li { padding: 0; margin: 0; float: left; list-style: none; }
| .admin_shortcuts .shortcuts li a { padding: 20px 0px 20px 55px; margin: 5px 10px 5px 0; display: block; float: left;
| color: #fff; border: 1px solid #6b9db9; background: #6093ae 10px 50% no-repeat; font-size: 14px; line-height: 14px;
| border-radius: 3px; box-shadow: 1px 1px 3px rgba(0,0,0,0.1); position: relative; min-height: 14px; }
| .admin_shortcuts .shortcuts li a .title { text-shadow: 0 0 1px rgba(0,0,0,0.5); padding-right: 25px; }
| .admin_shortcuts .shortcuts li a:hover, .admin_shortcuts .shortcuts li a:focus { background-color: #6b9db9; }
| .admin_shortcuts .shortcuts li a:active { background-color: #50839e; border-color: #6093ae; }
|
|
| /* count */
| .admin_shortcuts .shortcuts li a .count { position: absolute; right: 3px; bottom: 2px; color: #96c9e5; font-size: 10px; }
| .admin_shortcuts .shortcuts li a .count_new { position: absolute; right: -7px; top: -7px; color: #fff; font-size: 11px;
| line-height: 14px; border-radius: 30px; display: block; overflow: hidden; max-width: 60px; min-width: 15px;
| height: 20px; padding: 5px 5px 0 5px; background: #940f3a; text-align: center; font-weight: bold;
| box-shadow: 0 0 3px rgba(0,0,0,0.2); }
|
|
| /* advanced button */
| .admin_shortcuts #toggle_app_list { display: block; text-align: center; padding: 2px 0; color: #fff; font-size: 11px;
| font-weight: bold; background: #79aec8; }
| .admin_shortcuts #toggle_app_list:hover { text-decoration: none; }
| .admin_shortcuts #toggle_app_list .closed { display: inline; }
| .admin_shortcuts #toggle_app_list .open { display: none; }
| .admin_shortcuts #toggle_app_list.open .open { display: inline; }
| .admin_shortcuts #toggle_app_list.open .closed { display: none; }
|
|
| /* icons */
| .admin_shortcuts .shortcuts li a .icon { width: 34px; height: 32px; text-align: center; font-size: 24px; line-height: 32px; position: absolute; left: 10px; top: 10px; color: rgba(255,255,255,0.8); }
|
| </style>
|
| <link rel="stylesheet" type="text/css" href="/static/admin/css/login.css" />
|
|
| <style type="text/css">
| input#id_otp_token,
| select#id_otp_device
| {
| clear: both;
| padding: 6px;
| width: 100%;
| -webkit-box-sizing: border-box;
| -moz-box-sizing: border-box;
| box-sizing: border-box;
| }
| </style>
|
|
|
|
|
|
|
|
| <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
| <link rel="stylesheet" type="text/css" href="/static/admin/css/responsive.css">
|
|
| <meta name="robots" content="NONE,NOARCHIVE">
| </head>
|
|
| <body class=" login"
| data-admin-utc-offset="-10800">
|
| <!-- Container -->
| <div id="container">
|
|
| <!-- Header -->
| <div id="header">
| <div id="branding">
|
| <h1 id="site-name"><a href="/backend/">Administración de Django</a></h1>
|
| </div>
|
|
| </div>
| <!-- END Header -->
|
|
|
|
|
|
|
| <!-- Content -->
| <div id="content" class="colM">
|
|
|
|
|
|
|
| <div id="content-main">
|
|
|
| <form action="/backend/login/?next=/backend/" method="post" id="login-form"><input type="hidden" name="csrfmiddlewaretoken" value="IdgFyqbnOGWPoT8SG4lZIgzYd3aOuPtbA5EK1yVMndmOBs8zcabBUwfJMFK9pW26">
| <div class="form-row">
|
| <label class="required" for="id_username">Nombre de usuario:</label> <input type="text" name="username" autofocus required id="id_username">
| </div>
| <div class="form-row">
|
| <label class="required" for="id_password">Contraseña:</label> <input type="password" name="password" required id="id_password">
| <input type="hidden" name="next" value="/backend/" />
| </div>
|
| <div class="form-row">
|
| <label for="id_otp_token" class="required">OTP Token:</label> <input type="text" name="otp_token" id="id_otp_token">
| </div>
|
|
| <div class="submit-row">
| <label> </label><input type="submit" value="Iniciar sesión" />
|
| </div>
| </form>
|
| <script type="text/javascript">
| document.getElementById('id_username').focus()
| </script>
| </div>
|
|
| <br class="clear">
| </div>
| <!-- END Content -->
|
| <div id="footer"></div>
| </div>
| <!-- END Container -->
|
| </body>
| </html>
from django-admin-env-notice.
I can see your classes have .admin_shortcuts
in your template, which come from django-admin-shortcuts
I am using the same and have the same result. Without importing admin_shortcuts
in INSTALLED_APPS
it works fine.
Going to try to find out how to make it work, but I have a feeling it will require copy/pasting some of the template from admin-env back into a customised base_site.html
which imports some of from django-admin-shortcuts
functions. More on this later...
from django-admin-env-notice.
simpler than I thought... just copy/paste this base_site.html
file
https://github.com/dizballanze/django-admin-env-notice/blob/6c6f0728204b50225eff503181b0e6a401802ebf/django_admin_env_notice/templates/admin/base_site.html
in your own templates/admin/base_site.html
file
See https://docs.djangoproject.com/en/2.1/howto/overriding-templates/ for more info around required configuration to make this work
from django-admin-env-notice.
Just wanted to drop a note: This still repos when django-admin-honeypot is used, they seem mutually exclusive in terms of compatibility.
from django-admin-env-notice.
@duaneking Hey there, django-admin-honeypot author here. I just discovered django-admin-env-notice, and was able to get it running on a project that also uses django-admin-honeypot. I'm curious about what led you to believe they're mutually exclusive? I'd love to know if there's anything on the DAH side that could be changed to solve you're issue. Thanks!
from django-admin-env-notice.
I honestly dont know; I gave up and moved to a different language/framework to get the work done.
from django-admin-env-notice.
I also had the same problem and I have swapped the order of the loaders in the template to make it work.
Before: does not work
"loaders": [
# 'django.template.loaders.filesystem.Loader',
("django.template.loaders.filesystem.Loader", [BASE_DIR / "templates"]),
("django.template.loaders.app_directories.Loader",),
# [os.path.join(BASE_DIR, 'templates')],
After: does work
"loaders": [
# 'django.template.loaders.filesystem.Loader',
("django.template.loaders.app_directories.Loader",),
("django.template.loaders.filesystem.Loader", [BASE_DIR / "templates"]),
# [os.path.join(BASE_DIR, 'templates')],
from django-admin-env-notice.
For grappelli, I think it should be
ENVIRONMENT_ADMIN_SELECTOR = "#grp-header"
and not
ENVIRONMENT_ADMIN_SELECTOR = "grp-header"
from django-admin-env-notice.
and even better with
ENVIRONMENT_ADMIN_SELECTOR = ".grp-module-login:before, #grp-header"
so that it applies both to the admin login screen and to the admin panel
from django-admin-env-notice.
Related Issues (12)
- Compatibility using Django Grappelli HOT 2
- Using in own templates
- Say Thanks Link is Broken
- Does this work with Django 4.0? HOT 3
- Not working with Grappelli 3.0.2 and Django 3.2.12
- [Enhancement] Noscript notice header above environment notice header
- Do not show notice to users before auth HOT 2
- In floating mode, banner eventually scrolls off screen
- Incorrect syntax (closing condition) HOT 1
- [feature] text color HOT 3
- CSP support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-admin-env-notice.