Re: Why does Django say my login form is invalid? How can I find out why Django thinks it is?

2017-11-30 Thread ankita gupta


On Wednesday, 29 November 2017 08:24:26 UTC+5:30, Tom Tanner wrote:
>
> My `forms.py` looks like this. (I want user's email to be their login 
> username. 
> from django.utils.translation import ugettext_lazy as _
>
> from django import forms
> from django.contrib.auth.forms import AuthenticationForm
> from django.contrib.auth.models import User
>
> class LoginForm(AuthenticationForm):
>  username= forms.EmailField(label=_("Email"), max_length=254)
>
>
>  class Meta:
>  model= User
>  fields= ("username",)
>
> `views.py`:
> def login_register(request, template="pages/login_register.html"):
>  if request.method=="POST":
>   login_form= LoginForm(request.POST)
>   if login_form.is_valid():
>print "Login form valid"
>return redirect(home_slug())
>   # else:
>   #  print "Login invalid"
>  else:
>   login_form= LoginForm()
>  return render(request, template, {"login_form": login_form})
>
>
> `login_register.html`:
>  
>   {% csrf_token %}
>   {{ login_form.as_p }}
>   Log in
>  
>
> The login form accepts two fields labeled "Email" and "Password." But when 
> I hit "Log in" button, the page just seems to refresh. If I uncomment the 
> `print` statement, it prints, indicating that 
> `login_form.is_valid()!=True`. Why does Django do this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c36c350e-2c5f-4439-9a98-d15758f98b2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


convert python 3 to python2

2019-09-21 Thread Ankita Gupta
Not related to Django, I have a project made in python3 but due to some 
package installation, i need to convert my project to python2. Is there any 
method or package to solve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/875549f9-5bca-4280-88fd-db197ca577dc%40googlegroups.com.


openLdap authentication in django

2019-09-22 Thread Ankita Gupta
I am trying to add ldap authentication in my django project using 
(django_python3_ldap) 
after running python manage.py ldap_sync_users i am getting this error 
receive_timeout=settings.LDAP_AUTH_RECEIVE_TIMEOUT,
TypeError: __init__() got an unexpected keyword argument 'receive_timeout'

settings.py 
"""
Django settings for ldap_login project.

Generated by 'django-admin startproject' using Django 2.2.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""

import os



# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'e93h60d73)mo#8x%q8p0=7mu3%t#!qgfp60xw*5z0+%r22n)n!'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django_python3_ldap',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'allauth', # new
'allauth.account', # new
'allauth.socialaccount', # new
'allauth.socialaccount.providers.google', 

   
'pages',
'users',
'crispy_forms',
'bootstrapform',

]
CRISPY_TEMPLATE_PACK = 'bootstrap4'

AUTHENTICATION_BACKENDS = (
"django_python3_ldap.auth.LDAPBackend",
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
 
)

SITE_ID = 1

ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
AUTH_USER_MODEL = 'users.CustomUser'


LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
},
},
"loggers": {
"django_python3_ldap": {
"handlers": ["console"],
"level": "INFO",
},
},
}

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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',
]

ROOT_URLCONF = 'ldap_login.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

WSGI_APPLICATION = 'ldap_login.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# 
https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

 
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'


# The URL of the LDAP server.
LDAP_AUTH_URL = "ldap://lab.gdy.club:389";

# Initiate TLS on connection.
LDAP_AUTH_USE_TLS = False

# The LDAP search base for looking up users.
LDAP_AUTH_SEARCH_BASE = "ou=users,dc=lab,dc=gdy,dc=club"

# The LDAP class that represents a user.
LDAP_AUTH_OBJECT_CLASS = "inetOrgPerson"

# User model fields mapped to the LDAP
# attributes that represent them.
LDAP_AUTH_USER_FIELDS = {
"username": "uid",
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}

# A tuple of django model fields used to uniquely identify a us

openLdap authentication in django

2019-09-22 Thread Ankita Gupta
I am trying to add ldap authentication in my django project using 
(django_python3_ldap) 
after running python manage.py ldap_sync_users i am getting this error 
receive_timeout=settings.LDAP_AUTH_RECEIVE_TIMEOUT,
TypeError: __init__() got an unexpected keyword argument 'receive_timeout'

settings.py 
"""
Django settings for ldap_login project.

Generated by 'django-admin startproject' using Django 2.2.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""

import os



# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'e93h60d73)mo#8x%q8p0=7mu3%t#!qgfp60xw*5z0+%r22n)n!'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django_python3_ldap',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'allauth', # new
'allauth.account', # new
'allauth.socialaccount', # new
'allauth.socialaccount.providers.google', 

   
'pages',
'users',
'crispy_forms',
'bootstrapform',

]
CRISPY_TEMPLATE_PACK = 'bootstrap4'

