├── .github ├── ISSUE_TEMPLATE │ ├── Features_request.md │ └── bug_report.md └── Pull_request_Template.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DWOC-logo.png ├── LICENSE.md ├── README.md ├── mysite ├── .env.example ├── Designs │ ├── Communitypage _Wireframe.PNG │ ├── HPUWPNG.PNG │ ├── IA for website │ │ └── IA_shraddhavp.png │ ├── Logo_RITIKSONI │ │ ├── 1 - Copy (2).svg │ │ ├── 1 - Copy.favicon │ │ ├── 1.png │ │ ├── Black-Texture - Copy (2).svg │ │ ├── Black-Texture - Copy.favicon │ │ ├── Black-Texture.png │ │ ├── image (25) - Copy.favicon │ │ ├── image (25) - Copy.png │ │ └── image (25) - Copy.svg │ ├── Wireframe_shraddhavp │ │ └── New Wireframe 1.png │ ├── logo._itsarjun12 │ │ ├── Bloglogo.png │ │ └── blogger_logo.png │ ├── logo_neha │ │ └── blogger_logo.png │ ├── logo_raksha009 │ │ ├── Blogger Logo.png │ │ ├── animated_logo.gif │ │ ├── blogger11.png │ │ └── logo2.png │ ├── logo_shraddhavp │ │ ├── Blogger logo.png │ │ └── Blogger logo1.png │ └── wireframes │ │ └── Community.png ├── Procfile ├── blog │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20200913_1800.py │ │ ├── 0003_post_tags.py │ │ ├── 0004_post_favourites.py │ │ ├── 0005_post_likes.py │ │ ├── 0006_tagdict.py │ │ └── __init__.py │ ├── models.py │ ├── static │ │ ├── blog │ │ │ ├── font-awesome.css │ │ │ ├── main.css │ │ │ ├── main.js │ │ │ ├── png_logo.png │ │ │ ├── post.css │ │ │ ├── tagsinput.css │ │ │ ├── tagsinput.js │ │ │ └── viewicon.png │ │ └── ckeditor │ │ │ └── ckeditor │ │ │ └── skins │ │ │ └── kama │ │ │ ├── dialog.css │ │ │ ├── dialog_ie.css │ │ │ ├── dialog_ie7.css │ │ │ ├── dialog_ie8.css │ │ │ ├── dialog_iequirks.css │ │ │ ├── editor.css │ │ │ ├── editor_ie.css │ │ │ ├── editor_ie7.css │ │ │ ├── editor_ie8.css │ │ │ ├── editor_iequirks.css │ │ │ ├── icons.png │ │ │ ├── icons_hidpi.png │ │ │ ├── images │ │ │ ├── dialog_sides.gif │ │ │ ├── dialog_sides.png │ │ │ ├── dialog_sides_rtl.png │ │ │ ├── mini.gif │ │ │ ├── spinner.gif │ │ │ ├── sprites.png │ │ │ ├── sprites_ie6.png │ │ │ └── toolbar_start.gif │ │ │ ├── readme.md │ │ │ └── skin.js │ ├── templates │ │ └── blog │ │ │ ├── 404.html │ │ │ ├── Footer.html │ │ │ ├── about.html │ │ │ ├── base.html │ │ │ ├── home.html │ │ │ ├── post_confirm_delete.html │ │ │ ├── post_create.html │ │ │ ├── post_detail.html │ │ │ └── post_form.html │ ├── tests │ │ ├── __init__.py │ │ ├── test_forms.py │ │ ├── test_models.py │ │ ├── test_urls.py │ │ └── test_views.py │ ├── urls.py │ ├── utils.py │ └── views.py ├── manage.py ├── media │ ├── admin │ │ └── default.jpg │ └── profile_pics │ │ ├── 1476068871520.jpg │ │ ├── 1476068871520_aOEkPtH.jpg │ │ ├── dp.png │ │ └── scene22.jpg ├── mysite │ ├── __init__.py │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── requirements.txt ├── runtime.txt ├── staticfiles │ ├── Wireframes │ │ ├── Community - Home (Yash).png │ │ └── Home.png │ ├── community(expanded)_ui_yash │ │ └── Community - Home UI.png │ ├── communitypage_ui_AdityaAshvin.JPG │ ├── dashboard ui_nooras │ │ ├── DashboardNew.png │ │ └── DashboardUIFinal.png │ ├── homepage ui_Akshi149 │ │ └── Homepage_UI.png │ └── img │ │ └── viewicon.png └── users │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── backends.py │ ├── forms.py │ ├── migrations │ ├── 0001_initial.py │ ├── 0002_profile_bio.py │ ├── 0003_auto_20200923_1908.py │ └── __init__.py │ ├── models.py │ ├── templates │ └── user │ │ ├── base.html │ │ ├── editProfile.html │ │ ├── favourites.html │ │ ├── login.html │ │ ├── message.html │ │ ├── password_reset.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_form.html │ │ ├── password_reset_sent.html │ │ ├── profile.html │ │ └── register.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── static ├── css │ ├── style_communitypage.css │ └── style_extendedpage.css ├── images │ ├── logo-transparent.png │ └── nwoc-logo.png └── imga │ ├── image 6.png │ ├── image 7.png │ ├── image 8.png │ ├── image.png │ ├── plus.png │ ├── png_logo.png │ └── search.png └── templates ├── Akshi_footer.html ├── Akshi_header.html ├── com_extended.html ├── communitypage.html ├── dashboard ├── .vscode │ └── settings.json ├── dash_footer.html ├── dash_header.html ├── dash_maincontent.html ├── script_dashboard.js └── style_dashboard.css ├── footer.html └── header.html /.github/ISSUE_TEMPLATE/Features_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/Pull_request_Template.md: -------------------------------------------------------------------------------- 1 | # Related Issue or bug 2 | - Info about Issue or bug 3 | 4 | Fixes: #[issue number that will be closed through this PR] 5 | 6 | # Proposed Changes 7 | - Info about changes Goes here 8 | 9 | # Additional Info 10 | - Anything related Issues 11 | 12 | # Screenshots 13 | 14 | Original | Updated 15 | :--------------------: |:--------------------: 16 | **original screenshot** | **updated screenshot **| 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at harshkumar9.in@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Blogger:man_technologist: 2 | 3 | ***Blogger is a basic blogging application which includes user to create account and post their views.*** 4 | 5 | --- 6 | ![GitHub custom open for collaboration](https://img.shields.io/badge/Open%20For-Collaboration-brightgreen?style=for-the-badge) 7 | 8 | 🎉***First off, thanks for taking the time out of your schedule and deciding to contribute here!*** 👍 9 | 10 | * This repository is open for all contributions, and is accepting contributions under under [DWOC (Devscript Winter of Code)](https://devscript.tech/) by [Devscript, India](https://devscript.tech/woc/). Any kind of updation, addition, modification and other valuable contributions are welcome. 11 | 12 | * In case you're new to open source and contributing, be sure to read about [GitHub](https://guides.github.com/activities/hello-world/#:~:text=GitHub%20is%20a%20code%20hosting,%2C%20commits%2C%20and%20Pull%20Requests.), [GitHub Guide](https://guides.github.com/), [GitHub Open Source](https://github.com/open-source), and you are encouraged to check [OpenSource Guide](http://opensource.guide/). 13 | 14 | * Please feel free to open new issues and pull requests, wherever needed. 15 | 16 | * Every contribution counts, and will go a long way towards betterment of the code and/or its related files. 17 | 18 | ## Assistance to get started:page_facing_up: 19 | 20 | If you're new to contributing and have no idea about working with repositories, be sure to check [GitHub docs to getting started](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github) from GitHub may also be helpful to refer. 21 | 22 | ## Essential Guidelines for contribution against Devscript Winter of Code::bookmark_tabs: 23 | 24 | Before you start off with the contribution, 25 | 26 | :bulb: Be sure to look into, and adhere to these points: 27 | 28 | * First comment on the opened issues on which you want to work as "Can I take up the work ?","I would like to work on this!",etc.:loudspeaker: 29 | 30 | 31 | * Wait for ***approval***. After it's assigned to you then move on further, fork the repository and clone it (if haven't yet done) and start your work according to the guidelines given in the [README.md](https://github.com/bhavesh1129/Blogger/blob/master/README.md) of repository. 32 | 33 | ## Steps to Contribute in GitHub Repository:pushpin: 34 | 35 | ***If you don't have git on your machine, [install it](https://help.github.com/articles/set-up-git/).*** 36 | 37 | ### 1. Fork this repository 🚀 38 | 39 | * Fork this repository by clicking on the fork button on the top of this page. 40 |

41 | 42 | 43 | 44 | * This will create a copy of this repository in your account. 45 | 46 | ### 2. Clone the repository 🏁 47 | 48 | * Now clone the forked repository to your machine. Go to your GitHub account, open the forked repository, click on the code button and then click the _copy to clipboard_ icon. 49 | 50 | * After cloning the repository, please read and understand what the existing code or document is meant for, before overwriting it with your changes. If you're unsure about any part, feel free to ask it in discussions, and we'd be happy to help. 51 |

52 | 53 | 54 | 55 | * Open a terminal and run the following git command: 56 | 57 | ``` 58 | git clone "https://github.com/bhavesh1129/Blogger.git" 59 | ``` 60 | 61 | ### 3. Navigate to the project directory.⚓ 62 | 63 | * Change to the repository directory on your computer (if you are not already there): 64 | 65 | ``` 66 | cd Blogger 67 | ``` 68 | 69 | ### 4. Add a reference to the original repository.:ledger: 70 | 71 | ``` 72 | git remote add upstream https://github.com/bhavesh1129-/Blogger.git (URL of the repository) 73 | ``` 74 | 75 | ### 5. See latest changes to the repository using following command::arrow_left: 76 | 77 | ``` 78 | git remote -v 79 | ``` 80 | 81 | ### 6. Now create a branch using::dna: 82 | 83 | ``` 84 | git checkout -b 85 | ``` 86 | 87 | ### 7. Take a pull from the upstream repository to your master branch to keep it at par with the main project.:arrow_up: 88 | 89 | ``` 90 | git pull upstream master 91 | ``` 92 | 93 | 94 | ### 8. Make necessary changes🚏 95 | 96 | * Do the necessary changes. 97 | 98 | * If you go to the project directory and execute the command `git status`, you'll see there are changes. 99 | 100 | * Add those changes to the branch you just created using the `git add` command: 101 | ``` 102 | git add . 103 | ``` 104 | 105 | ### 9. Now Commit those changes::fountain_pen: 106 | 107 | ``` 108 | git commit -m "(Add your message here)" 109 | ``` 110 | 111 | ### 10. Push changes to GitHub 🪂 112 | 113 | * Push your changes using the command `git push`: 114 | 115 | ``` 116 | git push origin 117 | ``` 118 | 119 | replacing `` with the name of the branch you created earlier. 120 | 121 | ### 11. Submit your changes for review 🚩 122 | 123 | * If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. 124 | 125 | * Now submit the pull request. 126 | 127 | * Soon we will be merging all your changes into the master branch of this project. You will get a notification email once the changes have been merged. 128 | 129 | 130 | ## More Contribution Guidelines :guard::page_with_curl: 131 | 132 | 1. Issues will be assigned on a first come first serve basis. 133 | 2. Maximum two active issues can be assigned to a single individual. 134 | 3. Mention the essential details, like programmming language you want to work in, while asking for issues. 135 | 4. Make a separate branch for each issue, and use appropriate branch names for the same. 136 | 5. Write clean and easy to understand code. Avoid copy pasting code, we're strictly against plagiarism! 137 | 6. Provide comments wherever necessary. 138 | 7. Add a README.md to the folders included, explaining the working of the script. 139 | 8. Add an appropriate screenshot of output or demo in the README. 140 | 9. Add a "requirements.txt" file that enlists the program requirements, in case dependencies are required. 141 | 10. Perform a self-review before submitting the PR and wait for the mentors to review it and merge. 142 | 143 | ### :ribbon: **Please go through the following essential steps for successfully submitting a Pull Request here:** :rocket: 144 | 145 | 1. Star :star: (Optional, will help you stay up-to-date about the later changes in the base repository) and Fork this repository. :checkered_flag: 146 | 147 | 2. Clone it :globe_with_meridians: using command `git clone ` in your CLI. This will download and save a folder for your existing repository, locally in your machine. 148 | 149 | 3. Switch to a branch using `git checkout -b `, in which you are required to work (usually it is 'main' or 'master', but for our cases, it'll be "dev_username". In place of username, mention your GitHub username). Remember, do not directly checkout from 'master' branch of your forked repository. 150 | 151 | 4. Check existing files, and make your desired updations. 152 | 153 | 5. Open a command prompt/terminal :man_technologist: in the same directory and enter `git add .` or `git add -A`. This adds all the files for tracking and will be including them in the next commit. 154 | 155 | 6. Commit your changes :memo: with `git commit -m ""`. In place of message, put a valuable and meaningful message so that it is easier for us to understand the changes you have done. This commits your changes locally. 156 | 157 | 7. Use `git pull -u` or `git pull --set-upstream origin ` (The `-u` or `--set-upstream` flag only needs to be used in the first time. For later use, `git pull` can be used without any additional flags). This pulls any further changes from the server and ensures that the local branch is again up-to-date with the remote server. 158 | 159 | 8. Push your changes :arrow_up: to remote server using `git push` or `git push origin `. This pushes your changes to the repository. 160 | 161 | After following these steps in Git CLI (in order), you'll need to go to your GitHub repository in the website to initiate a new Pull Request. Now create a pull request by comparing 'dev_username' branch of your forked repository with 'master' branch of this upstream repository. :confetti_ball: 162 | 163 | ***:trophy: After this, project leaders and mentors will review the changes and will merge your PR if they are found good, otherwise we will suggest the required changes.*** 164 | 165 | ## Style Guides for Git Commit Messages:memo: 166 | 167 | #### Here's a list of some good to have points, that can add more value to your contribution logs. 168 | 169 | - Use the present tense (example: "Add feature" and not "Added feature") 170 | - Use the imperative mood (example: "Move item to...", instead of "Moves item to...") 171 | - Limit the first line (also called subject line) to 50 characters or less 172 | - Capitalize the subject line 173 | - Separate subject from body with a blank line 174 | - Do not end the subject line with a period 175 | - Wrap the body at 72 characters 176 | - Use the body to explain what, why, vs, and how 177 | - Reference issues and pull requests liberally after the first line 178 | 179 | For more detailed reference to the above points, refer here: [https://chris.beams.io/posts/git-commit/]. 180 | 181 | 182 | ### So, what are you waiting for? Begin contributing now! :fire: :rocket: 183 | 184 | #### All the Best!🥇 185 | -------------------------------------------------------------------------------- /DWOC-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/DWOC-logo.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Harsh Kumar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Blogger

