项目作者: app-generator

项目描述 :
Django Dashboard - Millenium PRO Design | AppSeed
高级语言:
项目地址: git://github.com/app-generator/django-dashboard-millenium-pro.git
创建时间: 2020-05-17T04:49:30Z
项目社区:https://github.com/app-generator/django-dashboard-millenium-pro

开源协议:Other

下载


Django Millenium PRO

Commercial product - Django Dashboard coded on top of Millenium Dark PRO crafted by ThemeKita - Features:

  • Sample UI Kit: Millenium Dark PRO provided by ThemeKita
  • UI-Ready app, SQLite Database, Django Native ORM
  • Modular design, clean code-base
  • Session-Based Authentication, Forms validation
  • Deployment scripts: Docker, Gunicorn / Nginx
  • Commercial License: Personal / Developer
  • 24/7 Live Support via Discord.

Links


Django Millenium PRO - Admin Dashboard coded in Django.


How to use it

  1. $ # Get the code
  2. $ git clone https://github.com/app-generator/priv-django-dashboard-millenium-pro.git
  3. $ cd priv-django-dashboard-millenium-pro
  4. $
  5. $ # Virtualenv modules installation (Unix based systems)
  6. $ virtualenv env
  7. $ source env/bin/activate
  8. $
  9. $ # Virtualenv modules installation (Windows based systems)
  10. $ # virtualenv env
  11. $ # .\env\Scripts\activate
  12. $
  13. $ # Install modules - SQLite Storage
  14. $ pip3 install -r requirements.txt
  15. $
  16. $ # Create tables
  17. $ python manage.py makemigrations
  18. $ python manage.py migrate
  19. $
  20. $ # Start the application (development mode)
  21. $ python manage.py runserver # default port 8000
  22. $
  23. $ # Start the app - custom port
  24. $ # python manage.py runserver 0.0.0.0:<your_port>
  25. $
  26. $ # Access the web app in browser: http://127.0.0.1:8000/

Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.


Code-base structure

The project is coded using a simple and intuitive structure presented bellow:

  1. < PROJECT ROOT >
  2. |
  3. |-- core/ # Implements app logic and serve the static assets
  4. | |-- settings.py # Django app bootstrapper
  5. | |-- wsgi.py # Start the app in production
  6. | |-- urls.py # Define URLs served by all apps/nodes
  7. | |
  8. | |-- static/
  9. | | |-- <css, JS, images> # CSS files, Javascripts files
  10. | |
  11. | |-- templates/ # Templates used to render pages
  12. | |
  13. | |-- includes/ # HTML chunks and components
  14. | | |-- navigation.html # Top menu component
  15. | | |-- sidebar.html # Sidebar component
  16. | | |-- footer.html # App Footer
  17. | | |-- scripts.html # Scripts common to all pages
  18. | |
  19. | |-- layouts/ # Master pages
  20. | | |-- base-fullscreen.html # Used by Authentication pages
  21. | | |-- base.html # Used by common pages
  22. | |
  23. | |-- accounts/ # Authentication pages
  24. | | |-- login.html # Login page
  25. | | |-- register.html # Register page
  26. | |
  27. | index.html # The default page
  28. | page-404.html # Error 404 page
  29. | page-500.html # Error 404 page
  30. | *.html # All other HTML pages
  31. |
  32. |-- authentication/ # Handles auth routes (login and register)
  33. | |
  34. | |-- urls.py # Define authentication routes
  35. | |-- views.py # Handles login and registration
  36. | |-- forms.py # Define auth forms
  37. |
  38. |-- app/ # A simple app that serve HTML files
  39. | |
  40. | |-- views.py # Serve HTML pages for authenticated users
  41. | |-- urls.py # Define some super simple routes
  42. |
  43. |-- requirements.txt # Development modules - SQLite storage
  44. |
  45. |-- .env # Inject Configuration via Environment
  46. |-- manage.py # Start the app - Django default start script
  47. |
  48. |-- ************************************************************************


The bootstrap flow

  • Django bootstrapper manage.py uses core/settings.py as the main configuration file
  • core/settings.py loads the app magic from .env file
  • Redirect the guest users to Login page
  • Unlock the pages served by app node for authenticated users


Deployment

The app is provided with a basic configuration to be executed in Docker, Gunicorn, and Waitress.

Docker execution


The application can be easily executed in a docker container. The steps:

Get the code

  1. $ git clone https://github.com/app-generator/priv-django-dashboard-millenium-pro.git
  2. $ cd priv-django-dashboard-millenium-pro

Start the app in Docker

  1. $ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d

Visit http://localhost:5005 in your browser. The app should be up & running.


Gunicorn


Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for UNIX.

Install using pip

  1. $ pip install gunicorn

Start the app using gunicorn binary

  1. $ gunicorn --bind=0.0.0.0:8001 core.wsgi:application
  2. Serving on http://localhost:8001

Visit http://localhost:8001 in your browser. The app should be up & running.


Waitress


Waitress (Gunicorn equivalent for Windows) is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones that live in the Python standard library.

Install using pip

  1. $ pip install waitress

Start the app using waitress-serve

  1. $ waitress-serve --port=8001 core.wsgi:application
  2. Serving on http://localhost:8001

Visit http://localhost:8001 in your browser. The app should be up & running.




Django Millenium PRO - Provided by AppSeed Web App Generator.