django的扩展用户配置文件。

django-classic-user-accounts的Python项目详细描述


Django Classic用户帐户

GitHub forksGitHub issuesGitHub starsGitHub licenseGitHub licenseGitHub licenseGitHub license

最新更新

  • 添加了唯一的手机号码功能(Add CLASSIC_UNIQUE_MOBILE = True in your settings file)。
  • 新增矩阵管理BT4主题(Add THEME_NAME = 'matrix-admin-v2' in your settings file)。

功能
  • 登录
  • 唱起来
  • 电子邮件确认
  • 扩展用户模型
  • 个人资料图片
  • 密码重置
  • 帐户管理(更新帐户设置和更改密码)
  • 自定义User模型支持

要求
  • Django 2.0+
  • python 3.5或3.6

快速安装

1. Add "ClassicUserAccounts" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        'django.contrib.contenttypes',
	    'django.contrib.sessions',
	    'django.contrib.messages',
	    'django.contrib.staticfiles',
	    'ClassicUserAccounts',
	    'sorl.thumbnail',
	    'django.contrib.admin',
	    'django.contrib.auth',
	    ...
    ]

2. Add "AUTH_USER_MODEL" in your settings file like this::

	AUTH_USER_MODEL = 'ClassicUserAccounts.User'

3. Add "Middleware" to youe MIDDLEWARE settings like this::

	MIDDLEWARE = [
	   ...
	   'ClassicUserAccounts.middleware.ClassicUserAccountsMiddleWare',
	]

4. Add "SITE_NAME" in your settings file like this::

    SITE_NAME = 'Your site name'

5. Add url in your project.urls file::

	urlpatterns = [
	    path('accounts/', include('ClassicUserAccounts.urls')),
		...
	]

6. Change Skin ::

    Avaliable Skins:: [
        'skin-blue',
        'skin-black',
        'skin-red',
        'skin-yellow',
        'skin-purple',
        'skin-green',
        'skin-blue-light',
        'skin-black-light',
        'skin-red-light',
        'skin-yellow-light',
        'skin-purple-light',
        'skin-green-light'
    ]

    You have to add "ROLE_BASED_SKIN" in your settings.py file like this::

    ROLE_BASED_SKIN = [
        {'role': 'Admin', 'skin_name': 'skin-red'},
        {'role': 'Subscriber', 'skin_name': 'skin-purple'}
    ]

7. Multi theme feature added::

    Add THEME_NAME in your settings file to change theme
    THEME_NAME = 'default-theme'  Required
    USER_BASED_THEME = False # Default False
    Available themes : default-theme, theme-1, theme-2, theme-3

8. Password Reset templates added.

9. Run python manage.py migrate to extend django user model.

10. Start the development server and visit http://127.0.0.1:8000/admin/ to manage user profile.

11. Available Themes.::

    default-theme
    theme-1
    theme-2
    matrix-admin
    matrix-admin-v2

基本模板设置
  1. 在项目模板目录中创建site_base.html文件。site_base.html有以下内容。
{% extends request.THEME_NAME|add:'classic_site_base.html' %}
{% load static %}

{% block side_menu %}
`Place your Side menu here `

<li>
    <a href="{% url 'logout' %}">
        <i class="fa fa-lock"></i> <span>Logout</span>
        <span class="pull-right-container"></span>
    </a>
</li>
{% endblock %}
  1. classic_site_base.html让这些块放html内容。
{% block title %} {% endblock %} Which is placed inside the title tag.

{% block extra_style_block %}{% endblock %} Placed in bottom of </head> tag.

{% block extra_nav_item %} {% endblock %} Placed on the top right header nav.

{% block side_menu %} {% endblock %} Side navigation menu.

{% block content %} {% endblock %} Content block which placed in body tag.

{% block extra_script_block %} {% endblock %} Placed in the bottom of </body> tag.

照片

Login PageN|Solid

Signup PageN|Solid

Reset Password PageN|Solid

Dashboard PageN|Solid

Django Admin DashboardN|Solid

User model table viewN|Solid

Django Model Edit ViewN|Solid

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java根据两个数组的值对数组进行排序   具有自签名证书和NTLM代理的java Maven SSL repo错误   java自定义字体按钮不工作AndroidStudio   java通过Spring MVC web应用程序向客户端发送文本文件   Java Spring Web服务SOAP身份验证   ANT property environment=“env”无法在JAVA中检索它,但如果作为ANT命令运行,则可以正常工作   java是为spring mvc rest api或spring boot api对应用服务器的每个新请求创建的服务、存储库和组件的新实例吗?   java私有静态最终字符串未完成其工作   PKCS12的安全Java密钥重新处理   java JPA继承表每类SQLSyntaxErrorException