Skip to content

Commit

Permalink
My first two cents for Django-CRM (#374)
Browse files Browse the repository at this point in the history
* Update settings.py

set default DEBUG_STATUS to False, and reintroduce .dev_settings for development use

* customizable application title

Co-authored-by: Hanson Hu <>
  • Loading branch information
hanson2010 authored Apr 6, 2020
1 parent 31cc1e6 commit 8b98c7d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 29 deletions.
16 changes: 11 additions & 5 deletions crm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SECRET_KEY = 'SECRET_SECRET_SECRET'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv('DEBUG_STATUS', True)
DEBUG = os.getenv('DEBUG_STATUS', False)

ALLOWED_HOSTS = ['*']

Expand Down Expand Up @@ -68,6 +68,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django_settings_export.settings_export',
],
},
},
Expand Down Expand Up @@ -386,11 +387,16 @@
# HAYSTACK_DEFAULT_OPERATOR = 'AND'

# Load the local settings file if it exists
if os.path.isfile('crm/local_settings.py'):
from .local_settings import *
if DEBUG:
try:
from .dev_settings import *
except ImportError:
raise ImproperlyConfigured("No dev settings file found")
else:
print("No local settings file found")

try:
from .local_settings import *
except ImportError:
raise ImproperlyConfigured("No local settings file found")

CACHES = {
'default': {
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ codacy-coverage==1.3.11
django-haystack==2.8.0
elasticsearch==2.3
python-memcached==1.59
boto
boto==2.49.0
django-settings-export==1.2.1
12 changes: 6 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</head>
<body class="main_body_bg_color">
<div class="wrapper">

<header>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">

Expand Down Expand Up @@ -71,17 +71,17 @@
{% endif %}
</nav>
</header>


<div id="mainbody" class="main_container" style="padding-top:65px;">

{% block breadcrumb %}
{% endblock %}

{% block content %}
{% endblock %}
</div>

</div>

{% block js_block %}
Expand Down
10 changes: 5 additions & 5 deletions templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Django CRM</title>
<title>{{ settings.APPLICATION_NAME }}</title>

<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/css/bootstrap.min.css" />
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" />

{% compress css %}
<link href="{% static 'css/main.scss' %}" type="text/x-scss" rel="stylesheet">
{% endcompress %}
Expand All @@ -36,7 +36,7 @@
<div class="col-md-6 col-lg-6 col-xl-4">
<div class="login_block">
<div class="login_form_block">
<div class="welcome">Django CRM</div>
<div class="welcome">{{ settings.APPLICATION_NAME }}</div>
<form method="POST" action="">
<div class="form-group">
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Email" name="email">
Expand Down
24 changes: 12 additions & 12 deletions templates/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Django CRM</title>
<title>{{ settings.APPLICATION_NAME }}</title>
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" />
Expand Down Expand Up @@ -50,36 +50,36 @@
{% block header %}
<header>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">

<div class="dropdown">

{% if request.user.is_superuser or request.user.role == 'ADMIN' %}
<a class="dropdown-toggle navbar-brand" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false" style="color:#44535c">
Django CRM
{{ settings.APPLICATION_NAME }}
</a>
{% else %}
{% if request.user.has_sales_access and request.user.has_marketing_access %}
<a class="dropdown-toggle navbar-brand" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false" style="color:#44535c">
Django CRM
{{ settings.APPLICATION_NAME }}
</a>
{% elif request.user.has_sales_access and not request.user.has_marketing_access %}
<a class="navbar-brand" href="{% url 'common:home' %}" role="button" id="dropdownMenuLink" data-toggle=""
aria-haspopup="true" aria-expanded="false" style="color:#44535c">
Django CRM
{{ settings.APPLICATION_NAME }}
</a>
{% elif not request.user.has_sales_access and request.user.has_marketing_access %}
<a class="navbar-brand" href="{% url 'marketing:dashboard' %}" role="button" id="dropdownMenuLink" data-toggle=""
aria-haspopup="true" aria-expanded="false" style="color:#44535c">
Django CRM
{{ settings.APPLICATION_NAME }}
</a>
{% else %}
{{''}}
{% endif %}
{% endif %}



<div class="dropdown-menu mt-2" aria-labelledby="dropdownMenuLink">
{% if user.is_superuser or user.role == 'ADMIN' %}
Expand All @@ -97,7 +97,7 @@
{{''}}
{% endif %}
{% endif %}

</div>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
Expand Down Expand Up @@ -215,16 +215,16 @@
/*
Usage is very simple; to block user activity for the page:
$.blockUI();
Blocking with a custom message:
$.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });
Blocking with custom style:
$.blockUI({ css: { backgroundColor: '#f00', color: '#fff'} });
To unblock the page:
$.unblockUI();
If you want to use the default settings and have the UI blocked for all ajax requests, it's as easy as this:
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
*/
Expand Down

0 comments on commit 8b98c7d

Please sign in to comment.