2 | 3 |
4 | 💥Blogger is a basic blogging application which includes user to create account and post their views. 5 |
6 | 7 |
8 | 9 | 10 |         11 | [![LinkedIn](https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555)](https://www.linkedin.com/in/harsh-kumar-1a287617a/) 12 | ![Python](https://img.shields.io/badge/python-v3.6+-blue.svg) 13 | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/harsh-9in/Blogger/issues) 14 | [![License](https://img.shields.io/github/license/harsh-9in/Blogger?style=flat-square)](https://github.com/harsh-9in/Blogger/) 15 | [![Forks](https://img.shields.io/github/forks/harsh-9in/Blogger.svg?logo=github)](https://github.com/harsh-9in/Blogger/network/members) 16 | [![Stargazers](https://img.shields.io/github/stars/harsh-9in/Blogger.svg?logo=github)](https://github.com/harsh-9in/Blogger/stargazers) 17 | [![Issues](https://img.shields.io/github/issues/harsh-9in/Blogger.svg?logo=github)](https://github.com/harsh-9in/Blogger/issues) 18 | [![Contributors](https://img.shields.io/github/contributors/harsh-9in/Blogger.svg?logo=github)](https://img.shields.io/github/contributors/harsh-9in/Blogger) 19 | 20 | 21 | 22 | ## Tech Stack💻 23 | 24 | - **Frontend:** HTML/CSS 25 | - **Backend:** Django 26 | 27 | ## Quick Start : 28 | 29 | - **Fork it** : 30 | 31 | Get your own Fork/Copy of repository by clicking `Fork` button right upper corner.

32 | 33 | - **Clone**: 34 | 35 | ```sh 36 | $ git clone https://github.com/harsh-9in/Blogger.git 37 | $ cd Blogger/mysite 38 | ``` 39 | 40 | - **Branching** 41 | 42 | ``` 43 | $ git checkout -b [your_branch_name] 44 | ``` 45 | 46 | - **Make Changes in Source Code** 47 | 48 | #### Setting up Project 49 | 50 | - Create a Virtual Environment 51 | 52 | ``` 53 | python3 -m venv env 54 | ``` 55 | 56 | - Activate the Virtual Environment 57 | 58 | - On Windows 59 | ``` 60 | env\Scripts\activate 61 | ``` 62 | - On Linux or MAC 63 | ``` 64 | source env/bin/activate 65 | ``` 66 | 67 | - Install dependencies using 68 | 69 | ``` 70 | pip install -r mysite/requirements.txt 71 | ``` 72 | 73 | 74 | - Setting up mandatory file 75 | ``` 76 | A .env.example file is present in the mysite folder you have to copy the content of .env.example and paste it into 77 | .env file (a file to be made in the same folder as .env.example file) so that settings.py file take all the 78 | configurations from .env file. 79 | ``` 80 | 81 | 82 | - Make migrations using 83 | 84 | ``` 85 | python manage.py makemigrations 86 | ``` 87 | 88 | - Migrate Database 89 | 90 | ``` 91 | python manage.py migrate 92 | ``` 93 | 94 | - Create a superuser 95 | 96 | ``` 97 | python manage.py createsuperuser 98 | ``` 99 | 100 | - Run server using 101 | 102 | ``` 103 | python manage.py runserver 104 | ``` 105 | 106 | - **Stage your Changes and Commit** 107 | 108 | ``` 109 | # For adding/Staging Changes 110 | 111 | $ git add . 112 | 113 | 114 | # For Commiting Changes 115 | 116 | $ git commit -m "" 117 | 118 | ``` 119 | 120 | - **Push your Commit to Repo** 121 | 122 | ``` 123 | $ git push origin 124 | ``` 125 | 126 | ## Project Structure 127 | 128 | /
129 | |- .github
130 | |- mysite : Project Directory
131 | |    |- blog : Application for the blogs
132 | |    |    |- migrations : Contains files that helps us to make the changes to the database schema as per the changes done in the models.
133 | |    |    |- static : All the static assets for the blog application
134 | |    |    |- templates : All the application specific templates
135 | |    |    |- \_\_init**.py
136 | |    |    |- admin.py : In this we register the models with the Django admin application
137 | |    |    |- apps.py : In this we register/configure all the common files for the app
138 | |    |    |- forms.py : Contains all the forms for the app
139 | |    |    |- models.py : Contains all the models for the app
140 | |    |    |- tests.py : Contains all the tests for the app
141 | |    |    |- urls.py : Contains all the urls which are specific for the app
142 | |    |    |- views.py : Contains all the views for the app
143 | |    |- media : The media files related to the blogs and users
144 | |    |- mysite : Python project package
145 | |    |    |- \_\_init**.py
146 | |    |    |- asgi.py : Entry point for the ASGI servers
147 | |    |    |- settings.py : All the configurations for your project
148 | |    |    |- urls.py : All the URLs for the Django project
149 | |    |    |- wsgi.py : Entry point for the WSGI servers
150 | |    |- staticfiles : To keep the static assets like images, CSS, JavaScript
151 | |    |- users : Application for users
152 | |    |    |- migrations : Contains files that helps us to make the changes to the database schema as per the changes done in the models.
153 | |    |    |- templates : All the application specific templates
154 | |    |    |- \_\_init\_\_.py
155 | |    |    |- admin.py : In this we register the models with the Django admin application
156 | |    |    |- apps.py : In this we register/configure all the common files for the app
157 | |    |    |- backends.py : Contains the backend specific authentication functions
158 | |    |    |- forms.py : Contains all the forms for the app
159 | |    |    |- models.py : Contains all the models for the app
160 | |    |    |- tests.py : Contains all the tests for the app
161 | |    |    |- views.py : Contains all the views for the app
162 | |    |- db.sqlite3 : Database file created when you run the migrate command
163 | |    |- manage.py : A command line utility
164 | |    |- Procfile : A file required for the Heroku Web applications to define the applications process types and entry points
165 | |    |- requirements.txt : Contains all the modules and libraries required for the project.
166 | |    |- runtime.txt : specify the Python runtime
167 | |- .gitignore : Contains all the files and folders which needs to be ignored while pushing the code to the Git
168 | |- [CODE_OF_CONDUCT.md](https://github.com/harsh-9in/Blogger/blob/master/CODE_OF_CONDUCT.md) : Code of Conduct to be followed
169 | |- [CONTRIBUTORS.md](https://github.com/harsh-9in/Blogger/blob/master/CONTRIBUTORS.md) : See the contributors of the project
170 | |- [LICENSE.md](https://github.com/harsh-9in/Blogger/blob/master/LICENSE.md) : See the License
171 | |- [README.md](https://github.com/harsh-9in/Blogger/blob/master/README.md) : Read all the instructions releated to the project
172 | 173 | ## Contribution Guidelines 174 | 175 | - Take a look at the guidelines to contribute to the project 176 | - [CONTRIBUTING GUIDELINES](https://github.com/harsh-9in/Blogger/blob/master/CONTRIBUTING.md) 177 | 178 | ## Geeks behind the initiative 179 | 180 | ### Project Admin 181 | 182 | **Harsh Kumar** -[Know more](https://github.com/harsh-9in) 183 | 184 | ### Project Mentors 185 | 186 | -**Kajol Kumari**-[Know More](https://github.com/Kajol-Kumari) -**Swarnima Shukla**-[Know More](https://github.com/Swarnimashukla) -**Sarath Kaul**-[Know More](https://github.com/SKAUL05) 187 | 188 | ## Open Source Programs 189 | 190 | - ### Contributor's Hack 2020 191 | Contributor's Hack 2020 is a program that helps students grow with ""OPEN SOURCE"". This initiative by **HakinCodes** provides you the best platform to improve your skills and abilities by contributing to vast variety of OPEN SOURCE Projects and opportunity to interact with the mentors and the Organizing Team. 192 | 193 |

194 | 195 | - ### NJACK Winter of Code 2020 196 | **NWoC** (NJACK Winter of Code) is a program by **NJACK** (The Official Computer Science Club of IIT Patna) that helps students understand the paradigm of Open Source contribution and gives them real world software development experience. 197 | 198 |

199 | 200 | - ### Devscript Winter of Code 2020 201 | **DWOC** is an open source initiative taken by Devscript to help students and learners be acquainted with the different aspects that entail open source contribution. It helps the mentees get a taste of problem solving in the real world. 202 | 203 |

204 | -------------------------------------------------------------------------------- /mysite/.env.example: -------------------------------------------------------------------------------- 1 | SECRET_KEY='145a4d44b3ad022aaadbdf12fb02d75d8611bd37d9931042' 2 | DEBUG=True 3 | 4 | EMAIL_HOST='Your email' 5 | EMAIL_HOST_PASSWORD='Password' -------------------------------------------------------------------------------- /mysite/Designs/Communitypage _Wireframe.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Communitypage _Wireframe.PNG -------------------------------------------------------------------------------- /mysite/Designs/HPUWPNG.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/HPUWPNG.PNG -------------------------------------------------------------------------------- /mysite/Designs/IA for website/IA_shraddhavp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/IA for website/IA_shraddhavp.png -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/1 - Copy (2).svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/1 - Copy (2).svg -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/1 - Copy.favicon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/1 - Copy.favicon -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/1.png -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/Black-Texture - Copy (2).svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/Black-Texture - Copy (2).svg -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/Black-Texture - Copy.favicon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/Black-Texture - Copy.favicon -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/Black-Texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/Black-Texture.png -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/image (25) - Copy.favicon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/image (25) - Copy.favicon -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/image (25) - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/image (25) - Copy.png -------------------------------------------------------------------------------- /mysite/Designs/Logo_RITIKSONI/image (25) - Copy.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Logo_RITIKSONI/image (25) - Copy.svg -------------------------------------------------------------------------------- /mysite/Designs/Wireframe_shraddhavp/New Wireframe 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/Wireframe_shraddhavp/New Wireframe 1.png -------------------------------------------------------------------------------- /mysite/Designs/logo._itsarjun12/Bloglogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo._itsarjun12/Bloglogo.png -------------------------------------------------------------------------------- /mysite/Designs/logo._itsarjun12/blogger_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo._itsarjun12/blogger_logo.png -------------------------------------------------------------------------------- /mysite/Designs/logo_neha/blogger_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_neha/blogger_logo.png -------------------------------------------------------------------------------- /mysite/Designs/logo_raksha009/Blogger Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_raksha009/Blogger Logo.png -------------------------------------------------------------------------------- /mysite/Designs/logo_raksha009/animated_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_raksha009/animated_logo.gif -------------------------------------------------------------------------------- /mysite/Designs/logo_raksha009/blogger11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_raksha009/blogger11.png -------------------------------------------------------------------------------- /mysite/Designs/logo_raksha009/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_raksha009/logo2.png -------------------------------------------------------------------------------- /mysite/Designs/logo_shraddhavp/Blogger logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_shraddhavp/Blogger logo.png -------------------------------------------------------------------------------- /mysite/Designs/logo_shraddhavp/Blogger logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/logo_shraddhavp/Blogger logo1.png -------------------------------------------------------------------------------- /mysite/Designs/wireframes/Community.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/Designs/wireframes/Community.png -------------------------------------------------------------------------------- /mysite/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn mysite.wsgi -------------------------------------------------------------------------------- /mysite/blog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/__init__.py -------------------------------------------------------------------------------- /mysite/blog/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import Post, TagDict 4 | 5 | # Register your models here. 6 | 7 | admin.site.register(Post) 8 | admin.site.register(TagDict) 9 | 10 | -------------------------------------------------------------------------------- /mysite/blog/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlogConfig(AppConfig): 5 | name = 'blog' 6 | 7 | 8 | -------------------------------------------------------------------------------- /mysite/blog/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Post 3 | 4 | class PostForm(forms.ModelForm): 5 | class Meta: 6 | model = Post 7 | fields = [ 8 | 'title', 9 | 'image', 10 | 'content', 11 | 'tags', 12 | ] 13 | def __init__(self, *args, **kwargs): 14 | super(PostForm, self).__init__(*args, **kwargs) 15 | self.fields['image'].required = False 16 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-09-11 10:02 2 | 3 | import ckeditor.fields 4 | from django.conf import settings 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | import django.utils.timezone 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | initial = True 13 | 14 | dependencies = [ 15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 16 | ] 17 | 18 | operations = [ 19 | migrations.CreateModel( 20 | name='Post', 21 | fields=[ 22 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 23 | ('title', models.CharField(max_length=100)), 24 | ('content', ckeditor.fields.RichTextField(blank=True, null=True)), 25 | ('date_posted', models.DateTimeField(default=django.utils.timezone.now)), 26 | ('image', models.ImageField(blank=True, upload_to='blog_images')), 27 | ('view_count', models.IntegerField(default=0)), 28 | ('slug', models.SlugField(blank=True, null=True)), 29 | ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 30 | ], 31 | options={ 32 | 'ordering': ['-date_posted'], 33 | }, 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0002_auto_20200913_1800.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-09-13 12:30 2 | 3 | import ckeditor_uploader.fields 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('blog', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='post', 16 | name='content', 17 | field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, null=True), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0003_post_tags.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-09-21 13:50 2 | 3 | from django.db import migrations 4 | import taggit.managers 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('taggit', '0003_taggeditem_add_unique_index'), 11 | ('blog', '0002_auto_20200913_1800'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='post', 17 | name='tags', 18 | field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0004_post_favourites.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-09-24 19:12 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 11 | ('blog', '0003_post_tags'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='post', 17 | name='favourites', 18 | field=models.ManyToManyField(blank=True, default=None, related_name='favourite', to=settings.AUTH_USER_MODEL), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0005_post_likes.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-12-06 14:04 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 11 | ('blog', '0004_post_favourites'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='post', 17 | name='likes', 18 | field=models.ManyToManyField(blank=True, related_name='post_likes', to=settings.AUTH_USER_MODEL), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/blog/migrations/0006_tagdict.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-12-11 09:38 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('blog', '0005_post_likes'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='TagDict', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('tag', models.CharField(max_length=100)), 18 | ('count', models.IntegerField(default=0)), 19 | ], 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /mysite/blog/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/migrations/__init__.py -------------------------------------------------------------------------------- /mysite/blog/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils import timezone 3 | from django.contrib.auth.models import User 4 | from django.urls import reverse 5 | from django.utils.text import slugify 6 | from .utils import get_read_time 7 | from ckeditor_uploader.fields import RichTextUploadingField 8 | from taggit.managers import TaggableManager 9 | 10 | # Create your models here. 11 | 12 | class TagDict(models.Model): 13 | tag = models.CharField(max_length=100) 14 | count = models.IntegerField(default=0) 15 | 16 | def __str__(self): 17 | return self.tag 18 | 19 | 20 | class Post(models.Model): 21 | title = models.CharField(max_length=100) 22 | content = RichTextUploadingField(blank=True, null=True) 23 | date_posted = models.DateTimeField(default=timezone.now) 24 | author = models.ForeignKey(User, on_delete=models.CASCADE) 25 | image = models.ImageField(upload_to="blog_images", height_field=None, width_field=None, max_length=None, blank=True) 26 | view_count = models.IntegerField(default=0) 27 | favourites = models.ManyToManyField(User, related_name='favourite', default=None, blank=True) 28 | slug = models.SlugField(blank=True, null=True) 29 | tags = TaggableManager() 30 | likes = models.ManyToManyField(User, blank=True, related_name='post_likes') 31 | 32 | 33 | def save(self, *args, **kwargs): 34 | if not self.slug: 35 | self.slug = slugify(self.title) 36 | super(Post, self).save(*args, **kwargs) 37 | 38 | for tag in self.tags.all(): 39 | tag_dict,_ = TagDict.objects.get_or_create(tag=str(tag)) 40 | tag_dict.count += 1 41 | tag_dict.save() 42 | 43 | def __str__(self): 44 | return self.title 45 | 46 | def get_absolute_url(self): 47 | return reverse('post-detail', kwargs={'pk': self.pk}) 48 | 49 | 50 | class Meta: 51 | ordering = ["-date_posted"] 52 | 53 | def readTIme(self): 54 | Read_Time=get_read_time(self.content) 55 | Read_Time = Read_Time[2:-3] 56 | return Read_Time 57 | 58 | def get_url(self): 59 | return reverse('post-detail', kwargs={'slug': self.slug}) 60 | 61 | def get_like_url(self): 62 | return reverse('like-toggle', kwargs={"slug":self.slug}) 63 | 64 | def get_api_like_url(self): 65 | return reverse('like-api-toggle', kwargs={"slug":self.slug}) 66 | -------------------------------------------------------------------------------- /mysite/blog/static/blog/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fafafa; 3 | color: #333333; 4 | margin-top: 5rem; 5 | } 6 | 7 | h2, 8 | h3, 9 | h4, 10 | h6 { 11 | color: #444444; 12 | } 13 | 14 | ul { 15 | margin: 0; 16 | } 17 | 18 | .bg-steel { 19 | background-color: #5f788a; 20 | } 21 | 22 | .site-header .navbar-nav .nav-link { 23 | color: black; 24 | } 25 | 26 | .site-header .navbar-nav .nav-link:hover { 27 | color: #ffffff; 28 | } 29 | 30 | .site-header .navbar-nav .nav-link.active { 31 | font-weight: 500; 32 | } 33 | 34 | .content-section { 35 | background: #ffffff; 36 | padding: 10px 20px; 37 | border-radius: 3px; 38 | margin-bottom: 20px; 39 | } 40 | 41 | .article-title { 42 | color: #444444; 43 | } 44 | 45 | a.article-title:hover { 46 | color: #428bca; 47 | text-decoration: none; 48 | } 49 | 50 | .article-content { 51 | white-space: pre-line; 52 | } 53 | 54 | .article-img { 55 | height: 65px; 56 | width: 65px; 57 | margin-right: 16px; 58 | } 59 | 60 | .article-metadata { 61 | padding-bottom: 1px; 62 | margin-bottom: 4px; 63 | border-bottom: 1px solid #e3e3e3; 64 | } 65 | 66 | .article-metadata a:hover { 67 | color: #333; 68 | text-decoration: none; 69 | } 70 | 71 | .article-svg { 72 | width: 25px; 73 | height: 25px; 74 | vertical-align: middle; 75 | } 76 | 77 | .account-img { 78 | height: 125px; 79 | width: 125px; 80 | margin-bottom: 16px; 81 | } 82 | 83 | .account-heading { 84 | font-size: 2.5rem; 85 | } 86 | 87 | /*Slider CSS starts from here */ 88 | @import url("https://fonts.googleapis.com/css?family=Audiowide|Monoton|Poiret+One|Raleway"); 89 | 90 | h1 { 91 | display: block; 92 | font-size: 3em; 93 | margin-block-start: 0.67em; 94 | margin-block-end: 0.67em; 95 | margin-inline-start: 0px; 96 | margin-inline-end: 0px; 97 | font-weight: bold; 98 | color: #555555; 99 | } 100 | 101 | h5 { 102 | color: #ffffff; 103 | font-size: 2em; 104 | margin-top: 1px; 105 | font-style: italic; 106 | } 107 | 108 | label { 109 | cursor: pointer; 110 | } 111 | 112 | .site-footer { 113 | background-color: #c4c4c4; 114 | color: black; 115 | } 116 | 117 | .footer-links { 118 | display: flex; 119 | flex-direction: row; 120 | justify-content: center; 121 | } 122 | 123 | .links { 124 | padding: 10px; 125 | } 126 | 127 | .contact { 128 | display: flex; 129 | flex-direction: row; 130 | justify-content: center; 131 | } 132 | 133 | .slider { 134 | height: 37vh; 135 | overflow: hidden; 136 | text-align: center; 137 | background-color: #47d7ed; 138 | border-radius: 5px; 139 | } 140 | .slider > ul { 141 | height: 100%; 142 | z-index: 100; 143 | } 144 | .slider > ul > li { 145 | height: 100%; 146 | position: absolute; 147 | left: 0; 148 | top: 0; 149 | opacity: 0; 150 | z-index: 1; 151 | transition: all 2000ms ease; 152 | } 153 | .slider > #input-slide-0:checked ~ ul > li.slide-0, 154 | .slider > #input-slide-1:checked ~ ul > li.slide-1, 155 | .slider > #input-slide-2:checked ~ ul > li.slide-2, 156 | .slider > #input-slide-3:checked ~ ul > li.slide-3 { 157 | opacity: 1; 158 | z-index: 2; 159 | } 160 | .slider > ul > li.slide-0 { 161 | background-color: #47d7ed; 162 | } 163 | .slider > ul > li.slide-1 { 164 | background-color: #47d7ed; 165 | } 166 | .slider > ul > li.slide-2 { 167 | background-color: #47d7ed; 168 | } 169 | .slider > ul > li.slide-3 { 170 | background-color: #47d7ed; 171 | } 172 | .slider > .slider-dot { 173 | position: relative; 174 | margin-top: -3vw; 175 | text-align: center; 176 | z-index: 300; 177 | font-size: 0; 178 | } 179 | .slider > .slider-dot > label { 180 | position: relative; 181 | display: inline-block; 182 | margin: 1vw 0.5vw; 183 | width: 1vw; 184 | height: 1vw; 185 | border-radius: 50%; 186 | 187 | background-color: #fff; 188 | } 189 | .slider > #input-slide-0:checked ~ .slider-dot > label.slide-0, 190 | .slider > #input-slide-1:checked ~ .slider-dot > label.slide-1, 191 | .slider > #input-slide-2:checked ~ .slider-dot > label.slide-2, 192 | .slider > #input-slide-3:checked ~ .slider-dot > label.slide-3 { 193 | background-color: black; 194 | } 195 | .slider > .slider-dot > label:hover { 196 | background-color: #f73c3f !important; 197 | } 198 | .slider > .slide-description { 199 | position: absolute; 200 | width: 50%; 201 | top: calc(16% - 3vw); 202 | left: 25%; 203 | z-index: 200; 204 | } 205 | 206 | .slider > .slide-description > label { 207 | position: absolute; 208 | width: 100%; 209 | top: 0; 210 | left: 0; 211 | cursor: default; 212 | 213 | z-index: 0; 214 | opacity: 0; 215 | visibility: hidden; 216 | transition: all 0.75s ease; 217 | } 218 | .slider > #input-slide-0:checked ~ .slide-description > .slide-0, 219 | .slider > #input-slide-1:checked ~ .slide-description > .slide-1, 220 | .slider > #input-slide-2:checked ~ .slide-description > .slide-2, 221 | .slider > #input-slide-3:checked ~ .slide-description > .slide-3 { 222 | z-index: 2; 223 | opacity: 1; 224 | visibility: visible; 225 | } 226 | .slider > .slide-description > label > .text-slide { 227 | margin: 0 auto; 228 | line-height: 6vw; 229 | top: 0px; 230 | } 231 | 232 | @keyframes slide { 233 | 0%, 234 | 100% { 235 | opacity: 0; 236 | } 237 | 6%, 238 | 25% { 239 | opacity: 1; 240 | z-index: 2; 241 | } 242 | 30%, 243 | 50% { 244 | opacity: 0; 245 | z-index: 2; 246 | } 247 | } 248 | .slider > #input-slide-autoplay:checked ~ ul > li.slide-0 { 249 | animation: slide 32000ms infinite -2000ms linear; 250 | } 251 | .slider > #input-slide-autoplay:checked ~ ul > li.slide-1 { 252 | animation: slide 32000ms infinite 6000ms linear; 253 | } 254 | .slider > #input-slide-autoplay:checked ~ ul > li.slide-2 { 255 | animation: slide 32000ms infinite 14000ms linear; 256 | } 257 | .slider > #input-slide-autoplay:checked ~ ul > li.slide-3 { 258 | animation: slide 32000ms infinite 22000ms linear; 259 | } 260 | .slider > #input-slide-autoplay:checked ~ ul > li { 261 | transition: none; 262 | } 263 | 264 | @keyframes arrow { 265 | 0%, 266 | 24% { 267 | z-index: 1; 268 | } 269 | 25%, 270 | 100% { 271 | z-index: -1; 272 | } 273 | } 274 | 275 | @keyframes dot { 276 | 0%, 277 | 24% { 278 | background-color: #333; 279 | } 280 | 25%, 281 | 100% { 282 | background: #fff; 283 | } 284 | } 285 | .slider > #input-slide-autoplay:checked ~ .slider-dot > label.slide-0 { 286 | animation: dot 32000ms infinite -2000ms; 287 | } 288 | .slider > #input-slide-autoplay:checked ~ .slider-dot > label.slide-1 { 289 | animation: dot 32000ms infinite 6000ms; 290 | } 291 | .slider > #input-slide-autoplay:checked ~ .slider-dot > label.slide-2 { 292 | animation: dot 32000ms infinite 14000ms; 293 | } 294 | .slider > #input-slide-autoplay:checked ~ .slider-dot > label.slide-3 { 295 | animation: dot 32000ms infinite 22000ms; 296 | } 297 | 298 | @keyframes description { 299 | 0%, 300 | 5% { 301 | opacity: 0; 302 | z-index: 2; 303 | visibility: visible; 304 | } 305 | 6%, 306 | 24% { 307 | opacity: 1; 308 | z-index: 2; 309 | visibility: visible; 310 | } 311 | 25%, 312 | 100% { 313 | opacity: 0; 314 | z-index: 0; 315 | visibility: hidden; 316 | } 317 | } 318 | .slider > #input-slide-autoplay:checked ~ .slide-description > .slide-0 { 319 | animation: description 32000ms infinite -2000ms ease; 320 | } 321 | .slider > #input-slide-autoplay:checked ~ .slide-description > .slide-1 { 322 | animation: description 32000ms infinite 6000ms ease; 323 | } 324 | .slider > #input-slide-autoplay:checked ~ .slide-description > .slide-2 { 325 | animation: description 32000ms infinite 14000ms ease; 326 | } 327 | .slider > #input-slide-autoplay:checked ~ .slide-description > .slide-3 { 328 | animation: description 32000ms infinite 22000ms ease; 329 | } 330 | .slider > #input-slide-autoplay:checked ~ .slide-description > label { 331 | transition: none; 332 | } 333 | 334 | .readmorebutton { 335 | text-decoration: none !important; 336 | padding: 4px; 337 | color: #fff; 338 | background-color: #c10e0e; 339 | display: inline-block; 340 | margin: 4px 0; 341 | border-radius: 3px; 342 | font-weight: bold; 343 | } 344 | .readmorebutton:hover { 345 | color:rgb(149, 255, 0); 346 | } 347 | ul, 348 | li { 349 | list-style: none; 350 | } 351 | @media screen and (max-width: 600px) { 352 | .slider { 353 | height: 100vh; 354 | font-size: 1em; 355 | } 356 | h5 { 357 | font-size: 1em; 358 | } 359 | h1 { 360 | font-size: 2em; 361 | } 362 | } 363 | *:focus { 364 | outline: none; 365 | } 366 | .notification{ 367 | position: relative; 368 | left: 10px; 369 | bottom: 10px; 370 | } 371 | .readtime { 372 | float: right; 373 | color: violet; 374 | } 375 | .viewcount { 376 | float: right; 377 | } 378 | -------------------------------------------------------------------------------- /mysite/blog/static/blog/main.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('.toast').toast('show'); 3 | }); 4 | -------------------------------------------------------------------------------- /mysite/blog/static/blog/png_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/blog/png_logo.png -------------------------------------------------------------------------------- /mysite/blog/static/blog/post.css: -------------------------------------------------------------------------------- 1 | body { 2 | background : #f4f4f2; 3 | color: #333333; 4 | margin-top: 5rem; 5 | } 6 | 7 | h2, 8 | h3, 9 | h4, 10 | h6 { 11 | color: #444444; 12 | } 13 | 14 | ul { 15 | margin: 0; 16 | } 17 | 18 | .bg-steel { 19 | background-color: #5c5b56; 20 | } 21 | 22 | 23 | .site-header .navbar-nav .nav-link { 24 | color: #f4f4f2; 25 | display:inline-block; 26 | } 27 | .site-header .navbar-nav .nav-link:hover { 28 | color: #ea584f; 29 | } 30 | 31 | .site-header .navbar-nav .nav-link.active { 32 | font-weight: 500; 33 | } 34 | 35 | #post_id{ 36 | color:#ea584f; 37 | font-family:Oswald; 38 | border-bottom:1px solid rgb(180, 176, 176); 39 | } 40 | #id_title{ 41 | font-family:roboto; 42 | font-size:22px; 43 | text-align: center; 44 | border:none; 45 | } 46 | #label{ 47 | font-style: italic; 48 | } 49 | button[type="submit"]{ 50 | background-color:transparent; 51 | width:60%; 52 | font-size:18px; 53 | height:37px; 54 | border-color:#ea584f; 55 | border-radius: 7px; 56 | font-family:Oswald; 57 | margin-left:200px 58 | } 59 | button[type="submit"]:hover{ 60 | background-color:#ea584f; 61 | color:#f4f4f2; 62 | } 63 | 64 | .jumbotron { 65 | margin-top: 10px; 66 | background-color: #eae4dc; 67 | } 68 | 69 | footer{ 70 | background-color: #5c5b56; 71 | text-decoration-color:#f4f4f2; 72 | } 73 | .links{ 74 | color: #f4f4f2; 75 | display:inline-block; 76 | } 77 | .links:hover{ 78 | color: #ffffff; 79 | } 80 | 81 | strong{ 82 | margin-left: 10px; 83 | } 84 | 85 | #navbtn1{ 86 | border-color:#E85A4F; 87 | margin-left:450px; 88 | border-radius: 5px; 89 | size:35px ; 90 | padding: 4px 70px; 91 | transition-duration: 0.3s; 92 | } 93 | #navbtn2{ 94 | border-color:#E85A4F; 95 | border-radius: 20px; 96 | font-size:15px ; 97 | padding: 2px 20px 98 | } 99 | #navbtn3{ 100 | border-color:#E85A4F; 101 | transition-duration: 0.3s; 102 | padding: 8 80 ; 103 | } 104 | #navbtn4{ 105 | margin-left: 20px ; 106 | border-color:#E85A4F; 107 | transition-duration: 0.3s; 108 | padding: 8 80 ; 109 | } 110 | #navbtn5{ 111 | margin-left:50px; 112 | padding: 8 80 ; 113 | border-color:#E85A4F; 114 | transition-duration: 0.3s; 115 | 116 | } 117 | #navbtn5:hover{ 118 | background-color:#e85a4f; 119 | color:#f4f4f2; 120 | } 121 | #navbtn3:hover{ 122 | background-color:#e85a4f; 123 | color:#f4f4f2; 124 | } 125 | #navbtn4:hover{ 126 | background-color:#e85a4f; 127 | color:#f4f4f2; 128 | } 129 | #navbtn1:hover{ 130 | background-color:#e85a4f; 131 | color:#f4f4f2; 132 | } 133 | #navbtn1:active,#navbtn5:active,#navbtn3:active,#navbtn4:active{ 134 | background-color:#e85a4f; 135 | } 136 | -------------------------------------------------------------------------------- /mysite/blog/static/blog/tagsinput.css: -------------------------------------------------------------------------------- 1 | /*For tagsimput*/ 2 | 3 | /* 4 | * bootstrap-tagsinput v0.8.0 5 | * 6 | */ 7 | 8 | .bootstrap-tagsinput { 9 | border: solid 1px #7bff00; 10 | border-radius: 0; 11 | color: #ff0000; 12 | -webkit-box-shadow: none; 13 | -moz-box-shadow: none; 14 | box-shadow: none; 15 | height: 40px; 16 | padding: 4px 67px; 17 | font-size: 16px; 18 | } 19 | .bootstrap-tagsinput input { 20 | border: none; 21 | border-radius: 0; 22 | color: #8e9091; 23 | -webkit-box-shadow: none; 24 | -moz-box-shadow: none; 25 | box-shadow: none; 26 | } 27 | .badge-tag { 28 | background-color: #73e4f6; 29 | color: white; 30 | } 31 | .bootstrap-tagsinput.form-control input::-moz-placeholder { 32 | color: #777; 33 | opacity: 1; 34 | } 35 | .bootstrap-tagsinput.form-control input:-ms-input-placeholder { 36 | color: #777; 37 | } 38 | .bootstrap-tagsinput.form-control input::-webkit-input-placeholder { 39 | color: #777; 40 | } 41 | .bootstrap-tagsinput input:focus { 42 | border: none; 43 | box-shadow: none; 44 | } 45 | .bootstrap-tagsinput .badge { 46 | margin-left: 4px; 47 | padding: 8px; 48 | } 49 | .bootstrap-tagsinput .badge [data-role="remove"] { 50 | margin-left: 8px; 51 | cursor: pointer; 52 | } 53 | .bootstrap-tagsinput .badge [data-role="remove"]:after { 54 | content: "×"; 55 | padding: 0px 4px; 56 | background-color: rgba(0, 0, 0, 0.1); 57 | border-radius: 50%; 58 | font-size: 13px; 59 | } 60 | .bootstrap-tagsinput .badge [data-role="remove"]:hover:after { 61 | background-color: rgba(0, 0, 0, 0.62); 62 | } 63 | .bootstrap-tagsinput .badge [data-role="remove"]:hover:active { 64 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); 65 | } 66 | -------------------------------------------------------------------------------- /mysite/blog/static/blog/viewicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/blog/viewicon.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/icons.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/icons_hidpi.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides.gif -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/dialog_sides_rtl.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/mini.gif -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/spinner.gif -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/sprites.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/sprites_ie6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/sprites_ie6.png -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/images/toolbar_start.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/static/ckeditor/ckeditor/skins/kama/images/toolbar_start.gif -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/readme.md: -------------------------------------------------------------------------------- 1 | "Kama" Skin 2 | ==================== 3 | 4 | "Kama" is the default skin of CKEditor 3.x. 5 | It's been ported to CKEditor 4 and fully featured. 6 | 7 | For more information about skins, please check the [CKEditor Skin SDK](https://ckeditor.com/docs/ckeditor4/latest/guide/skin_sdk_intro.html) 8 | documentation. 9 | 10 | Directory Structure 11 | ------------------- 12 | 13 | CSS parts: 14 | - **editor.css**: the main CSS file. It's simply loading several other files, for easier maintenance, 15 | - **mainui.css**: the file contains styles of entire editor outline structures, 16 | - **toolbar.css**: the file contains styles of the editor toolbar space (top), 17 | - **richcombo.css**: the file contains styles of the rich combo ui elements on toolbar, 18 | - **panel.css**: the file contains styles of the rich combo drop-down, it's not loaded 19 | until the first panel open up, 20 | - **elementspath.css**: the file contains styles of the editor elements path bar (bottom), 21 | - **menu.css**: the file contains styles of all editor menus including context menu and button drop-down, 22 | it's not loaded until the first menu open up, 23 | - **dialog.css**: the CSS files for the dialog UI, it's not loaded until the first dialog open, 24 | - **reset.css**: the file defines the basis of style resets among all editor UI spaces, 25 | - **preset.css**: the file defines the default styles of some UI elements reflecting the skin preference, 26 | - **editor_XYZ.css** and **dialog_XYZ.css**: browser specific CSS hacks. 27 | 28 | Other parts: 29 | - **skin.js**: the only JavaScript part of the skin that registers the skin, its browser specific files and its icons and defines the Chameleon feature, 30 | - **icons/**: contains all skin defined icons, 31 | - **images/**: contains a fill general used images. 32 | 33 | License 34 | ------- 35 | 36 | Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. 37 | 38 | For licensing, see LICENSE.md or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license) 39 | -------------------------------------------------------------------------------- /mysite/blog/static/ckeditor/ckeditor/skins/kama/skin.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | CKEDITOR.skin.name = "kama"; 6 | CKEDITOR.skin.ua_editor = "ie,iequirks,ie7,ie8"; 7 | CKEDITOR.skin.ua_dialog = "ie,iequirks,ie7,ie8"; 8 | CKEDITOR.skin.chameleon = function (d, c) { 9 | var b, 10 | a = "." + d.id; 11 | "editor" == c 12 | ? (b = 13 | a + 14 | " .cke_inner," + 15 | a + 16 | " .cke_dialog_tab{background-color:$color;linear-gradient( to bottom,#fff -15px,$color 40px );}" + 17 | a + 18 | " .cke_toolgroup{linear-gradient( to bottom,#fff,$color 100px );}" + 19 | a + 20 | " .cke_combo_button{linear-gradient( to top,#fff,$color 100px );}" + 21 | a + 22 | " .cke_dialog_contents," + 23 | a + 24 | " .cke_dialog_footer{background-color:$color !important;}" + 25 | a + 26 | " .cke_dialog_tab:hover," + 27 | a + 28 | " .cke_dialog_tab:active," + 29 | a + 30 | " .cke_dialog_tab:focus," + 31 | a + 32 | " .cke_dialog_tab_selected{background-color:$color;background-image:none;}") 33 | : "panel" == c && 34 | (b = 35 | ".cke_menubutton_icon{background-color:$color !important;border-color:$color !important;}.cke_menubutton:hover .cke_menubutton_icon,.cke_menubutton:focus .cke_menubutton_icon,.cke_menubutton:active .cke_menubutton_icon{background-color:$color !important;border-color:$color !important;}.cke_menubutton:hover .cke_menubutton_label,.cke_menubutton:focus .cke_menubutton_label,.cke_menubutton:active .cke_menubutton_label{background-color:$color !important;}.cke_menubutton_disabled:hover .cke_menubutton_label,.cke_menubutton_disabled:focus .cke_menubutton_label,.cke_menubutton_disabled:active .cke_menubutton_label{background-color: transparent !important;}.cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon{background-color:$color !important;border-color:$color !important;}.cke_menubutton_disabled .cke_menubutton_icon{background-color:$color !important;border-color:$color !important;}.cke_menuseparator{background-color:$color !important;}.cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active{background-color:$color !important;}"); 36 | return b; 37 | }; 38 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 6 | 48 | 49 | 50 |
51 |

Oops! We couldn't find what you were looking for.

52 |

Unfortunately the page you were looking for could not be found. It may be temporarily unavailable, moved or no longer exist.

53 |

404

54 |

Check the URL you have entered for any mistakes and try again.

55 | Go back home 56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/Footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | Subscribe to the newsletter to get the latest blog post links 7 |
8 | 9 | 10 |
11 |
12 |
13 | 14 | 15 |
Blogger
16 |
A blogging site
17 |
18 | 19 | 26 |
27 |

contact number+91 1234567890 28 | contact numbersupport@example.com 29 | contact numberxyz street

30 |
31 | 37 |
-------------------------------------------------------------------------------- /mysite/blog/templates/blog/about.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html' %} 2 | 3 | {% block content %} 4 | 5 |

About Page

6 | {% endblock%} -------------------------------------------------------------------------------- /mysite/blog/templates/blog/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 73 | 74 | 75 |
76 | 77 | {% block slider%} 78 | 79 | {% endblock %} 80 | 81 | 82 | {% include 'user/message.html' %} 83 | 84 |
85 |
86 | {% block content %} 87 | {% endblock %} 88 |
89 |
90 |
91 |

Filter By

92 |
93 |
94 | 95 | 96 |
97 |
98 | 99 | 100 |
101 |
102 | 103 | 104 |
105 |
106 | 107 | 108 |
109 |
110 | 115 |
116 | 117 |
118 |
119 | 120 | 121 | 122 | {% comment %} {% endcomment %} 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html' %} 2 | 3 | {% load static %} 4 | 5 | {% block slider%} 6 | 7 |
8 | 10 | 12 | 14 | 16 | 18 |
    19 |
  • 20 |
  • 21 |
  • 22 |
  • 23 |
24 | 25 |
26 | 31 | 36 | 41 | 46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 |
54 |
55 | {% endblock %} 56 | {% block content %} 57 |

Recent Posts

58 |
59 | 60 | 61 | {% for post in posts %} 62 |
63 |
64 |

{{ post.title }}

65 | 79 |

{{ post.content|truncatechars:200|safe }}

80 |
81 | 82 | 83 | 84 |
85 |
86 | {% endfor %} 87 | 88 | 121 | 122 | 123 | 124 | 125 | 146 | 147 | {% endblock%} 148 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/post_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends "blog/base.html" %} 2 | {% block content %} 3 |
4 |
5 | {% csrf_token %} 6 |
7 | Delete Post 8 |

Are you sure you want to delete the post "{{ object.title }}"

9 |
10 |
11 | 12 | Cancel 13 |
14 |
15 |
16 | {% endblock content %} -------------------------------------------------------------------------------- /mysite/blog/templates/blog/post_create.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 69 | 70 | 71 |
72 |
73 |
74 |
75 |

Create Post...

76 |

77 |
78 |
79 | {% csrf_token %} 80 |
81 |
82 | 83 |
84 |
85 | 86 |
87 |
88 | 89 | 90 |
91 |
92 | 93 |
94 | 95 |
96 | {{form.media}} 97 | {{form.content}} 98 |
99 |
100 | 101 |
102 | 103 |
104 | 105 |
106 |
107 | 108 | 109 |
110 |
111 |
112 |
113 |
114 |
115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/post_detail.html: -------------------------------------------------------------------------------- 1 | {% extends "blog/base.html" %} 2 | {% block content %} 3 |
4 | 5 | 6 | {% if object.author.profile.image.url %} 7 | 8 | {%else%} 9 | 10 | {% endif%} 11 | 12 | 13 |
14 | 73 | {% if object.image.url != '' %} 74 | Unable to load the Image 75 |
76 |

{{ object.title }}

77 |

{{ object.content|safe }}

78 | {% else %} 79 |

{{ object.title }}

80 |

{{ object.content|safe }}

81 | {% endif %} 82 |
83 |
84 | {% endblock content %} 85 | -------------------------------------------------------------------------------- /mysite/blog/templates/blog/post_form.html: -------------------------------------------------------------------------------- 1 | {% extends "blog/base.html" %} 2 | {% load crispy_forms_tags %} 3 | {% block content %} 4 |
5 |
6 | {% csrf_token %} 7 |
8 | Blog Post 9 | {{ form.media }} 10 | {{ form|crispy }} 11 |
12 |
13 | 14 |
15 |
16 |
17 | {% endblock content %} -------------------------------------------------------------------------------- /mysite/blog/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/blog/tests/__init__.py -------------------------------------------------------------------------------- /mysite/blog/tests/test_forms.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from blog.models import Post 3 | from blog.tests.test_views import TestViews 4 | from blog.forms import PostForm 5 | 6 | 7 | # Code for Testing attributes of forms.py 8 | class FormsTest(TestCase): 9 | def test_form(self): 10 | from_data={ 11 | 'title': 'my-name', 12 | 'content': 'here i am', 13 | 'tags': 'good' 14 | } 15 | form1=PostForm(from_data) 16 | self.assertTrue(form1.is_valid()) -------------------------------------------------------------------------------- /mysite/blog/tests/test_models.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from blog.models import Post,TagDict 3 | from django.urls import reverse,resolve 4 | from django.template.defaultfilters import slugify 5 | 6 | 7 | class ModelsTestCase(TestCase): 8 | 9 | # Unit test for __str__ function of Post 10 | def test_string_representation(self): 11 | entry = Post(title="this new title") 12 | self.assertEqual(str(entry), entry.title) 13 | 14 | # Unit test for __str__ function of TagDict 15 | def test_Tag(self): 16 | data=TagDict(tag='good') 17 | self.assertEqual(str(data),data.tag) 18 | 19 | # def test_post_has_slug(self): 20 | # post = Post.objects.create(title="My first post") 21 | # post.content = 'This is only for testing purpose blog', 22 | # post.author = User.objects.get(email='a@c.in'), 23 | #post.view_count = 0 24 | #post.save() 25 | #self.assertEqual(post.slug, slugify(post.title)) -------------------------------------------------------------------------------- /mysite/blog/tests/test_urls.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from django.urls import reverse, resolve 3 | from blog.models import Post 4 | import blog.views 5 | from blog.tests.test_views import TestViews 6 | 7 | # unit tests for functions in urls.py 8 | class TestUrls(TestCase): 9 | 10 | # Code for testing home url 11 | def test_home(self): 12 | url=reverse('blog-home') 13 | self.assertEquals(url,'/') 14 | 15 | # Code for testing about url 16 | def test_about(self): 17 | url=reverse('blog-about') 18 | self.assertEquals(url,'/about/') 19 | 20 | # Code for testing getBlogs url 21 | def test_getblogs(self): 22 | url=reverse('getBlogs') 23 | self.assertEquals(url,'/ajax/getBlogs') 24 | 25 | # Code for testing post create url 26 | def test_post_create(self): 27 | url=reverse('post_create') 28 | self.assertEquals(url,'/post_create/') 29 | 30 | # Code for testing post detail url 31 | def test_blogdetail(self): 32 | url=reverse('post-detail',args=['testblog1']) 33 | self.assertEquals(url,'/post/testblog1/') 34 | 35 | # Code for testing like toggle url 36 | def test_blogpost_like(self): 37 | url=reverse('like-toggle',args=['testblog1']) 38 | self.assertEquals(url,'/post/like/testblog1/') 39 | 40 | # Code for testing api of like toggle url 41 | def test_apipost_like(self): 42 | url=reverse('like-api-toggle',args=['testblog1']) 43 | self.assertEquals(url,'/api/like/testblog1/') 44 | 45 | # Code for testing post delete url 46 | def test_postdelete(self): 47 | url=reverse('post-delete',args=[1]) 48 | self.assertEquals(url,'/post/1/delete/') 49 | 50 | # Code for testing profile view url 51 | def test_Profileview(self): 52 | url=reverse('blog-profile',args=['testuser']) 53 | self.assertEquals(url,'/profileview/testuser') 54 | 55 | # Code for testing post update url 56 | def test_postupdate(self): 57 | url=reverse('post-update',args=[1]) 58 | self.assertEquals(url,'/post/1/update/') -------------------------------------------------------------------------------- /mysite/blog/tests/test_views.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase, Client, override_settings 2 | from django.urls import reverse 3 | from blog.models import Post 4 | from users.models import Profile 5 | from django.contrib.auth.models import User 6 | 7 | @override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFilesStorage') 8 | class TestViews(TestCase): 9 | 10 | def setUp(self): 11 | self.u=User.objects.create_superuser(username="testuser",email="a@c.in",password="secret") # Create an User instance for performing the tests 12 | self.client = Client() 13 | 14 | # URL's of different view 15 | self.about_url = reverse('blog-about') 16 | self.viewcount_url = reverse('getBlogs') 17 | self.detailview_url = reverse('post-detail', args=['testblog1']) 18 | self.homeview_url = reverse('blog-home') 19 | self.profileview_url = reverse('blog-profile', args=[self.u.username]) 20 | self.updateview_url = reverse('post-update', args=[1]) 21 | self.postcreate_url = reverse('post_create') 22 | 23 | # Creating instances of the Model 24 | self.testblog1 = Post.objects.create( 25 | title = 'testblog1', 26 | content = 'This is only for testing purpose blog', 27 | author = User.objects.get(email='a@c.in'), 28 | view_count = 0, 29 | ) 30 | self.testblog2 = Post.objects.create( 31 | title = 'testblog2', 32 | content = 'This is only for testing purpose blog', 33 | author = User.objects.get(email='a@c.in'), 34 | view_count = 0, 35 | ) 36 | self.testblog3 = Post.objects.create( 37 | title = 'testblog3', 38 | content = 'This is only for testing purpose blog', 39 | author = User.objects.get(email='a@c.in'), 40 | view_count = 0, 41 | ) 42 | self.testblog4 = Post.objects.create( 43 | title = 'testblog4', 44 | content = 'This is only for testing purpose blog', 45 | author = User.objects.get(email='a@c.in'), 46 | view_count = 0, 47 | ) 48 | 49 | # Code for testing the `about` View 50 | def test_about_view_GET(self): 51 | response = self.client.get(self.about_url) 52 | self.assertEquals(response.status_code, 200) 53 | self.assertTemplateUsed(response, 'blog/about.html') 54 | 55 | # Code for testing the `View Count feature` which uses Ajax Call 56 | def test_viewCount_GET(self): 57 | response = self.client.get(self.viewcount_url) 58 | self.assertEquals(response.status_code, 200) 59 | 60 | # Code for testing the `Post_Detail` view 61 | def test_postdetailView_GET(self): 62 | response = self.client.get(self.detailview_url) 63 | self.assertEquals(response.status_code, 200) 64 | self.assertTemplateUsed(response, 'blog/post_detail.html') 65 | 66 | # Code for testing the `Home` View 67 | def test_home_view_GET(self): 68 | response = self.client.get(self.homeview_url) 69 | self.assertEquals(response.status_code, 200) 70 | self.assertTemplateUsed(response, 'blog/home.html') 71 | 72 | # Code for testing the `Profileview` View 73 | def test_profileview_GET(self): 74 | response = self.client.get(self.profileview_url) 75 | self.assertEquals(self.u.username, 'testuser') 76 | self.assertTemplateUsed(response, 'user/profile.html') 77 | 78 | # Code for testing the `postUpdatView` View 79 | def test_postupdateview_GET(self): 80 | self.testblog1.title = 'updating the title' 81 | self.assertNotEquals(self.testblog1.title, 'testblog1') 82 | 83 | # Code for testing the `post_create` View 84 | # def testpostcreateview_GET(self): 85 | # self.client.login(username='testuser', password='secret') 86 | # # self.tusu = Post.objects.create(title= 'this created by the client',content='this is the content of the blog-post') 87 | # print(Post.objects.all().count()) 88 | # # self.assertEquals() 89 | # # self.assertEquals(response, True) 90 | -------------------------------------------------------------------------------- /mysite/blog/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import ( 3 | PostDetail, 4 | PostUpdateView, 5 | PostDeleteView, 6 | getblogs, 7 | home, 8 | about, 9 | post_create, 10 | Profileview, 11 | PostLikeToggle, 12 | PostLikeAPIToggle, 13 | ) 14 | 15 | 16 | urlpatterns = [ 17 | path("", home, name="blog-home"), 18 | path("ajax/getBlogs", getblogs, name="getBlogs"), 19 | path("about/", about, name="blog-about"), 20 | path("profileview/", Profileview, name="blog-profile"), 21 | path("post//", PostDetail, name="post-detail"), 22 | path("post//update/", PostUpdateView.as_view(), name="post-update"), 23 | path("post//delete/", PostDeleteView.as_view(), name="post-delete"), 24 | path("post_create/", post_create, name="post_create"), 25 | path('post/like//', PostLikeToggle.as_view(), name='like-toggle'), 26 | path('api/like//', PostLikeAPIToggle.as_view(), name='like-api-toggle'), 27 | ] 28 | -------------------------------------------------------------------------------- /mysite/blog/utils.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import re 3 | import math 4 | from django.utils.html import strip_tags 5 | 6 | def count_words(text_string): 7 | word_string = strip_tags(text_string) 8 | matching_words = re.findall(r'\w+', word_string) 9 | count = len(matching_words) 10 | return count 11 | 12 | def get_read_time(text_string): 13 | count = count_words(text_string) 14 | read_time_min = math.ceil(count/200.0) #Assuming 200 words per min Reading 15 | read_time = str(datetime.timedelta(minutes=read_time_min)) 16 | return read_time 17 | -------------------------------------------------------------------------------- /mysite/blog/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, redirect, get_object_or_404 2 | from django.http import HttpResponse 3 | from .models import Post 4 | from django.contrib.auth.models import User 5 | from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin 6 | from django.views.generic import ListView, DetailView, UpdateView, DeleteView, RedirectView 7 | from django.contrib import messages 8 | from django.contrib.auth.decorators import login_required 9 | from .forms import PostForm 10 | from django.db.models import Q 11 | from django.core.paginator import Paginator 12 | from django.http import JsonResponse 13 | from django.utils import timezone 14 | from rest_framework.views import APIView 15 | from rest_framework.response import Response 16 | from rest_framework import authentication, permissions 17 | 18 | 19 | # Create your views here. 20 | 21 | def getblogs(request): 22 | queryset = Post.objects.all() 23 | return JsonResponse({"blogs":list(queryset.values())}) 24 | 25 | 26 | def home(request): 27 | posts = Post.objects.all() 28 | search_query = request.GET.get('q') 29 | if search_query: 30 | posts = posts.filter( 31 | Q(title__icontains = search_query) | 32 | Q(content__icontains = search_query) 33 | ) 34 | 35 | paginator = Paginator(posts, 2) 36 | page = request.GET.get('page') 37 | posts = paginator.get_page(page) 38 | 39 | # Top 4 most liked blogs, If possible after the feature of like count is added then 40 | # add a logic to store all the 4 id's of most liked blogs from the database in a list, then pass all the id's from the list to this 4 query. 41 | mostliked1 = Post.objects.get(id=1) 42 | mostliked2 = Post.objects.get(id=2) 43 | mostliked3 = Post.objects.get(id=3) 44 | mostliked4 = Post.objects.get(id=4) 45 | 46 | context={ 47 | 'posts': posts, 48 | 'mostliked1':mostliked1, 49 | 'mostliked2':mostliked2, 50 | 'mostliked3':mostliked3, 51 | 'mostliked4':mostliked4, 52 | } 53 | return render(request,'blog/home.html', context) 54 | 55 | 56 | def about(request): 57 | return render(request,'blog/about.html') 58 | 59 | 60 | def Profileview(request,name): 61 | user = User.objects.get(username=name) 62 | posts = user.post_set.all() 63 | flag = (request.user==Post.author) 64 | context={ 65 | 'user':user, 66 | 'flag':flag , 67 | 'posts':posts, 68 | } 69 | 70 | if request.user != user or request.user == user: 71 | return render(request,'user/profile.html', context) 72 | else: 73 | context={ 74 | 'posts': Post.objects.all(), 75 | 'flag':flag, 76 | } 77 | return render(request,'blog/home.html',context) 78 | 79 | 80 | def PostDetail(request, slug): 81 | post = Post.objects.filter(slug=slug).first() 82 | post.view_count = post.view_count + 1 83 | post.save() 84 | 85 | objects = Post.objects.get(slug = slug) 86 | 87 | fav = bool 88 | if objects.favourites.filter(id=request.user.id).exists(): 89 | fav = True 90 | 91 | context = { 92 | 'object': objects, 93 | 'fav': fav, 94 | } 95 | return render(request, 'blog/post_detail.html', context) 96 | 97 | 98 | class PostUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView): 99 | model = Post 100 | success_url = '/' 101 | fields = ['title', 'image', 'content', 'tags'] 102 | 103 | def form_valid(self, form): 104 | form.instance.author = self.request.user 105 | return super().form_valid(form) 106 | 107 | def test_func(self): 108 | post = self.get_object() 109 | if self.request.user == post.author: 110 | return True 111 | return False 112 | 113 | 114 | class PostDeleteView(LoginRequiredMixin, UserPassesTestMixin, DeleteView): 115 | model = Post 116 | success_url = '/' 117 | 118 | def test_func(self): 119 | post = self.get_object() 120 | if self.request.user == post.author: 121 | return True 122 | return False 123 | 124 | 125 | @login_required 126 | def post_create(request): 127 | form = PostForm(request.POST or None, request.FILES or None) 128 | if form.is_valid(): 129 | instance = form.save(commit=False) 130 | instance.author_id = request.user.id 131 | instance.save() 132 | form.save_m2m() 133 | messages.success(request, "Successfully Created") 134 | return redirect('blog-home') 135 | context ={ 136 | "form": form 137 | } 138 | return render(request, "blog/post_create.html", context) 139 | 140 | # For 404 Error Handling 141 | def view_404(request, exception): 142 | return render(request, 'blog/404.html') 143 | 144 | class PostLikeToggle(RedirectView): 145 | def get_redirect_url(self,*args, **kwargs): 146 | id_ = self.kwargs.get("slug") 147 | obj = get_object_or_404(Post,slug=id_) 148 | url_ = obj.get_url() 149 | user = self.request.user 150 | if user.is_authenticated: 151 | if user in obj.likes.all(): 152 | obj.likes.remove(user) 153 | else: 154 | obj.likes.add(user) 155 | return url_ 156 | 157 | class PostLikeAPIToggle(APIView): 158 | authentication_classes = [authentication.SessionAuthentication] 159 | permission_classes = [permissions.IsAuthenticated] 160 | 161 | def get(self, request, slug=None,format=None): 162 | obj = get_object_or_404(Post,slug=slug) 163 | url_ = obj.get_url() 164 | user = self.request.user 165 | updated = False 166 | liked = False 167 | verb = None 168 | if user.is_authenticated: 169 | if user in obj.likes.all(): 170 | liked = False 171 | verb = 'Like' 172 | obj.likes.remove(user) 173 | count = obj.likes.all().count() 174 | else: 175 | liked = True 176 | verb = 'Unlike' 177 | obj.likes.add(user) 178 | count = obj.likes.all().count() 179 | updated = True 180 | data = { 181 | "updated":updated, 182 | "liked":liked, 183 | "count":count, 184 | "verb":verb 185 | } 186 | print(data) 187 | return Response(data) 188 | 189 | -------------------------------------------------------------------------------- /mysite/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /mysite/media/admin/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/media/admin/default.jpg -------------------------------------------------------------------------------- /mysite/media/profile_pics/1476068871520.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/media/profile_pics/1476068871520.jpg -------------------------------------------------------------------------------- /mysite/media/profile_pics/1476068871520_aOEkPtH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/media/profile_pics/1476068871520_aOEkPtH.jpg -------------------------------------------------------------------------------- /mysite/media/profile_pics/dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/media/profile_pics/dp.png -------------------------------------------------------------------------------- /mysite/media/profile_pics/scene22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/media/profile_pics/scene22.jpg -------------------------------------------------------------------------------- /mysite/mysite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/mysite/__init__.py -------------------------------------------------------------------------------- /mysite/mysite/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for mysite project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /mysite/mysite/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for mysite project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.3. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | import django_heroku 13 | import os 14 | from decouple import config 15 | 16 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 17 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = config('SECRET_KEY') 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = config('DEBUG',default=False,cast=bool) 28 | 29 | ALLOWED_HOSTS = ['*'] 30 | 31 | CKEDITOR_CONFIGS = { 32 | 'default': { 33 | # 'toolbar': 'Standard', 34 | # 'removeButtons': 'Save,NewPage,Print,PasteFromWord,Form,TextField,Textarea,Button,ImageButton,HiddenField,BidiLtr,BidiRtl,Language,Flash,PageBreak,Iframe,ShowBlocks,About,CreateDiv', 35 | 'toolbar': 'Custom', 36 | 'toolbar_Custom': [ 37 | ['Maximize'], 38 | ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'], 39 | ['Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo'], 40 | ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], 41 | '/', 42 | ['Checkbox', 'Radio'], 43 | ['Link', 'Unlink', 'Anchor'], 44 | ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar'], 45 | ['TextColor', 'BGColor'], 46 | ['Find', 'Replace', '-', 'SelectAll', 'Scayt'], 47 | ['Source'], ['Preview'], ['CodeSnippet'],['ShowBlocks'], 48 | ['Styles', 'Format', 'Font', 'FontSize'] 49 | ], 50 | 'extraPlugins': ['codesnippet'], 51 | 'skin': 'kama', 52 | 'height': 300, 53 | 'width': '100%', 54 | }, 55 | } 56 | 57 | CKEDITOR_UPLOAD_PATH = "uploads/" 58 | 59 | # Application definition 60 | 61 | INSTALLED_APPS = [ 62 | 'blog.apps.BlogConfig', 63 | 'django.contrib.admin', 64 | 'crispy_forms', 65 | 'django.contrib.auth', 66 | 'django.contrib.contenttypes', 67 | 'django.contrib.sessions', 68 | 'django.contrib.messages', 69 | 'django.contrib.staticfiles', 70 | 'users.apps.UsersConfig', 71 | 'ckeditor', 72 | 'ckeditor_uploader', 73 | 'taggit', 74 | 'rest_framework', 75 | ] 76 | 77 | MIDDLEWARE = [ 78 | 'django.middleware.security.SecurityMiddleware', 79 | 'django.contrib.sessions.middleware.SessionMiddleware', 80 | 'django.middleware.common.CommonMiddleware', 81 | 'django.middleware.csrf.CsrfViewMiddleware', 82 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 83 | 'django.contrib.messages.middleware.MessageMiddleware', 84 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 85 | ] 86 | 87 | ROOT_URLCONF = 'mysite.urls' 88 | 89 | TEMPLATES = [ 90 | { 91 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 92 | 'DIRS': [], 93 | 'APP_DIRS': True, 94 | 'OPTIONS': { 95 | 'context_processors': [ 96 | 'django.template.context_processors.debug', 97 | 'django.template.context_processors.request', 98 | 'django.contrib.auth.context_processors.auth', 99 | 'django.contrib.messages.context_processors.messages', 100 | ], 101 | }, 102 | }, 103 | ] 104 | 105 | WSGI_APPLICATION = 'mysite.wsgi.application' 106 | 107 | 108 | # Database 109 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 110 | 111 | DATABASES = { 112 | 'default': { 113 | 'ENGINE': 'django.db.backends.sqlite3', 114 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 115 | } 116 | } 117 | 118 | 119 | # Password validation 120 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 121 | 122 | AUTH_PASSWORD_VALIDATORS = [ 123 | { 124 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 125 | }, 126 | { 127 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 128 | }, 129 | { 130 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 131 | }, 132 | { 133 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 134 | }, 135 | ] 136 | 137 | 138 | # Internationalization 139 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 140 | 141 | LANGUAGE_CODE = 'en-us' 142 | 143 | TIME_ZONE = 'Asia/Kolkata' 144 | 145 | USE_I18N = True 146 | 147 | USE_L10N = True 148 | 149 | USE_TZ = True 150 | 151 | 152 | # Static files (CSS, JavaScript, Images) 153 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 154 | 155 | STATIC_URL = '/static/' 156 | # STATIC_ROOT = os.path.join(BASE_DIR,'static') 157 | 158 | CRISPY_TEMPLATE_PACK = 'bootstrap4' 159 | 160 | MEDIA_ROOT=os.path.join(BASE_DIR,'media') 161 | 162 | MEDIA_URL='/media/' 163 | 164 | LOGIN_REDIRECT_URL='blog-home' 165 | 166 | LOGOUT_REDIRECT_URL = 'blog-home' 167 | 168 | LOGIN_URL='login' 169 | 170 | AUTHENTICATION_BACKENDS = ['users.backends.EmailBackend'] #Userlogin by Email / Username 171 | 172 | django_heroku.settings(locals()) 173 | 174 | # SMTP configuration 175 | 176 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 177 | EMAIL_HOST ='smtp.gmail.com' 178 | EMAIL_PORT = 587 179 | EMAIL_USE_TLS = True 180 | EMAIL_HOST_USER =config('EMAIL_HOST') 181 | EMAIL_HOST_PASSWORD =config('EMAIL_HOST_PASSWORD') 182 | -------------------------------------------------------------------------------- /mysite/mysite/urls.py: -------------------------------------------------------------------------------- 1 | """mysite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | from users import views as user_views 19 | from users.views import LoginView 20 | from django.contrib.auth import views as auth_views 21 | from django.conf import settings 22 | from django.conf.urls.static import static 23 | from django.conf.urls import url, handler404 24 | handler404 = 'blog.views.view_404' 25 | 26 | urlpatterns = [ 27 | path('admin/', admin.site.urls), 28 | path('ckeditor/', include('ckeditor_uploader.urls')), 29 | path('', include('blog.urls')), 30 | path('profile/', include('users.urls')), 31 | path('register/', user_views.register,name='register'), 32 | path('profile/', user_views.profile,name='profile'), 33 | path('profile/profileUpdate//', user_views.profileUpdate,name='profileUpdate'), 34 | path('profile/edit/', user_views.editProfile, name='editProfile'), 35 | path('login/', LoginView.as_view(template_name='user/login.html'), name='login'), #For New User Login By Email/User 36 | #path('login/', auth_views.LoginView.as_view(template_name='user/login.html'),name='login'), 37 | path('logout/', auth_views.LogoutView.as_view(template_name='user/logout.html'),name='logout'), 38 | path('password_reset/', auth_views.PasswordResetView.as_view(template_name='user/password_reset.html'),name='password_reset'), 39 | path('password_reset_sent/',auth_views.PasswordResetDoneView.as_view(template_name='user/password_reset_sent.html'),name='password_reset_done'), 40 | path('reset///',auth_views.PasswordResetConfirmView.as_view(template_name='user/password_reset_form.html'),name='password_reset_confirm'), 41 | path('password_reset_complete/', auth_views.PasswordResetCompleteView.as_view(template_name='user/password_reset_complete.html'),name='password_reset_complete'), 42 | ] 43 | 44 | 45 | 46 | if settings.DEBUG: 47 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 48 | -------------------------------------------------------------------------------- /mysite/mysite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mysite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /mysite/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.2.10 2 | dj-database-url==0.5.0 3 | Django==3.1.12 4 | django-crispy-forms==1.9.2 5 | django-heroku==0.3.1 6 | gunicorn==20.0.4 7 | Pillow==8.2.0 8 | psycopg2==2.8.5 9 | pytz==2020.1 10 | sqlparse==0.3.1 11 | whitenoise==5.1.0 12 | django-ckeditor==6.0.0 13 | django-js-asset==1.2.2 14 | django-taggit==1.3.0 15 | python-decouple==3.3 16 | djangorestframework==3.12.2 17 | -------------------------------------------------------------------------------- /mysite/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.7.4 -------------------------------------------------------------------------------- /mysite/staticfiles/Wireframes/Community - Home (Yash).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/Wireframes/Community - Home (Yash).png -------------------------------------------------------------------------------- /mysite/staticfiles/Wireframes/Home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/Wireframes/Home.png -------------------------------------------------------------------------------- /mysite/staticfiles/community(expanded)_ui_yash/Community - Home UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/community(expanded)_ui_yash/Community - Home UI.png -------------------------------------------------------------------------------- /mysite/staticfiles/communitypage_ui_AdityaAshvin.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/communitypage_ui_AdityaAshvin.JPG -------------------------------------------------------------------------------- /mysite/staticfiles/dashboard ui_nooras/DashboardNew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/dashboard ui_nooras/DashboardNew.png -------------------------------------------------------------------------------- /mysite/staticfiles/dashboard ui_nooras/DashboardUIFinal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/dashboard ui_nooras/DashboardUIFinal.png -------------------------------------------------------------------------------- /mysite/staticfiles/homepage ui_Akshi149/Homepage_UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/homepage ui_Akshi149/Homepage_UI.png -------------------------------------------------------------------------------- /mysite/staticfiles/img/viewicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/staticfiles/img/viewicon.png -------------------------------------------------------------------------------- /mysite/users/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/users/__init__.py -------------------------------------------------------------------------------- /mysite/users/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import Profile 4 | # Register your models here. 5 | 6 | admin.site.register(Profile) 7 | -------------------------------------------------------------------------------- /mysite/users/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UsersConfig(AppConfig): 5 | name = 'users' 6 | -------------------------------------------------------------------------------- /mysite/users/backends.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.backends import ModelBackend 2 | from django.contrib.auth import get_user_model 3 | from django.db.models import Q 4 | from django.core.exceptions import ValidationError 5 | 6 | 7 | UserModel = get_user_model() 8 | 9 | # Reference - https://rahmanfadhil.com/django-login-with-email/ 10 | 11 | # Userlogin by email or username 12 | class EmailBackend(ModelBackend): 13 | error_messages = { 14 | 'invalid_login': ( 15 | "Please enter a correct email/username and password." 16 | ), 17 | 'invalid_password': ( 18 | "Please enter a correct password." 19 | ) 20 | } 21 | def authenticate(self, request, username=None, password=None, **kwargs): 22 | try: 23 | user = UserModel.objects.get( 24 | Q(username__iexact=username) | Q(email__iexact=username)) 25 | except UserModel.DoesNotExist: 26 | UserModel().set_password(password) 27 | raise self.get_invalid_login_error() 28 | except MultipleObjectsReturned: 29 | return User.objects.filter(email=username).order_by('id').first() 30 | else: 31 | if user.check_password(password) and self.user_can_authenticate(user): 32 | return user 33 | else: 34 | raise self.get_invalid_password() 35 | 36 | def get_user(self, user_id): 37 | try: 38 | user = UserModel.objects.get(pk=user_id) 39 | except UserModel.DoesNotExist: 40 | return None 41 | 42 | return user if self.user_can_authenticate(user) else None 43 | 44 | def get_invalid_login_error(self): #For invalid email and password 45 | return ValidationError( 46 | self.error_messages['invalid_login'], 47 | code='invalid_login', 48 | ) 49 | 50 | def get_invalid_password(self): #For invalid password only 51 | return ValidationError( 52 | self.error_messages['invalid_password'], 53 | code='invalid_password', 54 | ) -------------------------------------------------------------------------------- /mysite/users/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.models import User 3 | from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, UserChangeForm, ReadOnlyPasswordHashField 4 | from .models import Profile 5 | 6 | #For User Regestration 7 | class user_reg_form(UserCreationForm): 8 | email= forms.EmailField() 9 | 10 | class Meta: 11 | model= User 12 | fields=['username','email','password1','password2'] 13 | 14 | #For User login 15 | class LoginForm(AuthenticationForm): 16 | username = forms.CharField(label='Email / Username') 17 | 18 | #For User Profile Image 19 | class UserProfileForm(forms.ModelForm): 20 | class Meta: 21 | model = Profile 22 | fields = ['image'] 23 | 24 | class UserProfileUpdateForm(UserChangeForm): 25 | password = ReadOnlyPasswordHashField(label="Password", widget=forms.HiddenInput(), 26 | help_text="Password Field Hidden") 27 | bio = forms.CharField(max_length=50, help_text='Enter short bio of 50 characters.', required = False) 28 | 29 | class Meta: 30 | model = User 31 | fields = ['username', 'email'] 32 | 33 | def __init__(self, *args, **kwargs): 34 | super(UserProfileUpdateForm, self).__init__(*args, **kwargs) 35 | try: 36 | self.fields['bio'].initial = self.instance.profile.bio 37 | except Profile.DoesNotExist: 38 | pass 39 | 40 | # class UserProfileBioForm(forms.ModelForm): 41 | # class Meta: 42 | # model = Profile 43 | # fields = ['bio'] 44 | -------------------------------------------------------------------------------- /mysite/users/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.3 on 2020-03-29 10:30 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='profile', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('image', models.ImageField(default='default.jpg', upload_to='profile_pics')), 22 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 23 | ], 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /mysite/users/migrations/0002_profile_bio.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2 on 2020-09-06 14:06 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('users', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='profile', 15 | name='bio', 16 | field=models.CharField(blank=True, max_length=50, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /mysite/users/migrations/0003_auto_20200923_1908.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-09-23 13:38 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('users', '0002_profile_bio'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='profile', 15 | name='image', 16 | field=models.ImageField(default='admin/default.jpg', upload_to='profile_pics'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /mysite/users/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/mysite/users/migrations/__init__.py -------------------------------------------------------------------------------- /mysite/users/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | 4 | 5 | # Create your models here. 6 | 7 | class Profile(models.Model): 8 | user= models.OneToOneField(User, on_delete=models.CASCADE) 9 | image = models.ImageField(default='admin/default.jpg',upload_to='profile_pics') 10 | bio = models.CharField(max_length=50, null=True, blank=True) 11 | 12 | def __str__(self): 13 | return f'{self.user.username} profile' -------------------------------------------------------------------------------- /mysite/users/templates/user/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 39 | 40 | 41 | 42 |
43 |
44 |
45 | {% if messages %} 46 | {% for messages in messages %} 47 |
48 | {{ messages }} 49 |
50 | 51 | {% endfor %} 52 | {% endif %} 53 | {% block content %} 54 | 55 | {% endblock %} 56 |
57 |
58 |
59 |

Our Sidebar

60 |

You can put any information here you'd like. 61 |

    62 |
  • Latest Posts
  • 63 |
  • Announcements
  • 64 |
  • Calendars
  • 65 |
  • etc
  • 66 |
67 |

68 |
69 |
70 |
71 |
72 | 73 | 74 | 75 | 76 | 77 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /mysite/users/templates/user/editProfile.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 | 6 |
7 |
8 | {% csrf_token %} 9 |
10 | Update Information 11 | {{ form | crispy }} 12 |
13 |
14 | 15 |
16 |
17 |
18 | 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /mysite/users/templates/user/favourites.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load static %} 3 | 4 | {% block content %} 5 |

My Favourite Blogs

6 | 7 | {% for post in new %} 8 | 21 | {% endfor %} 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /mysite/users/templates/user/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 | {% csrf_token %} 8 | 9 |
10 | Log In 11 | {{ form | crispy }} 12 |
13 |
14 | 17 | Forgot Password? 18 |
19 |
20 | 21 |
22 | 23 | Need an Account? 24 | Sign Up Now 25 | 26 |
27 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | {% endblock %} 35 | 36 | -------------------------------------------------------------------------------- /mysite/users/templates/user/message.html: -------------------------------------------------------------------------------- 1 |
2 | {% if messages %} 3 | {% for message in messages %} 4 | -------------------------------------------------------------------------------- /mysite/users/templates/user/password_reset.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 | {% csrf_token %} 8 | 9 |
10 | Password Reset 11 |

Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.

12 | {{form | crispy }} 13 |
14 |
15 | 18 |
19 |
20 |
21 | 22 | 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /mysite/users/templates/user/password_reset_complete.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 | 6 |
7 | Password Reset Complete 8 | 9 |

Your password has been set. You may go ahead and log in now.

10 | 11 | Log In 12 |
13 | 14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /mysite/users/templates/user/password_reset_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 | {% csrf_token %} 8 | 9 |
10 | Password Reset Confirmation 11 |

Please enter your new password twice to check you typed it correctly.

12 | {{ form | crispy }} 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /mysite/users/templates/user/password_reset_sent.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 |
6 | Password Reset Sent

7 | 8 |

We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly. 9 | 10 | If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder. 11 | 12 |

13 |
14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /mysite/users/templates/user/profile.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 | 6 |
7 |
8 |
9 | {% if flag is True %} 10 | 11 | {% if user.profile.image.url %} 12 |
13 | 15 | 16 | Profile Image 17 |
18 | 19 | 39 | {% else %} 40 | 41 | 42 |
43 | 45 | 46 | Profile Image 47 |
48 | 49 | 69 | {% endif %} 70 | {% else %} 71 | {% if user.profile.image.url %} 72 |
73 | 75 |
76 | 77 | {%else%} 78 |
79 | 81 |
82 | {% endif %} 83 | {% endif %} 84 |
85 | 86 | 87 | 88 |
89 | 90 |

{{user.email}}

91 | {% if flag is True %} 92 | Edit 93 | Profile 94 | {% endif %} 95 |
96 |
97 |
98 | 99 |

Posts by {{ user.username }}: {{ user.post_set.count }}

100 | {% for post in posts %} 101 | 111 | {% endfor %} 112 | {% endblock %} 113 | -------------------------------------------------------------------------------- /mysite/users/templates/user/register.html: -------------------------------------------------------------------------------- 1 | {% extends 'blog/base.html'%} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 | {% csrf_token %} 8 | 9 |
10 | Join Today 11 | {{ form | crispy }} 12 |
13 |
14 | 17 | 18 |
19 |
20 | 21 |
22 | 23 | Already Have an Account? 24 | Sign in 25 | 26 |
27 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | {% endblock %} -------------------------------------------------------------------------------- /mysite/users/tests.py: -------------------------------------------------------------------------------- 1 | # Create your tests here. 2 | from django.test import TestCase,Client,override_settings 3 | from users.models import Profile 4 | from django.contrib.auth.models import User 5 | from django.shortcuts import reverse 6 | 7 | @override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFilesStorage') 8 | class UserTestCase(TestCase): 9 | 10 | def setUp(self): 11 | # self.client = Client() 12 | self.u=User.objects.create_user(username="testuser",email="a@c.in",password="secret") 13 | self.p1=Profile.objects.create(user=self.u,bio="hello there",image="media/profile_pics/scene22.jpg") 14 | self.u2=User.objects.create_user(username="agar",password="secret23") 15 | 16 | def test_profile_model(self): 17 | self.assertEquals(Profile.objects.count(), 1) 18 | profile=Profile.objects.get(user_id=1) 19 | self.assertEquals(profile.image, "media/profile_pics/scene22.jpg") 20 | 21 | def test_profile_view(self): 22 | c=Client() 23 | response=c.get("/profile/edit/") 24 | self.assertEquals(self.p1.bio, "hello there") 25 | # updating bio 26 | self.p1.bio="Hello again" 27 | self.assertNotEquals(self.p1.bio, "hello there") 28 | 29 | def test_login(self): 30 | response= self.client.login(username='testuser',password='secret') 31 | self.assertEquals(response,True) 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mysite/users/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import ( 3 | favourite_add, 4 | favourite_list, 5 | ) 6 | 7 | app_name = 'users' 8 | 9 | urlpatterns = [ 10 | path('fav//', favourite_add, name='favourite_add'), 11 | path('favourites/', favourite_list, name='favourite_list'), 12 | ] 13 | -------------------------------------------------------------------------------- /mysite/users/views.py: -------------------------------------------------------------------------------- 1 | # from django.shortcuts import render, get_object_or_404, get_list_or_404 2 | from django.shortcuts import render ,redirect, get_object_or_404, get_list_or_404, HttpResponseRedirect 3 | from django.contrib import messages 4 | from django.contrib.auth.decorators import login_required 5 | from django.contrib.auth import views as auth_views 6 | from .forms import user_reg_form, LoginForm, UserProfileForm, UserProfileUpdateForm 7 | from mysite.settings import EMAIL_HOST_USER 8 | from django.core.mail import send_mail 9 | from .models import Profile 10 | from django.contrib.auth.models import User 11 | from blog.models import Post 12 | 13 | # Create your views here. 14 | 15 | # For returning the favourites 16 | @login_required 17 | def favourite_list(request): 18 | posts = Post.objects.all() 19 | new = posts.filter(favourites = request.user) 20 | context = { 21 | 'new': new, 22 | } 23 | return render(request, 'user/favourites.html', context) 24 | 25 | # For Adding Favourite 26 | @login_required 27 | def favourite_add(request, id): 28 | post = get_object_or_404(Post, id = id) 29 | if post.favourites.filter(id=request.user.id).exists(): 30 | post.favourites.remove(request.user) 31 | else: 32 | post.favourites.add(request.user) 33 | return HttpResponseRedirect(request.META['HTTP_REFERER']) 34 | 35 | # For user registration 36 | def register(request): 37 | if request.method=='POST': 38 | form = user_reg_form(request.POST) 39 | if form.is_valid(): 40 | email = request.POST['email'] 41 | subject = 'Welcome to Blogger' 42 | message = 'Thank you for registering to Blogger. We are gald to see you here. Enjoy the free blogging service. Happy Blogging' 43 | recepient = email 44 | send_mail(subject,message, EMAIL_HOST_USER, [recepient], fail_silently=False) 45 | form.save() 46 | username= form.cleaned_data.get('username') 47 | messages.success(request,f'Your Account has been created! You are now able to Login') 48 | return redirect('profile') 49 | else: 50 | form=user_reg_form() 51 | 52 | return render(request,'user/register.html',{'form': form}) 53 | 54 | #For User login 55 | class LoginView(auth_views.LoginView): 56 | form_class = LoginForm 57 | template_name = 'users/login.html' 58 | 59 | #If User Add New Image to profile 60 | @login_required 61 | def profile(request): 62 | flag=True 63 | if request.method == 'POST': 64 | profile_form = UserProfileForm(request.POST or None, request.FILES or None) 65 | if profile_form.is_valid(): 66 | profile = profile_form.save(commit=False) 67 | try: 68 | profile.user = request.user #.profile 69 | except Profile.DoesNotExist: 70 | profile.user = Profile(user=request.user) 71 | if profile_form.cleaned_data['image']: 72 | profile.picture = profile_form.cleaned_data["image"] 73 | else: 74 | messages.success(request,f'Something is wrong, try again') 75 | profile.save() 76 | else: 77 | print(profile_form.errors) 78 | else: 79 | profile_form = UserProfileForm() 80 | if Post.objects.filter(author=request.user): #For login user blog view 81 | posts = Post.objects.filter(author=request.user) 82 | return render(request,'user/profile.html',{'form': profile_form,'flag':flag, "posts":posts}) 83 | return render(request,'user/profile.html',{'form': profile_form,'flag':flag}) 84 | 85 | #If User Update Profile Image 86 | @login_required 87 | def profileUpdate(request, pk): 88 | flag=True 89 | if request.method == 'POST': 90 | #print(pk) 91 | server = get_object_or_404(Profile, pk=pk) 92 | form = UserProfileForm(request.POST or None, request.FILES or None, instance=server) 93 | if form.is_valid(): 94 | edit = form.save(commit=False) 95 | edit.save() 96 | return redirect('profile') 97 | form = UserProfileForm() 98 | return render(request,'user/profile.html',{'form': form,'flag':flag}) 99 | 100 | @login_required 101 | def editProfile(request): 102 | flag=True 103 | if request.method == 'POST': 104 | form = UserProfileUpdateForm(request.POST, instance=request.user) 105 | if form.is_valid(): 106 | form.save() 107 | print("outttt", form.cleaned_data['bio']) 108 | if form.cleaned_data['bio'] or form.cleaned_data['bio']=="": 109 | print("hbhbhb", form.cleaned_data['bio']) 110 | try: 111 | prof = Profile.objects.get(user=request.user) 112 | except Profile.DoesNotExist: 113 | prof = Profile.objects.create(user=request.user) 114 | prof.bio = form.cleaned_data['bio'] 115 | prof.save() 116 | messages.success(request, f'Your profile information updated successfully') 117 | return redirect("profile") 118 | form = UserProfileUpdateForm(instance = request.user) 119 | return render(request, 'user/editProfile.html', {'form': form, 'flag':flag} ) 120 | -------------------------------------------------------------------------------- /static/css/style_communitypage.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | color: white !important; 3 | padding: 0px 20px !important; 4 | font-family: PT serif; 5 | } 6 | .card { 7 | box-shadow: 0 0px 10px 0 #C2185B; 8 | background-color: antiquewhite!important; 9 | transition: 0.3s; 10 | } 11 | #title{ 12 | color: #C2185B; 13 | font-family: oswald; 14 | } 15 | .card-title{ 16 | font-family: Montserrat; 17 | color: #E91E63; 18 | } 19 | #subheading{ 20 | color: #C2185B; 21 | font-family: Oswald; 22 | } 23 | #searchNav{ 24 | padding-left:50px; 25 | padding-bottom:10px; 26 | } 27 | #search{ 28 | width:400px; 29 | } 30 | #searchIcon{ 31 | position: absolute; 32 | margin-left: 370px; 33 | color: orange; 34 | } 35 | ul li { 36 | display:inline; 37 | font-size: 25px; 38 | padding: 5px; 39 | } 40 | #footer-contents{ 41 | display: table; 42 | margin: 0 auto; 43 | padding: 8px; 44 | font-family: PT serif; 45 | } 46 | -------------------------------------------------------------------------------- /static/css/style_extendedpage.css: -------------------------------------------------------------------------------- 1 | body { 2 | background : #f4f4f2; 3 | color: #333333; 4 | margin-top: 5rem; 5 | } 6 | 7 | h2, 8 | h3, 9 | h4, 10 | h6 { 11 | color: #444444; 12 | } 13 | 14 | ul { 15 | margin: 0; 16 | } 17 | 18 | .bg-steel { 19 | background-color: #5c5b56; 20 | } 21 | 22 | 23 | .site-header .navbar-nav .nav-link { 24 | color: #f4f4f2; 25 | display:inline-block; 26 | } 27 | .site-header .navbar-nav .nav-link:hover { 28 | color: #ffffff; 29 | } 30 | 31 | .site-header .navbar-nav .nav-link.active { 32 | font-weight: 500; 33 | } 34 | 35 | .content-section { 36 | background-color: rgb(250, 250, 250); 37 | padding: 10px 20px; 38 | border: 1px solid grey ; 39 | border-radius: 3px; 40 | margin-bottom: 20px; 41 | box-shadow: visible; 42 | } 43 | 44 | .article-title { 45 | color: #E85A4F; 46 | font-size: 24px; 47 | font-family:"roboto"; 48 | } 49 | 50 | a.article-title:hover { 51 | color: #428bca; 52 | text-decoration: none; 53 | } 54 | 55 | .article-content { 56 | white-space: pre-line; 57 | font-family: "montserrat"; 58 | } 59 | .article-img { 60 | height: 65px; 61 | width: 65px; 62 | margin-right: 16px; 63 | } 64 | 65 | .article-metadata { 66 | padding-bottom: 1px; 67 | margin-bottom: 4px; 68 | border-bottom: 1px solid #e3e3e3; 69 | } 70 | 71 | .article-metadata a:hover { 72 | color: #333; 73 | text-decoration: none; 74 | } 75 | 76 | .article-svg { 77 | width: 25px; 78 | height: 25px; 79 | vertical-align: middle; 80 | } 81 | 82 | .account-img { 83 | height: 125px; 84 | width: 125px; 85 | margin-bottom: 16px; 86 | } 87 | 88 | .account-heading { 89 | font-size: 2.5rem; 90 | } 91 | 92 | *:focus { 93 | outline: none; 94 | } 95 | .notification{ 96 | position: relative; 97 | left: 10px; 98 | bottom: 10px; 99 | } 100 | .readtime { 101 | float: right; 102 | color: violet; 103 | } 104 | .viewcount { 105 | float: right; 106 | } 107 | 108 | 109 | .jumbotron { 110 | margin-top: 10px; 111 | background-color: #eae4dc; 112 | } 113 | 114 | footer{ 115 | background-color: #5c5b56; 116 | text-decoration-color:#f4f4f2; 117 | } 118 | .links{ 119 | color: #f4f4f2; 120 | display:inline-block; 121 | } 122 | .links:hover{ 123 | color: #ffffff; 124 | } 125 | 126 | strong{ 127 | margin-left: 10px; 128 | } 129 | 130 | #navbtn1{ 131 | border-color:#E85A4F; 132 | margin-left:450px; 133 | border-radius: 5px; 134 | size:35px ; 135 | padding: 4px 70px; 136 | transition-duration: 0.3s; 137 | } 138 | #navbtn2{ 139 | border-color:#E85A4F; 140 | border-radius: 20px; 141 | font-size:15px ; 142 | padding: 2px 20px 143 | } 144 | #navbtn3{ 145 | border-color:#E85A4F; 146 | transition-duration: 0.3s; 147 | padding: 8 80 ; 148 | } 149 | #navbtn4{ 150 | margin-left: 20px ; 151 | border-color:#E85A4F; 152 | transition-duration: 0.3s; 153 | padding: 8 80 ; 154 | } 155 | #navbtn5{ 156 | margin-left:50px; 157 | padding: 8 80 ; 158 | border-color:#E85A4F; 159 | transition-duration: 0.3s; 160 | 161 | } 162 | #navbtn5:hover{ 163 | background-color:#e85a4f; 164 | color:#f4f4f2; 165 | } 166 | #navbtn3:hover{ 167 | background-color:#e85a4f; 168 | color:#f4f4f2; 169 | } 170 | #navbtn4:hover{ 171 | background-color:#e85a4f; 172 | color:#f4f4f2; 173 | } 174 | #navbtn1:hover{ 175 | background-color:#e85a4f; 176 | color:#f4f4f2; 177 | } 178 | #navbtn1:active,#navbtn5:active,#navbtn3:active,#navbtn4:active{ 179 | background-color:#e85a4f; 180 | } 181 | -------------------------------------------------------------------------------- /static/images/logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/images/logo-transparent.png -------------------------------------------------------------------------------- /static/images/nwoc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/images/nwoc-logo.png -------------------------------------------------------------------------------- /static/imga/image 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/image 6.png -------------------------------------------------------------------------------- /static/imga/image 7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/image 7.png -------------------------------------------------------------------------------- /static/imga/image 8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/image 8.png -------------------------------------------------------------------------------- /static/imga/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/image.png -------------------------------------------------------------------------------- /static/imga/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/plus.png -------------------------------------------------------------------------------- /static/imga/png_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/png_logo.png -------------------------------------------------------------------------------- /static/imga/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh7in/Blogger/de3359adf04dbcdcbd1e5110acac6695b2a31276/static/imga/search.png -------------------------------------------------------------------------------- /templates/Akshi_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | Subscribe to the newsletter to get the latest blog post links 7 |
8 | 9 | 10 |
11 |
12 |
13 | 14 | 15 |
Blogger
16 |
A blogging site
17 |
18 | 19 | 26 |
27 |

contact number+91 1234567890 28 | contact numbersupport@example.com 29 | contact numberxyz street

30 |
31 | 37 |
38 | -------------------------------------------------------------------------------- /templates/Akshi_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 53 | -------------------------------------------------------------------------------- /templates/com_extended.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Community > Technology 21 | image 22 | 23 |
24 |

Technology 25 | 28 |

29 |

brief description about the selected community

30 |
32 |
33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 |
45 |
46 | {% for post in posts %} 47 |
48 |
49 | 55 |

{{ post.content|truncatechars:300 }}

56 |
57 | thumb_up_alt 58 | thumb_down_alt 59 | comments_alt 60 | share_alt 61 |
62 |
63 | {% endfor %} 64 | 85 |
86 | 87 | 88 |
89 |
90 |

Challenges

91 |
92 |
    93 |
  • event_note Events
  • 94 |
  • Quizzes
  • 95 |
96 |
97 |
98 | 99 |

Lets Talk

100 |
101 |
    102 |
  • Discussion Forum
  • 103 |
104 |
105 |
106 |
107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /templates/communitypage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Blogger | Community Page 12 | 13 | 14 | 15 | 16 |
17 |

Communities

18 |
19 | 20 |
21 |
22 |
23 |
24 | ... 25 |
26 |

Technology

27 |
Following 1.2k
28 | 29 |
30 |
31 |
32 |
33 |
34 | ... 35 |
36 |

Technology

37 |
Following 1.2k
38 | 39 |
40 |
41 |
42 |
43 |
44 | ... 45 |
46 |

Technology

47 |
Following 1.2k
48 | 49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | ... 57 |
58 |

Technology

59 |
Following 1.2k
60 | 61 |
62 |
63 |
64 |
65 |
66 | ... 67 |
68 |

Technology

69 |
Following 1.2k
70 | 71 |
72 |
73 |
74 |
75 |
76 | ... 77 |
78 |

Technology

79 |
Following 1.2k
80 | 81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |

Subscribe to our newsletter to get latest blog post links

89 |
90 | 91 | 92 |
93 |
94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /templates/dashboard/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /templates/dashboard/dash_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 | 27 | 28 | 29 | 30 | 47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /templates/dashboard/script_dashboard.js: -------------------------------------------------------------------------------- 1 | // Chart.js scripts 2 | // -- Set new default font family and font color to mimic Bootstrap's default styling 3 | Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; 4 | Chart.defaults.global.defaultFontColor = '#292b2c'; 5 | // -- Area Chart Example 6 | var ctx = document.getElementById("myAreaChart"); 7 | var myLineChart = new Chart(ctx, { 8 | type: 'line', 9 | data: { 10 | labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"], 11 | datasets: [{ 12 | label: "Sessions", 13 | lineTension: 0.3, 14 | backgroundColor: "rgba(2,117,216,0.2)", 15 | borderColor: "rgba(2,117,216,1)", 16 | pointRadius: 5, 17 | pointBackgroundColor: "rgba(2,117,216,1)", 18 | pointBorderColor: "rgba(255,255,255,0.8)", 19 | pointHoverRadius: 5, 20 | pointHoverBackgroundColor: "rgba(2,117,216,1)", 21 | pointHitRadius: 20, 22 | pointBorderWidth: 2, 23 | data: [10000, 30162, 26263, 18394, 18287, 28682, 31274, 33259, 25849, 24159, 32651, 31984, 38451], 24 | }], 25 | }, 26 | options: { 27 | scales: { 28 | xAxes: [{ 29 | time: { 30 | unit: 'date' 31 | }, 32 | gridLines: { 33 | display: false 34 | }, 35 | ticks: { 36 | maxTicksLimit: 7 37 | } 38 | }], 39 | yAxes: [{ 40 | ticks: { 41 | min: 0, 42 | max: 40000, 43 | maxTicksLimit: 5 44 | }, 45 | gridLines: { 46 | color: "rgba(0, 0, 0, .125)", 47 | } 48 | }], 49 | }, 50 | legend: { 51 | display: false 52 | } 53 | } 54 | }); 55 | // -- Bar Chart Example 56 | var ctx = document.getElementById("myBarChart"); 57 | var myLineChart = new Chart(ctx, { 58 | type: 'bar', 59 | data: { 60 | labels: ["January", "February", "March", "April", "May", "June"], 61 | datasets: [{ 62 | label: "Revenue", 63 | backgroundColor: "rgba(2,117,216,1)", 64 | borderColor: "rgba(2,117,216,1)", 65 | data: [4215, 5312, 6251, 7841, 9821, 14984], 66 | }], 67 | }, 68 | options: { 69 | scales: { 70 | xAxes: [{ 71 | time: { 72 | unit: 'month' 73 | }, 74 | gridLines: { 75 | display: false 76 | }, 77 | ticks: { 78 | maxTicksLimit: 6 79 | } 80 | }], 81 | yAxes: [{ 82 | ticks: { 83 | min: 0, 84 | max: 15000, 85 | maxTicksLimit: 5 86 | }, 87 | gridLines: { 88 | display: true 89 | } 90 | }], 91 | }, 92 | legend: { 93 | display: false 94 | } 95 | } 96 | }); 97 | // -- Pie Chart Example 98 | var ctx = document.getElementById("myPieChart"); 99 | var myPieChart = new Chart(ctx, { 100 | type: 'pie', 101 | data: { 102 | labels: ["Travel", "Technology", "Food", "Motivational"], 103 | datasets: [{ 104 | data: [12.21, 25.58, 11.25, 8.32], 105 | backgroundColor: ['#007bff', '#dc3545', '#ffc107', '#28a745'], 106 | }], 107 | }, 108 | }); 109 | 110 | $(document).ready(function() { 111 | $('#dataTable').DataTable(); 112 | }); 113 | 114 | (function($) { 115 | "use strict"; // Start of use strict 116 | // Configure tooltips for collapsed side navigation 117 | $('.navbar-sidenav [data-toggle="tooltip"]').tooltip({ 118 | template: '' 119 | }) 120 | // Toggle the side navigation 121 | $("#sidenavToggler").click(function(e) { 122 | e.preventDefault(); 123 | $("body").toggleClass("sidenav-toggled"); 124 | $(".navbar-sidenav .nav-link-collapse").addClass("collapsed"); 125 | $(".navbar-sidenav .sidenav-second-level, .navbar-sidenav .sidenav-third-level").removeClass("show"); 126 | }); 127 | // Force the toggled class to be removed when a collapsible nav link is clicked 128 | $(".navbar-sidenav .nav-link-collapse").click(function(e) { 129 | e.preventDefault(); 130 | $("body").removeClass("sidenav-toggled"); 131 | }); 132 | // Prevent the content wrapper from scrolling when the fixed side navigation hovered over 133 | $('body.fixed-nav .navbar-sidenav, body.fixed-nav .sidenav-toggler, body.fixed-nav .navbar-collapse').on('mousewheel DOMMouseScroll', function(e) { 134 | var e0 = e.originalEvent, 135 | delta = e0.wheelDelta || -e0.detail; 136 | this.scrollTop += (delta < 0 ? 1 : -1) * 30; 137 | e.preventDefault(); 138 | }); 139 | // Scroll to top button appear 140 | $(document).scroll(function() { 141 | var scrollDistance = $(this).scrollTop(); 142 | if (scrollDistance > 100) { 143 | $('.scroll-to-top').fadeIn(); 144 | } else { 145 | $('.scroll-to-top').fadeOut(); 146 | } 147 | }); 148 | // Configure tooltips globally 149 | $('[data-toggle="tooltip"]').tooltip() 150 | // Smooth scrolling using jQuery easing 151 | $(document).on('click', 'a.scroll-to-top', function(event) { 152 | var $anchor = $(this); 153 | $('html, body').stop().animate({ 154 | scrollTop: ($($anchor.attr('href')).offset().top) 155 | }, 1000, 'easeInOutExpo'); 156 | event.preventDefault(); 157 | }); 158 | })(jQuery); // End of use strict -------------------------------------------------------------------------------- /templates/dashboard/style_dashboard.css: -------------------------------------------------------------------------------- 1 | html { 2 | position: relative; 3 | min-height: 100%; 4 | } 5 | 6 | body { 7 | overflow-x: hidden; 8 | } 9 | 10 | body.sticky-footer { 11 | margin-bottom: 56px; 12 | } 13 | 14 | body.sticky-footer .content-wrapper { 15 | min-height: calc(100vh - 56px - 56px); 16 | } 17 | 18 | body.fixed-nav { 19 | padding-top: 56px; 20 | } 21 | 22 | .content-wrapper { 23 | min-height: calc(100vh - 56px); 24 | padding-top: 1rem; 25 | } 26 | 27 | .scroll-to-top { 28 | position: fixed; 29 | right: 15px; 30 | bottom: 3px; 31 | display: none; 32 | width: 50px; 33 | height: 50px; 34 | text-align: center; 35 | color: white; 36 | background: rgba(52, 58, 64, 0.5); 37 | line-height: 45px; 38 | } 39 | 40 | .scroll-to-top:focus, .scroll-to-top:hover { 41 | color: white; 42 | } 43 | 44 | .scroll-to-top:hover { 45 | background: #343a40; 46 | } 47 | 48 | .scroll-to-top i { 49 | font-weight: 800; 50 | } 51 | 52 | .smaller { 53 | font-size: 0.7rem; 54 | } 55 | 56 | .o-hidden { 57 | overflow: hidden !important; 58 | } 59 | 60 | .z-0 { 61 | z-index: 0; 62 | } 63 | 64 | .z-1 { 65 | z-index: 1; 66 | } 67 | 68 | #mainNav .navbar-collapse { 69 | overflow: auto; 70 | max-height: 75vh; 71 | } 72 | 73 | #mainNav .navbar-collapse .navbar-nav .nav-item .nav-link { 74 | cursor: pointer; 75 | } 76 | 77 | #mainNav .navbar-collapse .navbar-sidenav .nav-link-collapse:after { 78 | float: right; 79 | content: '\f107'; 80 | font-family: 'FontAwesome'; 81 | } 82 | 83 | #mainNav .navbar-collapse .navbar-sidenav .nav-link-collapse.collapsed:after { 84 | content: '\f105'; 85 | } 86 | 87 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-second-level, 88 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-third-level { 89 | padding-left: 0; 90 | } 91 | 92 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-second-level > li > a, 93 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-third-level > li > a { 94 | display: block; 95 | padding: 0.5em 0; 96 | } 97 | 98 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-second-level > li > a:focus, #mainNav .navbar-collapse .navbar-sidenav .sidenav-second-level > li > a:hover, 99 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-third-level > li > a:focus, 100 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-third-level > li > a:hover { 101 | text-decoration: none; 102 | } 103 | 104 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-second-level > li > a { 105 | padding-left: 1em; 106 | } 107 | 108 | #mainNav .navbar-collapse .navbar-sidenav .sidenav-third-level > li > a { 109 | padding-left: 2em; 110 | } 111 | 112 | #mainNav .navbar-collapse .sidenav-toggler { 113 | display: none; 114 | } 115 | 116 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link { 117 | position: relative; 118 | min-width: 45px; 119 | } 120 | 121 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link:after { 122 | float: right; 123 | width: auto; 124 | content: '\f105'; 125 | border: none; 126 | font-family: 'FontAwesome'; 127 | } 128 | 129 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link .indicator { 130 | position: absolute; 131 | top: 5px; 132 | left: 21px; 133 | font-size: 10px; 134 | } 135 | 136 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown.show > .nav-link:after { 137 | content: '\f107'; 138 | } 139 | 140 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown .dropdown-menu > .dropdown-item > .dropdown-message { 141 | overflow: hidden; 142 | max-width: none; 143 | text-overflow: ellipsis; 144 | } 145 | 146 | @media (min-width: 992px) { 147 | #mainNav .navbar-brand { 148 | width: 250px; 149 | } 150 | #mainNav .navbar-collapse { 151 | overflow: visible; 152 | max-height: none; 153 | } 154 | #mainNav .navbar-collapse .navbar-sidenav { 155 | position: absolute; 156 | top: 0; 157 | left: 0; 158 | -webkit-flex-direction: column; 159 | -ms-flex-direction: column; 160 | flex-direction: column; 161 | margin-top: 56px; 162 | } 163 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item { 164 | width: 250px; 165 | padding: 0; 166 | } 167 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item > .nav-link { 168 | padding: 1em; 169 | } 170 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level, 171 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level { 172 | padding-left: 0; 173 | list-style: none; 174 | } 175 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li, 176 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li { 177 | width: 250px; 178 | } 179 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a, 180 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a { 181 | padding: 1em; 182 | } 183 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a { 184 | padding-left: 2.75em; 185 | } 186 | #mainNav .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a { 187 | padding-left: 3.75em; 188 | } 189 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link { 190 | min-width: 0; 191 | } 192 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link:after { 193 | width: 24px; 194 | text-align: center; 195 | } 196 | #mainNav .navbar-collapse .navbar-nav > .nav-item.dropdown .dropdown-menu > .dropdown-item > .dropdown-message { 197 | max-width: 300px; 198 | } 199 | } 200 | 201 | #mainNav.fixed-top .sidenav-toggler { 202 | display: none; 203 | } 204 | 205 | @media (min-width: 992px) { 206 | #mainNav.fixed-top .navbar-sidenav { 207 | height: calc(100vh - 112px); 208 | } 209 | #mainNav.fixed-top .sidenav-toggler { 210 | position: absolute; 211 | top: 0; 212 | left: 0; 213 | display: flex; 214 | -webkit-flex-direction: column; 215 | -ms-flex-direction: column; 216 | flex-direction: column; 217 | margin-top: calc(100vh - 56px); 218 | } 219 | #mainNav.fixed-top .sidenav-toggler > .nav-item { 220 | width: 250px; 221 | padding: 0; 222 | } 223 | #mainNav.fixed-top .sidenav-toggler > .nav-item > .nav-link { 224 | padding: 1em; 225 | } 226 | } 227 | 228 | #mainNav.fixed-top.navbar-dark .sidenav-toggler { 229 | background-color: #212529; 230 | } 231 | 232 | #mainNav.fixed-top.navbar-dark .sidenav-toggler a i { 233 | color: #adb5bd; 234 | } 235 | 236 | #mainNav.fixed-top.navbar-light .sidenav-toggler { 237 | background-color: #dee2e6; 238 | } 239 | 240 | #mainNav.fixed-top.navbar-light .sidenav-toggler a i { 241 | color: rgba(0, 0, 0, 0.5); 242 | } 243 | 244 | body.sidenav-toggled #mainNav.fixed-top .sidenav-toggler { 245 | overflow-x: hidden; 246 | width: 55px; 247 | } 248 | 249 | body.sidenav-toggled #mainNav.fixed-top .sidenav-toggler .nav-item, 250 | body.sidenav-toggled #mainNav.fixed-top .sidenav-toggler .nav-link { 251 | width: 55px !important; 252 | } 253 | 254 | body.sidenav-toggled #mainNav.fixed-top #sidenavToggler i { 255 | -webkit-transform: scaleX(-1); 256 | -moz-transform: scaleX(-1); 257 | -o-transform: scaleX(-1); 258 | transform: scaleX(-1); 259 | filter: FlipH; 260 | -ms-filter: 'FlipH'; 261 | } 262 | 263 | #mainNav.static-top .sidenav-toggler { 264 | display: none; 265 | } 266 | 267 | @media (min-width: 992px) { 268 | #mainNav.static-top .sidenav-toggler { 269 | display: flex; 270 | } 271 | } 272 | 273 | body.sidenav-toggled #mainNav.static-top #sidenavToggler i { 274 | -webkit-transform: scaleX(-1); 275 | -moz-transform: scaleX(-1); 276 | -o-transform: scaleX(-1); 277 | transform: scaleX(-1); 278 | filter: FlipH; 279 | -ms-filter: 'FlipH'; 280 | } 281 | 282 | .content-wrapper { 283 | overflow-x: hidden; 284 | background: white; 285 | } 286 | 287 | @media (min-width: 992px) { 288 | .content-wrapper { 289 | margin-left: 250px; 290 | } 291 | } 292 | 293 | #sidenavToggler i { 294 | font-weight: 800; 295 | } 296 | 297 | .navbar-sidenav-tooltip.show { 298 | display: none; 299 | } 300 | 301 | @media (min-width: 992px) { 302 | body.sidenav-toggled .content-wrapper { 303 | margin-left: 55px; 304 | } 305 | } 306 | 307 | body.sidenav-toggled .navbar-sidenav { 308 | width: 55px; 309 | } 310 | 311 | body.sidenav-toggled .navbar-sidenav .nav-link-text { 312 | display: none; 313 | } 314 | 315 | body.sidenav-toggled .navbar-sidenav .nav-item, 316 | body.sidenav-toggled .navbar-sidenav .nav-link { 317 | width: 55px !important; 318 | } 319 | 320 | body.sidenav-toggled .navbar-sidenav .nav-item:after, 321 | body.sidenav-toggled .navbar-sidenav .nav-link:after { 322 | display: none; 323 | } 324 | 325 | body.sidenav-toggled .navbar-sidenav .nav-item { 326 | white-space: nowrap; 327 | } 328 | 329 | body.sidenav-toggled .navbar-sidenav-tooltip.show { 330 | display: flex; 331 | } 332 | 333 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav .nav-link-collapse:after { 334 | color: #868e96; 335 | } 336 | 337 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item > .nav-link { 338 | color: #868e96; 339 | } 340 | 341 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item > .nav-link:hover { 342 | color: #adb5bd; 343 | } 344 | 345 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a, 346 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a { 347 | color: #868e96; 348 | } 349 | 350 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a:focus, #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a:hover, 351 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a:focus, 352 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a:hover { 353 | color: #adb5bd; 354 | } 355 | 356 | #mainNav.navbar-dark .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link:after { 357 | color: #adb5bd; 358 | } 359 | 360 | @media (min-width: 992px) { 361 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav { 362 | background: #343a40; 363 | } 364 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav li.active a { 365 | color: white !important; 366 | background-color: #495057; 367 | } 368 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav li.active a:focus, #mainNav.navbar-dark .navbar-collapse .navbar-sidenav li.active a:hover { 369 | color: white; 370 | } 371 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level, 372 | #mainNav.navbar-dark .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level { 373 | background: #343a40; 374 | } 375 | } 376 | 377 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav .nav-link-collapse:after { 378 | color: rgba(0, 0, 0, 0.5); 379 | } 380 | 381 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item > .nav-link { 382 | color: rgba(0, 0, 0, 0.5); 383 | } 384 | 385 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item > .nav-link:hover { 386 | color: rgba(0, 0, 0, 0.7); 387 | } 388 | 389 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a, 390 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a { 391 | color: rgba(0, 0, 0, 0.5); 392 | } 393 | 394 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a:focus, #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level > li > a:hover, 395 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a:focus, 396 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level > li > a:hover { 397 | color: rgba(0, 0, 0, 0.7); 398 | } 399 | 400 | #mainNav.navbar-light .navbar-collapse .navbar-nav > .nav-item.dropdown > .nav-link:after { 401 | color: rgba(0, 0, 0, 0.5); 402 | } 403 | 404 | @media (min-width: 992px) { 405 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav { 406 | background: #f8f9fa; 407 | } 408 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav li.active a { 409 | color: #000 !important; 410 | background-color: #e9ecef; 411 | } 412 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav li.active a:focus, #mainNav.navbar-light .navbar-collapse .navbar-sidenav li.active a:hover { 413 | color: #000; 414 | } 415 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-second-level, 416 | #mainNav.navbar-light .navbar-collapse .navbar-sidenav > .nav-item .sidenav-third-level { 417 | background: #f8f9fa; 418 | } 419 | } 420 | #footer-contents{ 421 | display: table; 422 | margin: 0 auto; 423 | padding: 8px; 424 | font-family: PT serif; 425 | float-left; 426 | } 427 | .card-body-icon { 428 | position: absolute; 429 | z-index: 0; 430 | top: -25px; 431 | right: -25px; 432 | font-size: 5rem; 433 | -webkit-transform: rotate(15deg); 434 | -ms-transform: rotate(15deg); 435 | transform: rotate(15deg); 436 | } 437 | 438 | @media (min-width: 576px) { 439 | .card-columns { 440 | column-count: 1; 441 | } 442 | } 443 | 444 | @media (min-width: 768px) { 445 | .card-columns { 446 | column-count: 2; 447 | } 448 | } 449 | 450 | @media (min-width: 1200px) { 451 | .card-columns { 452 | column-count: 2; 453 | } 454 | } 455 | 456 | .card-login { 457 | max-width: 25rem; 458 | } 459 | 460 | .card-register { 461 | max-width: 40rem; 462 | } 463 | 464 | footer.sticky-footer { 465 | position: absolute; 466 | right: 0; 467 | bottom: 0; 468 | width: 100%; 469 | height: 56px; 470 | background-color: #e9ecef; 471 | line-height: 55px; 472 | } 473 | 474 | @media (min-width: 992px) { 475 | footer.sticky-footer { 476 | width: calc(100% - 250px); 477 | } 478 | } 479 | 480 | @media (min-width: 992px) { 481 | body.sidenav-toggled footer.sticky-footer { 482 | width: calc(100% - 55px); 483 | } 484 | } -------------------------------------------------------------------------------- /templates/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 28 |
29 | -------------------------------------------------------------------------------- /templates/header.html: -------------------------------------------------------------------------------- 1 | 31 | --------------------------------------------------------------------------------