AUTHENTICATION_BACKENDS = (
"django_python3_ldap.auth.LDAPBackend",
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
 
)

SITE_ID = 1

ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
AUTH_USER_MODEL = 'users.CustomUser'


LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
},
},
"loggers": {
"django_python3_ldap": {
"handlers": ["console"],
"level": "INFO",
},
},
}

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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',
]

ROOT_URLCONF = 'ldap_login.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

WSGI_APPLICATION = 'ldap_login.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# 
https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

 
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'


# The URL of the LDAP server.
LDAP_AUTH_URL = "ldap://lab.gdy.club:389";

# Initiate TLS on connection.
LDAP_AUTH_USE_TLS = False

# The LDAP search base for looking up users.
LDAP_AUTH_SEARCH_BASE = "ou=users,dc=lab,dc=gdy,dc=club"

# The LDAP class that represents a user.
LDAP_AUTH_OBJECT_CLASS = "inetOrgPerson"

# User model fields mapped to the LDAP
# attributes that represent them.
LDAP_AUTH_USER_FIELDS = {
"username": "uid",
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}

# A tuple of django model fields used to uniquely identify a us

Re: convert python 3 to python2

2019-09-22 Thread Ankita Gupta


On Saturday, September 21, 2019 at 11:07:21 PM UTC+5:30, Sipum wrote:
>
> Hi Ankita,
>
> In coming January, python 2 is going to retire. So better to use python 3.
>
Only official access is denied, we can still work in python2. Anyway thanks.

>  
>

> Thanks
>
> On Sat, 21 Sep, 2019, 11:02 PM Ankita Gupta,  > wrote:
>
>> Not related to Django, I have a project made in python3 but due to some 
>> package installation, i need to convert my project to python2. Is there any 
>> method or package to solve this?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/875549f9-5bca-4280-88fd-db197ca577dc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/875549f9-5bca-4280-88fd-db197ca577dc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/408bd2a0-add7-450d-a004-d5fc22bc4b45%40googlegroups.com.


Re: best option for Front End Design in Django

2019-09-26 Thread Ankita Gupta
What is post-man? Can you explain it little more?

On Thu, 26 Sep 2019, 7:13 pm dheeraj technoevanglist, 
wrote:

> Totally agreed Django applies separation of concern so start with html
> basics or make back end first and test it through the post man.
>
> On Thu, Sep 26, 2019, 16:28 Nick Sarbicki 
> wrote:
>
>> Honestly whilst everyone is recommending react/angular etc. I'd argue
>> these are probably the worst places to start. It assumed a lot of up front
>> knowledge and ability in web design.
>>
>> Balaji has strongly suggested that they don't have a good grasp of the
>> basics yet, HTML, CSS and vanilla JavaScript. Throwing out relatively
>> advanced JS solutions does not solve this problem.
>>
>> Balaji I'd recommend picking up some basic knowledge of HTML and CSS
>> first - this will get you started building rudimentary websites and is
>> essential knowledge for practically all web development. You must learn
>> these before anything else.
>>
>> Once you have some understanding of how these work take a basic course in
>> JavaScript - which is what powers most of the modern web (through using
>> HTML and CSS). If you start feeling comfortable with that I'd recommend
>> looking up a framework, React, Angular and Vue are the normal
>> recommendations. I'd personally go with React for the sole reason that it
>> is - comparatively quite simple to pick up (once you understand JavaScript)
>> and also very commonly used with strong community support.
>>
>> In terms of turning this into an app down the road... Apps and web sites
>> are not directly comparable. There are multiple ways of approaching
>> converting a website into an app but most are relatively advanced. I would
>> focus on what you are doing now before thinking about that journey.
>>
>>
>> - Nick
>>
>>
>> On Thu, Sep 26, 2019 at 11:50 AM Pengyu Cao 
>> wrote:
>>
>>> Hey, how about check this,
>>> https://www.similartech.com/compare/angular-js-vs-react-js
>>>
>>> On Thursday, September 26, 2019 at 4:48:30 PM UTC+8, Suraj Thapa FC
>>> wrote:

 React

 On Thu, 26 Sep, 2019, 1:53 PM Balaji Shetty, 
 wrote:

