Online Note Share Report Shiv Chaudhary
Online Note Share Report Shiv Chaudhary
PROJECT REPORT
OF MAJOR PROJECT
Submitted by
BRANCH OF STUDY
Of
COMPUTER SCIENCE AND ENGINEERING
KALINGA UNIVERSITY
Village Kotni, Near Mantralaya Naya Raipur (C.G.).
Session July: 2021-2021
DECLARATION
This is to certify that this training report entitled “ONLINE NOTE SHARING” which is submitted by me
in partial fulfillment of the requirement for the completion of Bachelor of Technology (Computer
Science) to Computer Science and Engineering, Kalinga University, Atalnagar (C.G.), comprises my
original work and due acknowledgement has been made in the text to all other material and resources used.
CERTIFICATE OF COMPLETION
CERTIFICATE OF EVALUATION
This is to certify that the undersigned have assessed and evaluated the Report entitled “ONLINE NOTE
SHARING” submitted by the SHIV KUMAR CHAUDHARY KURMI. The Training Report has been
accepted for the partial fulfillment of B. Tech. (CS) program.
……………………………. ………………..................... . .
Signature of the External Examiner Signature of the Internal Examiner
PREFACE
The main objective of any computer science student is to get as much of practical knowledge as possible.
Being able to have a practical knowledge by developing a project is a lifetime experience. As practical
Through the development of the project I had a great experience of various strategies that can be applied in
development of project. This project is the stepping stone for our carrier.
I am pleased to present this project. Proper care has been taken while organizing the project so that it is to
comprehend. Also, various software engineering concepts have been implemented.
ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to my teacher of Computer Science Department as
well as my college Kalinga University for giving me golden opportunity to do this wonderful project on the
topic “ONLINE NOTE SHARE”, which also helped me in doing a lot of research and I came to know so
many new things I am really thankful to them.
Secondly, I would also like to thank my parents and friends who helped me a lot in finalizing this project
within the limited time frame.
Last but not the least, I would hearty thank the almighty for giving me strength to complete my report on
time.
INDEX
1. Introduction
4. System specification
6. Screenshot
7. Reference
INTRODUCTION
The “Online Note Sharing” is web based project designed python programming language. This is website
designed to share the notes over the internet between the different user. This is designed with the help of
Django framework as backend and html, css, javascript and bootstrap as backend. I have used SQLite
database to store the data . This is very beneficial for those universities, institute, collage, etc who share
their notes between the students. On other hand students are also able to share their notes between their
friends.
Most of the colleges, universities, institute, etc. are uses whatapp or any other social media platforms to
share the notes between their students but what for those students who do not use any social media platform
, they won’t get any notes. So to solve this problem this website play important role.
Today in this busy world everyone want to make things easy. Thus there is great challenge of sharing the
notes between the students. The time like this pandemics all the things are shifted towards online so there
needs of such platform where the students as well as teacher can share their notes, here online note sharing
projects comes into the picture. This provide easy and safe way of sharing the notes.
Most of the colleges, universities, etc have problems while sharing the notes or any other files between their
students, partner or any needy people. Sharing the notes or any files using social media is not too safe and
effective that’s why this websites play important role while sharing the notes between the people. Here
students can store their notes for future uses and able to download whenever they want to.
• Online Note Sharing Application deals with borrowing and transferring the notes over the internet.
• It is a WEB-based system especially designed for students of any branch of any college , school , and
universities.
• This system is being produced for students interested in borrowing and giving their own notes for the
free of cost.
• This Project aims for providing the digital platform for the user where they can request notes as per
required and another user of this same platform can supply that notes to the requesting user.
• The general objective of this application is to provide the platform where students can contact the
owner of notes efficiently.
• To provide the platform for the user to connect for the borrowing and donating the notes.
• To ensure that the note circulation is occurred within the user.
Online Note Sharing project is web based application which is developed in python by using Django
framework and SQLite database. It is designed for easy note sharing, user can upload their notes by
creating his/her account. He /she can also able to download the notes uploaded by him/her or others.
Today in this busy world everyone want to make things easy. Thus there is great challenge of sharing the
notes between the students. The time like this pandemics all the things are shifted towards online so there
needs of such platform where the students as well as teacher can share their notes, here online note sharing
projects comes into the picture. This provide easy and safe way of sharing the notes.
Most of the colleges, universities, etc have problems while sharing the notes or any other files between their
students, partner or any needy people. Sharing the notes or any files using social media is not too safe and
effective that’s why this websites play important role while sharing the notes between the people. Here
students can store their notes for future uses and able to download whenever they want to.
SYSTEM SPECIFICATIONS
HARDWARE
o RAM: 4GB
SOFTWARE
o Any Operating System
o Database: SQLite
Framework
o Django
STORAGE
o At least 2 GB for software installation. o Data storage depending upon
organizational setup.
PROCESSOR
o Intel Pentium III, 1GHZ or above.
Methodology/Planning:
First User have to create his/her account.
FRONT END
HTML
CSS
Bootstrap 4
JavaScript
HTML
The Hypertext Markup Language, or HTML is the standard markup language for documents designed to
be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS)
and scripting languages such as JavaScript.
Web browsers receive HTML documents from a web server or from local storage and render the documents
into multimedia web pages. HTML describes the structure of a web page semantically and originally
included cues for the appearance of the document.
HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects
such as interactive forms may be embedded into the rendered page. HTML provides a means to
create structured documents by denoting structural semantics for text such as headings, paragraphs,
lists, links, quotes and other items. HTML elements are delineated by tags, written using angle brackets.
Tags such as <img /> and <input /> directly introduce content into the page. Other tags such
as <p> surround and provide information about document text and may include other tags as sub-elements.
Browsers do not display the HTML tags, but use them to interpret the content of the page.
HTML can embed programs written in a scripting language such as JavaScript, which affects the behavior
and content of web pages. Inclusion of CSS defines the look and layout of content. The World Wide Web
Consortium (W3C), former maintainer of the HTML and current maintainer of the CSS standards, has
encouraged the use of CSS over explicit presentational HTML since 1997.
CSS
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document
written in a markup language such as HTML. CSS is a cornerstone technology of the World Wide Web,
alongside HTML and JavaScript.
CSS is designed to enable the separation of presentation and content, including layout, colors,
and fonts. This separation can improve content accessibility, provide more flexibility and control in the
specification of presentation characteristics, enable multiple web pages to share formatting by specifying the
relevant CSS in a separate .css file which reduces complexity and repetition in the structural content as well
as enabling the .css file to be cached to improve the page load speed between the pages that share the file
and its formatting.
Separation of formatting and content also makes it feasible to present the same markup page in different
styles for different rendering methods, such as on-screen, in print, by voice (via speech-based browser
or screen reader), and on Braille-based tactile devices. CSS also has rules for alternate formatting if the
content is accessed on a mobile device.
The name cascading comes from the specified priority scheme to determine which style rule applies if more
than one rule matches a particular element. This cascading priority scheme is predictable.
The CSS specifications are maintained by the World Wide Web Consortium (W3C). Internet media type
(MIME type) text/css is registered for use with CSS by RFC 2318 (March 1998). The W3C operates a
free CSS validation service for CSS documents.
In addition to HTML, other markup languages support the use of CSS including XHTML, plain XML, SVG,
and XUL.
Bootstrap
Bootstrap is a free and open-source CSS framework directed at responsive, mobile-first front-end
web development. It contains CSS- and (optionally) JavaScript-based design templates
for typography, forms, buttons, navigation, and other interface components.
Bootstrap 4
Mark Otto announced Bootstrap 4 on October 29, 2014. The first alpha version of Bootstrap 4 was released
on August 19, 2015. The first beta version was released on 10 August 2017. Mark suspended work on
Bootstrap 3 on September 6, 2016, to free up time to work on Bootstrap 4. Bootstrap 4 was finalized on
January 18, 2018.
Significant changes include:
Bootstrap 4 supports the latest versions of the Google Chrome, Firefox, Internet Explorer, Opera,
and Safari (except on Windows). It additionally supports back to IE10 and the latest Firefox Extended
Support Release (ESR).
JavaScript
JavaScript often abbreviated as JS, is a programming language that conforms to
the ECMAScript specification. JavaScript is high-level, often just-in-time compiled, and multi-paradigm. It
has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.
Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. Over 97%
of websites use it client-side for web page behavior, often incorporating third-party libraries. All major web
browsers have a dedicated JavaScript engine to execute the code on the user's device.
As a multi-paradigm language, JavaScript supports event-driven, functional, and imperative programming
styles. It has application programming interfaces (APIs) for working with text, dates, regular expressions,
standard data structures, and the Document Object Model (DOM).
The ECMAScript standard does not include any input/output (I/O), such as networking, storage,
or graphics facilities. In practice, the web browser or other runtime system provides JavaScript APIs for I/O.
JavaScript engines were originally used only in web browsers, but they are now core components
of other software systems, most notably servers and a variety of applications.
BACK END
Django framework is used to design this website. Python is use as backend programming languages. These
are described below.
Python
Python is an interpreted high-level general-purpose programming language. Python's design philosophy
emphasizes code readability with its notable use of significant indentation. Its language constructs as well as
its object-oriented approach aim to help programmers write clear, logical code for small and large-scale
projects.
Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms,
including structured (particularly, procedural), object-oriented and functional programming. Python is often
described as a "batteries included" language due to its comprehensive standard library.
Guido van Rossum began working on Python in the late 1980s, as a successor to the ABC programming
language, and first released it in 1991 as Python 0.9.0. Python 2.0 was released in 2000 and introduced new
features, such as list comprehensions and a garbage collection system using reference counting and was
discontinued with version 2.7.18 in 2020.[33] Python 3.0 was released in 2008 and was a major revision of the
language that is not completely backward-compatible and much Python 2 code does not run unmodified on
Python 3.
Python consistently ranks as one of the most popular programming languages
Django (Framework)
Django (/ sometimes stylized as django) is a Python-based free and open-source web framework that
follows the model-template-views (MTV) architectural pattern.[9][10] It is maintained by the Django Software
Foundation (DSF), an American independent organization established as a 501(c)(3) non-profit.
Django's primary goal is to ease the creation of complex, database-driven websites. The framework
emphasizes reusability and "pluggability" of components, less code, low coupling, rapid development, and
the principle of don't repeat yourself.[11] Python is used throughout, even for settings, files, and data models.
Django also provides an optional administrative create, read, update and delete interface that is generated
dynamically through introspection and configured via admin models.
Components
Model.py:
A model is the single, definitive source of information about your data. It contains the essential fields and
behaviors of the data you’re storing. Generally, each model maps to a single database table.
The basics:
Each model is a Python class that subclasses django.db.models.Model.
Each attribute of the model represents a database field.
With all of this, Django gives you an automatically-generated database-access API; see Making queries.
Quick example¶
This example model defines a Person, which has a first_name and last_name:
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
first_name and last_name are fields of the model. Each field is specified as a class attribute, and each
attribute maps to a database column.
The above Person model would create a database table like this:
CREATE TABLE myapp_person (
Using models¶
Once you have defined your models, you need to tell Django you’re going to use those models. Do this by
editing your settings file and changing the INSTALLED_APPS setting to add the name of the module that
contains your models.py.
For example, if the models for your application live in the module myapp.models (the package structure
that is created for an application by the manage.py startapp script), INSTALLED_APPS should read, in
part:
INSTALLED_APPS = [
#...
'myapp',
#...
]
When you add new apps to INSTALLED_APPS, be sure to run manage.py migrate, optionally making
migrations for them first with manage.py makemigrations.
View.py:
A view function, or view for short, is a Python function that takes a Web request and returns a Web
response. This response can be the HTML contents of a Web page, or a redirect, or a 404 error, or an XML
document, or an image . . . or anything, really. The view itself contains whatever arbitrary logic is necessary
to return that response. This code can live anywhere you want, as long as it’s on your Python path. There’s
no other requirement–no “magic,” so to speak. For the sake of putting the code somewhere, the convention
is to put views in a file called views.py, placed in your project or application directory.
A simple view¶
Here’s a view that returns the current date and time, as an HTML document:
from django.http import HttpResponse
import datetime
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
Let’s step through this code one line at a time:
First, we import the class HttpResponse from the django.http module, along with
Python’s datetime library.
Next, we define a function called current_datetime. This is the view function. Each view function takes
an HttpRequest object as its first parameter, which is typically named request.
Note that the name of the view function doesn’t matter; it doesn’t have to be named in a certain way in
order for Django to recognize it. We’re calling it current_datetime here, because that name clearly
indicates what it does.
The view returns an HttpResponse object that contains the generated response. Each view function is
responsible for returning an HttpResponse object. (There are exceptions, but we’ll get to those later.)
Urls.py:
Django has his own way for URL mapping and it's done by editing your project url.py
file (myproject/url.py). The url.py file looks like −
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
#Examples
#url(r'^$', 'myproject.view.home', name = 'home'),
#url(r'^blog/', include('blog.urls')),
url(r'^admin', include(admin.site.urls)),
)
When a user makes a request for a page on your web app, Django controller takes over to look for the
corresponding view via the url.py file, and then return the HTML response or a 404 not found error, if not
found. In url.py, the most important thing is the "urlpatterns" tuple. It’s where you define the mapping
between URLs and views. A mapping is a tuple in URL patterns like −
urlpatterns = patterns('',
#Examples
#url(r'^$', 'myproject.view.home', name = 'home'),
#url(r'^blog/', include('blog.urls')),
url(r'^admin', include(admin.site.urls)),
url(r'^hello/', 'myapp.views.hello', name = 'hello'),
)
The marked line maps the URL "/home" to the hello view created in myapp/view.py file. As you can see
above a mapping is composed of three elements −
The pattern − A regexp matching the URL you want to be resolved and map. Everything that can work
with the python 're' module is eligible for the pattern (useful when you want to pass parameters via url).
The python path to the view − Same as when you are importing a module.
The name − In order to perform URL reversing, you’ll need to use named URL patterns as done in the
examples above. Once done, just start the server to access your view via :http://127.0.0.1/hello
How is it Done?
We need to create an url.py file in myapp using the following code −
urlpatterns = patterns('',
#Examples
#url(r'^$', 'myproject.view.home', name = 'home'),
#url(r'^blog/', include('blog.urls')),
url(r'^admin', include(admin.site.urls)),
url(r'^myapp/', include('myapp.urls')),
)
We have included all URLs from myapp application. The home.html that was accessed through “/hello” is
now “/myapp/hello” which is a better and more understandable structure for the web app.
Now let's imagine we have another view in myapp “morning” and we want to map it in myapp/url.py, we
will then change our myapp/url.py to −
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^hello/', 'myapp.views.hello', name = 'hello'),
url(r'^morning/', 'myapp.views.morning', name = 'morning'),
Page Redirection:
Page redirection is needed for many reasons in web application. You might want to redirect a user to
another page when a specific action occurs, or basically in case of error. For example, when a user logs in
to your website, he is often redirected either to the main home page or to his personal dashboard. In
Django, redirection is accomplished using the 'redirect' method.
The 'redirect' method takes as argument: The URL you want to be redirected to as string A view's name.
The myapp/views looks like the following so far −
def hello(request):
today = datetime.datetime.now().date()
daysOfWeek = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
return render(request, "hello.html", {"today" : today, "days_of_week" : daysOfWeek})
Template System:
Django makes it possible to separate python and HTML, the python goes in views and HTML goes in
templates. To link the two, Django relies on the render function and the Django Template language.
The Render Function
This function takes three parameters −
Request − The initial request.
The path to the template − This is the path relative to the TEMPLATE_DIRS option in the project
settings.py variables.
Dictionary of parameters − A dictionary that contains all variables needed in the template. This variable
can be created or you can use locals() to pass all local variable declared in the view.
Django Template Language (DTL)
Django’s template engine offers a mini-language to define the user-facing layer of the application.
Displaying Variables
A variable looks like this: {{variable}}. The template replaces the variable by the variable sent by the view
in the third parameter of the render function. Let's change our hello.html to display today’s date −
hello.html
<html>
<body>
Hello World!!!<p>Today is {{today}}</p>
</body>
</html>
Then our view will change to −
def hello(request):
today = datetime.datetime.now().date()
return render(request, "hello.html", {"today" : today})
We will now get the following output after accessing the URL/myapp/hello −
Hello World!!!
Today is Sept. 11, 2015
As you have probably noticed, if the variable is not a string, Django will use the __str__ method to display
it; and with the same principle you can access an object attribute just like you do it in Python. For example:
if we wanted to display the date year, my variable would be: {{today.year}}.
Admin Interface:
Django provides a ready-to-use user interface for administrative activities. We all know how an admin
interface is important for a web project. Django automatically generates admin UI based on your project
models.
Starting the Admin Interface
The Admin interface depends on the django.countrib module. To have it working you need to make sure
some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the
myproject/settings.py file.
For INSTALLED_APPS make sure you have −
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
)
For MIDDLEWARE_CLASSES −
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
Before launching your server, to access your Admin Interface, you need to initiate the database −
$ python manage.py migrate
syncdb will create necessary tables or collections depending on your db type, necessary for the admin
interface to run. Even if you don't have a superuser, you will be prompted to create one.
If you already have a superuser or have forgotten it, you can always create one using the following code −
$ python manage.py createsuperuser
Now to start the Admin Interface, we need to make sure we have configured a URL for our admin interface.
Open the myproject/url.py and you should have something like −
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'myproject.views.home', name = 'home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
Now just run the server.
$ python manage.py runserver
And your admin interface is accessible at: http://127.0.0.1:8000/admin/
Once connected with your superuser account, you will see the following screen −
That interface will let you administrate Django groups and users, and all registered models in your app. The
interface gives you the ability to do at least the "CRUD" (Create, Read, Update, Delete) operations on your
models.
Form Processing:
Creating forms in Django, is really similar to creating a model. Here again, we just need to inherit from
Django class and the class attributes will be the form fields. Let's add a forms.py file in myapp folder to
contain our app forms. We will create a login form.
myapp/forms.py
#-*- coding: utf-8 -*-
from django import forms
class LoginForm(forms.Form):
user = forms.CharField(max_length = 100)
password = forms.CharField(widget = forms.PasswordInput())
As seen above, the field type can take "widget" argument for html rendering; in our case, we want the
password to be hidden, not displayed. Many others widget are present in Django: DateInput for
dates, CheckboxInput for checkboxes, etc.
Using Form in a View
There are two kinds of HTTP requests, GET and POST. In Django, the request object passed as parameter
to your view has an attribute called "method" where the type of the request is set, and all data passed via
POST can be accessed via the request.POST dictionary.
Let's create a login view in our myapp/views.py −
#-*- coding: utf-8 -*-
from myapp.forms import LoginForm
def login(request):
username = "not logged in"
if request.method == "POST":
#Get the posted form
MyLoginForm = LoginForm(request.POST)
if MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data['username']
else:
MyLoginForm = Loginform()
<br>
<br>
</center>
</div>
</form>
</body>
</html>
The template will display a login form and post the result to our login view above. You have probably
noticed the tag in the template, which is just to prevent Cross-site Request Forgery (CSRF) attack on your
site.
{% csrf_token %}
Once we have the login template, we need the loggedin.html template that will be rendered after form
treatment.
<html>
<body>
You are : <strong>{{username}}</strong>
</body>
</html>
Now, we just need our pair of URLs to get started: myapp/urls.py
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
urlpatterns = patterns('myapp.views',
url(r'^connection/',TemplateView.as_view(template_name = 'login.html')),
url(r'^login/', 'login', name = 'login'))
When accessing "/myapp/connection", we will get the following login.html template rendered −
On the form post, the form is valid. In our case make sure to fill the two fields and you will get −
In case your username is polo, and you forgot the password. You will get the following message −
class LoginForm(forms.Form):
user = forms.CharField(max_length = 100)
password = forms.CharField(widget = forms.PasswordInput())
def clean_message(self):
username = self.cleaned_data.get("username")
dbuser = Dreamreal.objects.filter(name = username)
if not dbuser:
raise forms.ValidationError("User does not exist in our db!")
return username
Now, after calling the "is_valid" method, we will get the correct output, only if the user is in our database.
If you want to check a field of your form, just add a method starting by "clean_" then your field name to
your form class. Raising a forms.ValidationError is important.
Django settings
A Django settings file contains all the configuration of your Django installation. This document explains
how settings work and which settings are available.
The basics
A settings file is just a Python module with module-level variables.
Here are a couple of example settings:
ALLOWED_HOSTS = ['www.example.com']
DEBUG = False
DEFAULT_FROM_EMAIL = '[email protected]'
Because a settings file is a Python module, the following apply:
It doesn’t allow for Python syntax errors.
It can assign settings dynamically using normal Python syntax. For example:
MY_SETTING = [str(i) for i in range(30)]
It can import values from other settings files.
Designating the settings¶
DJANGO_SETTINGS_MODULE¶
When you use Django, you have to tell it which settings you’re using. Do this by using an environment
variable, DJANGO_SETTINGS_MODULE.
The value of DJANGO_SETTINGS_MODULE should be in Python path syntax, e.g. mysite.settings.
Note that the settings module should be on the Python import search path.
The django-admin utility¶
When using django-admin, you can either set the environment variable once, or explicitly pass in the
settings module each time you run the utility.
Example (Unix Bash shell):
export DJANGO_SETTINGS_MODULE=mysite.settings
django-admin runserver
Example (Windows shell):
set DJANGO_SETTINGS_MODULE=mysite.settings
django-admin runserver
Use the --settings command-line argument to specify the settings manually:
django-admin runserver --settings=mysite.settings
On the server (mod_wsgi)¶
In your live server environment, you’ll need to tell your WSGI application what settings file to use. Do that
with os.environ:
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
Read the Django mod_wsgi documentation for more information and other common elements to a Django
WSGI application.
Default settings¶
A Django settings file doesn’t have to define any settings if it doesn’t need to. Each setting has a sensible
default value. These defaults live in the module django/conf/global_settings.py.
Here’s the algorithm Django uses in compiling settings:
Load settings from global_settings.py.
Load settings from the specified settings file, overriding the global settings as necessary.
Note that a settings file should not import from global_settings, because that’s redundant.
Seeing which settings you’ve changed¶
The command python manage.py diffsettings displays differences between the current settings file and
Django’s default settings.
For more, see the diffsettings documentation.
Using settings in Python code¶
In your Django apps, use settings by importing the object django.conf.settings. Example:
from django.conf import settings
if settings.DEBUG:
# Do something
Note that django.conf.settings isn’t a module – it’s an object. So importing individual settings is not
possible:
from django.conf.settings import DEBUG # This won't work.
Also note that your code should not import from either global_settings or your own settings
file. django.conf.settings abstracts the concepts of default settings and site-specific settings; it presents a
single interface. It also decouples the code that uses settings from the location of your settings.
Altering settings at runtime¶
You shouldn’t alter settings in your applications at runtime. For example, don’t do this in a view:
from django.conf import settings
Security¶
Because a settings file contains sensitive information, such as the database password, you should make
every attempt to limit access to it. For example, change its file permissions so that only you and your Web
server’s user can read it. This is especially important in a shared-hosting environment.
Available settings¶
For a full list of available settings, see the settings reference.
Creating your own settings¶
There’s nothing stopping you from creating your own settings, for your own Django apps, but follow these
guidelines:
Setting names must be all uppercase.
Don’t reinvent an already-existing setting.
For settings that are sequences, Django itself uses lists, but this is only a convention.
Using settings without setting DJANGO_SETTINGS_MODULE¶
In some cases, you might want to bypass the DJANGO_SETTINGS_MODULE environment variable.
For example, if you’re using the template system by itself, you likely don’t want to have to set up an
environment variable pointing to a settings module.
In these cases, you can configure Django’s settings manually. Do this by calling:
django.conf.settings.configure(default_settings, **settings)¶
Example:
from django.conf import settings
settings.configure(DEBUG=True)
Pass configure() as many keyword arguments as you’d like, with each keyword argument representing a
setting and its value. Each argument name should be all uppercase, with the same name as the settings
described above. If a particular setting is not passed to configure() and is needed at some later point,
Django will use the default setting value.
Configuring Django in this fashion is mostly necessary – and, indeed, recommended – when you’re using a
piece of the framework inside a larger application.
Consequently, when configured via settings.configure(), Django will not make any modifications to the
process environment variables (see the documentation of TIME_ZONE for why this would normally
occur). It’s assumed that you’re already in full control of your environment in these cases.
Custom default settings¶
If you’d like default values to come from somewhere other than django.conf.global_settings, you can pass
in a module or class that provides the default settings as the default_settings argument (or as the first
positional argument) in the call to configure().
In this example, default settings are taken from myapp_defaults, and the DEBUG setting is set to True,
regardless of its value in myapp_defaults:
settings.configure(default_settings=myapp_defaults, DEBUG=True)
The following example, which uses myapp_defaults as a positional argument, is equivalent:
settings.configure(myapp_defaults, DEBUG=True)
Normally, you will not need to override the defaults in this fashion. The Django defaults are sufficiently
tame that you can safely use them. Be aware that if you do pass in a new default module, it
entirely replaces the Django defaults, so you must specify a value for every possible setting that might be
used in that code you are importing. Check in django.conf.settings.global_settings for the full list.
Either configure() or DJANGO_SETTINGS_MODULE is required¶
If you’re not setting the DJANGO_SETTINGS_MODULE environment variable,
you must call configure() at some point before using any code that reads settings.
If you don’t set DJANGO_SETTINGS_MODULE and don’t call configure(), Django will raise
an ImportError exception the first time a setting is accessed.
If you set DJANGO_SETTINGS_MODULE, access settings values somehow, then call configure(),
Django will raise a RuntimeError indicating that settings have already been configured. There is a
property for this purpose:
For example:
from django.conf import settings
if not settings.configured:
settings.configure(myapp_defaults, DEBUG=True)
Also, it’s an error to call configure() more than once, or to call configure() after any setting has been
accessed.
It boils down to this: Use exactly one of either configure() or DJANGO_SETTINGS_MODULE. Not
both, and not neither.
Calling django.setup() is required for “standalone” Django usage¶
If you’re using components of Django “standalone” – for example, writing a Python script which loads
some Django templates and renders them, or uses the ORM to fetch some data – there’s one more step
you’ll need in addition to configuring settings.
After you’ve either set DJANGO_SETTINGS_MODULE or called configure(), you’ll need to
call django.setup() to load your settings and populate Django’s application registry. For example:
import django
from django.conf import settings
from myapp import myapp_defaults
settings.configure(default_settings=myapp_defaults, DEBUG=True)
django.setup()
# Now this script or any imported module can use any part of Django it needs.
from myapp import models
Note that calling django.setup() is only necessary if your code is truly standalone. When invoked by your
Web server, or through django-admin, Django will handle this for you.
1. Login Module
2. Home module
3. Contact Module
9. User Home
Home page:
1. This is the page which user see when the open the website.
About Page:
Contact Page:
This is the page where user get all information to establish communication with the
developer.
Login Module:
• All the user can login through this login user name and password.
Admin Page:
Admin Login:
User SignUp:
• He/she can create his account using their email , username, user type , branch , course .
Upload Notes:
Here user can upload the notes just by filling following requirements.
View Notes:
Edit Profile:
REFERENCE
• www.google.com
• www.Wikipedia.com
• Udemy learning website
• Hub It computer solution institude, Butwal ,Nepal.
THANK
YOU