> Hi
>
> Can anybody please tell me what are the different options to create
> GUI (User Interface ) for Front End in Django.
>
> I got answer like Angularjs, Nodejs, HTML5 or CSS.
>
> Which one is easier as well as mobile compatible if we need to develop
> mobile App also.
>
> --
>
>
> *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information
> Technology,*
> *SGGS Institute of Engineering & Technology, Vishnupuri,
> Nanded.MH.India*
> *Official: bssh...@sggs.ac.in *
> *  Mobile: +91-9270696267*
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOtrT638Qv1UFdD-WKiqLr464-%3D5_O7K7vO5rHBo3m9yqg%40mail.gmail.com
> 
> .
>
 --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/2cb3770f-e754-44b2-8ff7-79dac39cd37b%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGuvt90Mde5D6xJt5Sk1WOHwtDqorPrqvHjYn4XR5Z5WNkUTMw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOaDkT4tUr-tAiUmr5iHAKtk_NMyv1mOPccNJ27_W%2BR1JV2heg%40mail.gmail.com
> 
> .
>

-- 
You received t

Weekly Report builder

2019-09-29 Thread Ankita Gupta
I have a blog project, where users posts daily posts. I want to see activity of 
users like weekly report or monthly report..  just like in github we have which 
shows activity of users over time. How can I achieve this? Any guidance is 
appreciable.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f28b98d3-f66d-4a25-9b3a-ba96e87c74b9%40googlegroups.com.


Multi user blog

2019-10-03 Thread Ankita Gupta
Please ignore auto correct errors.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/34915a2d-8715-4e1b-88a1-893ad2c59a48%40googlegroups.com.


Multi user blog

2019-10-03 Thread Ankita Gupta
Does anyone know of a good project mad din django with following requirements.?
Requirements- 
Multiple user can post daily blogs. 
Heirarichal (multi level) users like college level system where users have 
different destinations, be it student, mentor, Dean etc. 
Weekly report management system for ex. Tracking user activity in a week. 
I have wagtail-cms  and django cms but multi level approach is difficult there. 
I am actually short of time. Any suggestions are highly appreciable. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f19896ef-83f1-4b3b-9c4d-3f907aa4de4c%40googlegroups.com.


Multi user blog

2019-10-03 Thread Ankita Gupta
I have tried wagtail-cms but I don't know how to add multiple users and 
heirarichal approach in that. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe23ed29-2560-45ec-a852-19435756ed33%40googlegroups.com.


University management system

2019-10-09 Thread Ankita Gupta
Hello everyone!
I have a project to make on university management system.
BASIC requirements- 
1. Heirarichal mode(multiple users like mentor, student, Dean, advisors etc)
2. Students need to post daily blogs about their progress(if certain task is 
given to them by their mentors). 
3. Blogs will have images, url, links, etc.
4. Discussion forum or maybe comment system in simple language where mentor and 
student can interact over the blog. 
5. Weekly and monthly report generator of student's progress like no. Of blogs, 
how much they were active etc.
6. Mentor provided with grading facility just like we have different emojis on 
Facebook post. 
I want to know if is this possible with any cms because I am very much short of 
time. And I have less practical knowledge of django. I have tried many open 
source projects regarding blog part but couldn't find useful to me. I have to 
submit this project in 1 week. 
Django users, waiting for your valuable response to this thread.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5740d448-d6ad-48b7-a8ab-11bb6a6982ab%40googlegroups.com.


Re: University management system

2019-10-09 Thread Ankita Gupta


On Wednesday, October 9, 2019 at 10:39:27 PM UTC+5:30, Obodoma Uzondu 
Vincent wrote:
>
> Try using the mezzanine plugin for django .
>
Does mezzanine support multiple user and hierarchy system? 

> if you want me to teach you how to use mezzanine you have to pay me.
>
> On Wed, Oct 9, 2019 at 9:54 AM Ankita Gupta  > wrote:
>
>> Hello everyone!
>> I have a project to make on university management system.
>> BASIC requirements- 
>> 1. Heirarichal mode(multiple users like mentor, student, Dean, advisors 
>> etc)
>> 2. Students need to post daily blogs about their progress(if certain task 
>> is given to them by their mentors). 
>> 3. Blogs will have images, url, links, etc.
>> 4. Discussion forum or maybe comment system in simple language where 
>> mentor and student can interact over the blog. 
>> 5. Weekly and monthly report generator of student's progress like no. Of 
>> blogs, how much they were active etc.
>> 6. Mentor provided with grading facility just like we have different 
>> emojis on Facebook post. 
>> I want to know if is this possible with any cms because I am very much 
>> short of time. And I have less practical knowledge of django. I have tried 
>> many open source projects regarding blog part but couldn't find useful to 
>> me. I have to submit this project in 1 week. 
>> Django users, waiting for your valuable response to this thread.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5740d448-d6ad-48b7-a8ab-11bb6a6982ab%40googlegroups.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19ea04e3-ddcb-4123-b620-ebe6a6569484%40googlegroups.com.


Re: University management system

2019-10-09 Thread Ankita Gupta


On Thursday, October 10, 2019 at 12:38:32 AM UTC+5:30, Nitin Kumar wrote:
>
> I can do this for you over the week end, you will have to pay me for that.
>
Thank you for your input, but I am here to learn. It would be really 
helpful if you can answer my queries. Have a good day,

>
>
>
> On Wed, 9 Oct, 2019, 10:24 PM Ankita Gupta,  > wrote:
>
>> Hello everyone!
>> I have a project to make on university management system.
>> BASIC requirements- 
>> 1. Heirarichal mode(multiple users like mentor, student, Dean, advisors 
>> etc)
>> 2. Students need to post daily blogs about their progress(if certain task 
>> is given to them by their mentors). 
>> 3. Blogs will have images, url, links, etc.
>> 4. Discussion forum or maybe comment system in simple language where 
>> mentor and student can interact over the blog. 
>> 5. Weekly and monthly report generator of student's progress like no. Of 
>> blogs, how much they were active etc.
>> 6. Mentor provided with grading facility just like we have different 
>> emojis on Facebook post. 
>> I want to know if is this possible with any cms because I am very much 
>> short of time. And I have less practical knowledge of django. I have tried 
>> many open source projects regarding blog part but couldn't find useful to 
>> me. I have to submit this project in 1 week. 
>> Django users, waiting for your valuable response to this thread.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5740d448-d6ad-48b7-a8ab-11bb6a6982ab%40googlegroups.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/24864e79-25f3-4a6e-97a8-2ef088138be8%40googlegroups.com.


Re: University management system

2019-10-09 Thread Ankita Gupta


On Thursday, October 10, 2019 at 2:51:00 AM UTC+5:30, Jani Tiainen wrote:
>
> Hi.
>
> How realistic, given your requirements, you think you as a developer can 
> implement all that in one week?
>
I know it's not realistic, but I have to do it myself. 

>
> Ok, lets break this down a bit.
>
> Requirement 1 hierarchical users. 
>
 
>
This is rather trivial to do if you don't need fancy ui but can rely on 
> admin facilities.
>
With admin as in group permissions? 

>
> Requirement 2 blogging. If you checkout Django Girls tutorial it gives 
> basis to write one.
>
Yeas, I have started doing that part.

>
> Requirement 3 fancy stuff like images etc in blogs. Now it starts to get 
> tricky. Like how you upload images? How to size and position them? How you 
> add links? Do you want to make sure all user input is safe or do you trust 
> users not to do bad things. This is one of the big requirements which has 
> possibilty to be real time sink. You said that you have checked out some 
> blogs. Why they didn't fit to your requirements?
>
For now, I just want it to work, I can do validation stuff later on. Other 
blogs were very simple, just a paragraph post with no styling nothing 
extra. 

>
> Requirement 4 forums or comments. If you think a bit there is actually 
> very little difference between those two. Both are usually time based and 
> might be hierarchical also.
>
Yeas. 

>
> Requirement 5 reports. This might be one of the simplest things to 
> implement since django orm provides pretty good aggregation support. You 
> just need to figure out what and how you want to represent the data.
>
Okay. I'll check that. Thank you. 

>
> Requirement 6 grading system. Or "rating" fortunately there exists quite 
> many django apps that does this.
>
Can you list some of them? 

>
>
> ke 9. lokak. 2019 klo 19.55 Ankita Gupta  > kirjoitti:
>
>> Hello everyone!
>> I have a project to make on university management system.
>> BASIC requirements- 
>> 1. Heirarichal mode(multiple users like mentor, student, Dean, advisors 
>> etc)
>> 2. Students need to post daily blogs about their progress(if certain task 
>> is given to them by their mentors). 
>> 3. Blogs will have images, url, links, etc.
>> 4. Discussion forum or maybe comment system in simple language where 
>> mentor and student can interact over the blog. 
>> 5. Weekly and monthly report generator of student's progress like no. Of 
>> blogs, how much they were active etc.
>> 6. Mentor provided with grading facility just like we have different 
>> emojis on Facebook post. 
>> I want to know if is this possible with any cms because I am very much 
>> short of time. And I have less practical knowledge of django. I have tried 
>> many open source projects regarding blog part but couldn't find useful to 
>> me. I have to submit this project in 1 week. 
>> Django users, waiting for your valuable response to this thread.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5740d448-d6ad-48b7-a8ab-11bb6a6982ab%40googlegroups.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c958e302-f426-4990-bdee-6b674be67755%40googlegroups.com.


Re: Wagtail or Django CMS or Mez for Web Site

2019-11-24 Thread Ankita Gupta


On Sunday, November 24, 2019 at 11:54:02 PM UTC+5:30, Perceval Maturure 
wrote:
>
> Django cms is much simpler. There is also good documentation to “install 
> Django cms by hand”
>
Hey!
Can we insert django-cms in already made Django based projects.? 
Is this possible.?

>
>
> Sent from my iPhone
>
> On 24 Nov 2019, at 19:52, Balaji Shetty > 
> wrote:
>
> Hi
>
> If I want to develop website in Django.
>
> Which ones I should prefer
> Wagtail or Django CMS or Mez
>
> Kindly reply 
>
>
> -- 
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I&T
> Nanded. My. India
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAECSbOvoCkr0-xweoCMu8%3DUQ5bNHVmh9nk80_ouDsmnG_bzHcg%40mail.gmail.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d99f11a0-0e2e-40e5-bf0c-dbf0622c0383%40googlegroups.com.


Error

2019-11-27 Thread Ankita Gupta
This error is coming again and again.
HINT: Add or change a related_name argument to the definition for 
'User.groups' or 'User.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 
'User.user_permissions' clashes with reverse accessor for 
'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'User.user_permissions' or 'User.user_permissions'.

*settings.py*

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'o-%6fsfg@f$iaci=i(a_5@h&g(_&1%wqe!i^vjj^6^jnpv0n32'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['127.0.0.1']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'account',
'django.contrib.humanize',


]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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',
]

ROOT_URLCONF = 'monitor.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
os.path.join(BASE_DIR, 'result/templates/result'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'monitor.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# 
https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 6,
}
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

AUTH_USER_MODEl = 'account.User'

LOGIN_REDIRECT_URL = '/'

LOGOUT_REDIRECT_URL = '/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'


MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

*models.py*


from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.urls import reverse
from .validators import ASCIIUsernameValidator

class User(AbstractUser):
is_student = models.BooleanField(default=False)
is_mentor = models.BooleanField(default=False)
phone = models.CharField(max_length=60, blank=True, null=True)
address = models.CharField(max_length=60, blank=True, null=True)
picture = models.ImageField(upload_to="pictures/", blank=True, 
null=True)
email = models.EmailField(blank=True, null=True)

username_validator = ASCIIUsernameValidator()

def get_picture(self):
no_picture = settings.STATIC_URL + 'img/img_avatar.png'
try:
return self.picture.url
except:
return no_picture

def get_full_name(self):
full_name = self.username
if self.first_name and self.last_name:
full_name = self.first_name + " " + self.last_name
return full_name

class Student(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
id_number = models.CharField(max_length=20, unique=True)
class_name = models.CharField(max_length=5)

def __str__(self): 
return self.id_number
"""
def get_absolute_url(self):
return reverse('profile')
"""
I have read online it says to add this line in settings.py *AUTH_USER_MODEl 
= 'account.User' *