Re: Urgent help

2021-02-25 Thread Anirudh choudhary
Hello everyone
 So The possible Solution
Could be

for python:

arr = 

for i in arr:
if i % 10 == 3:
  print(i)


for java

int[] arr = new int[10]; // Suppose you have 10 element in your array if
you want dynamic array use ArrayList

for(int i : arr){
   if(i % 10 == 3){
  System.out.println(i);

This Solution will Only work for the positive element.


Thank You



On Thu, Feb 25, 2021 at 9:44 PM Kasper Laudrup 
wrote:

> On 25/02/2021 16.59, Nagaraju Singothu wrote:
> > Write a program to find the number ends with digit 3 in a array,
> >
> > For example for a array input [6,83,12,54,71,44,293,43,66,13,72,42,163],
> > the output should be 83, 293, 43, 13, 163 - all numbers ends with digit
> 3.
> >
>
> It's probably just my lack of imagination, but I have a very hard time
> seeing how such an algorithm could end up as a calendar widget, but
> please do enlighten us.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/04e4e878-7bdf-9aba-31a9-21aa8627f1c1%40stacktrace.dk
> .
>

-- 
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/CAL8_rkHaZhFvCF_ByJUEFEcgp-6EiLANRDSP0dcR_TjLUGDyBg%40mail.gmail.com.


Looking For Internship

2020-08-25 Thread Anirudh choudhary
Hello Everyone

I am Anirudh Malik BTech Mechatronics 4th Year Student. I am Currently
Looking For an internship in Good Company as a remote intern or developer.
I have attached my resume


 I have Worked With Technology like Django, React Js, Reach FrameWork,
AJax,  Electron js, HTML5, and css3 and Cloud platform Technology I Know
are Amazon Bucket, EC2, Google Storage, Cloud Run, VM instance

-- 
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/CAL8_rkEdnt3caG1%2Bmigwi5so1Fu4t6MgkWdERyrxaR81M5NmPg%40mail.gmail.com.


google Format resume for Delhi .pdf
Description: Adobe PDF document


Re: Site not Secure only on Google Chrome

2020-07-26 Thread Anirudh choudhary
Yes I it have lot of  javascript and lot to rest framework .. thanks if
your like my website and my work


On Sun, 26 Jul, 2020, 11:21 PM Kovy Jacob,  wrote:

> I don’t know how to fix that, but I checked out the site on safari - it
> looks REALLY cool! Its really cool you made that with Django!
>
> On Jul 26, 2020, at 11:07 AM, Anirudh choudhary <
> anirudhchoudary...@gmail.com> wrote:
>
> Hello everyone
>
> I hosted my app on Heroku. when is try to access
> www.apnaganna.herokuapp.com it show me secure but when I try to access
> https://www.apnaganna.com on google chrome it shows me not secure. but on
> any other browser like Opera, Mozilla, IE it is showing me unsecured only
> in google chrome it is showing unsecured. I am using Automatic certs on
> Heroku  and my domain in on Godaddy
>
> any solution to the problem
>
>
> Step I have taken:
> 1.cleaning cookies
> 2.when i try curl request like :- curl -vI https://www.apnaganna.com
>
> it shows me :-  SSL: no alternative certificate subject name matches
> target host name 'www.apnaganna.com'
>
> Thankyou
>
>
> --
> 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/CAL8_rkEeZhW-_appFb_KRRAjQepJ%3D11ORZvMYkYh7-1BT0T0qA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAL8_rkEeZhW-_appFb_KRRAjQepJ%3D11ORZvMYkYh7-1BT0T0qA%40mail.gmail.com?utm_medium=email_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/604A6786-557A-44FD-9867-802CE6AAD66F%40gmail.com
> <https://groups.google.com/d/msgid/django-users/604A6786-557A-44FD-9867-802CE6AAD66F%40gmail.com?utm_medium=email_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/CAL8_rkGYDR2q495wNp3L946VfMRj%2BhxqDkguYk6%2Bya0TTxP2%3Dg%40mail.gmail.com.


Site not Secure only on Google Chrome

2020-07-26 Thread Anirudh choudhary
Hello everyone

I hosted my app on Heroku. when is try to access www.apnaganna.herokuapp.com
it show me secure but when I try to access https://www.apnaganna.com on
google chrome it shows me not secure. but on any other browser like Opera,
Mozilla, IE it is showing me unsecured only in google chrome it is showing
unsecured. I am using Automatic certs on Heroku  and my domain in on
Godaddy

any solution to the problem


Step I have taken:
1.cleaning cookies
2.when i try curl request like :- curl -vI https://www.apnaganna.com

it shows me :-  SSL: no alternative certificate subject name matches target
host name 'www.apnaganna.com'

Thankyou

-- 
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/CAL8_rkEeZhW-_appFb_KRRAjQepJ%3D11ORZvMYkYh7-1BT0T0qA%40mail.gmail.com.


Django app to PWA

2020-07-21 Thread Anirudh choudhary
Hello everyone

can anyone share me the link how to make your webpage to Progressive web app

i have tried

django-pwa and other package


Thankyou

-- 
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/CAL8_rkH6u%2BJE1CpGWYYsWPPAnnpS2H71sEXiUBQfTTj8rheqxA%40mail.gmail.com.


Secure Way to send token to javascript

2020-07-21 Thread Anirudh choudhary
Hello everyone

I am Making a website on which I am extracting the data from API using ajax
request. To Secure my API I use restframe.authtoken.when I am using inline
javascript in base.html. I am passing my Token as context data to HTML file
and using it but now I put my javascript in static storage. and now I am
not able to get the Token and I am getting 401 error on ajax request

Someone, please help I want to make API secure and accessible to the user


for more information to get deep about question write back to me

Thanks

-- 
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/CAL8_rkH2fik3sDXvRtg8tf-5Lwkk9sEfAkwWC0f0NxkFLn%2BqTw%40mail.gmail.com.


Re: Login and Registration

2020-07-19 Thread Anirudh choudhary
You can simply do it by manipulating the context data like

context = {
 'form_login':loginform,
 'form_signup' :signupform

 }

Thanks

On Sun, 19 Jul, 2020, 11:10 PM Exactly musty, 
wrote:

> Read the doc or follow MDN tutorial
>
> --
> 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/2aa0a800-6387-43ce-ac1e-385807bd7e44o%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/CAL8_rkEWdKOKHMTzmUDOG0_n0n6XFkdcoPQpjgxLamLeqYoaYA%40mail.gmail.com.


Basic security check

2020-07-05 Thread Anirudh choudhary
Hello everyone
I have deployed a website on heroku
https://apnaganna.herokuapp.com/

What should be my next step to see that my website data is secured.

How to stop unauthorised request to view your django rest api urls

Thanks 

-- 
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/CAL8_rkEHt73tg_NqqNgJs5sH2R19pkSfMTWPjqyS00UXmhKmLQ%40mail.gmail.com.


how to make docker image of your django app

2020-06-17 Thread Anirudh choudhary
I Want to make make a docker image of my Django app using PostgreSQL and
unicorn. but I can't find any good tutorial for reference
please share my link to if you know any good tutorial

My Dockerfile now is like
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
RUN apt install postgresql-client
RUN mkdir postgresqlcode
COPY /private_key/client-cert.pem /private_key/client-cert.pem
COPY /private_key/client-cert.pem /private_key/client-cert.pem
COPY /private_key/client-cert.pem /private_key/client-cert.pem
RUN psql "sslmode=verify-ca sslrootcert=\server-ca.pem \
sslcert=client-cert.pem sslkey=\client-key.pem \
hostaddr=hostaddress \
port=port \
user=postgres dbname=postgres"
COPY . /code/


I know I have to make Django-compose.yml file and I ha

-- 
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/CAL8_rkEBoEuAC7N9XCgDsakOVSsGtM1EM_3bZc9azOL3jPhDjw%40mail.gmail.com.


Connecting gcp cloud SQL instance with django project

2020-05-25 Thread Anirudh choudhary
Hello

I am trying to connect gcp SQL instance with my django project I am
connecting it as

DATABASES = {
   'default':env.db()
}

I am following this guide

https://codelabs.developers.google.com/codelabs/cloud-run-django/index.html?index=..%2F..index#0


It is showing me error that


no such file or directory is the server running locally and accepting
connections on unix domain socket

Can any one help


Thanks you

-- 
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/CAL8_rkHEWWCzWrYtEpkh3D5RHN_Z2DVkNyBb8-QZhtmfz49KpQ%40mail.gmail.com.


Re: required help to save SECRET_KEY and Third party Private API key

2020-05-19 Thread Anirudh choudhary
thanks for your answer

after your answer, I have tried to edit the ~/.profile file and
/etc/profile/ but still, I can't see my key inside my VM instance

i am putting

SECRET_KEY="jhsgdjadtad876s87dsadsad7sa"

in the above file .but when i run the command "env" i can see my key

thankyou

On Tue, May 19, 2020 at 10:54 AM Akshat Zala  wrote:

> You can refer the link below:
>
> 1. https://cloud.google.com/community/tutorials/secrets-manager-python
>
> On Tuesday, 19 May 2020 10:26:17 UTC+5:30, Anirudh choudhary wrote:
>>
>> Hello everyone
>>
>> I am hosting my website on google cloud platform on Ubuntu VM instance. I
>> cannot find a way to set the environment variable in the machine
>>
>> Like when I type on my local machine os.environ.get("SECRET_KEY") it give
>> me the key but when I type the same command on VM instance it shows me null
>>
>> I have tried some method like to edit the
>> 1./etc/environment
>> 2.~/.bashrc
>> but none of the files is giving me the secret Key
>>
>> waiting for expert answer
>>
>> thankyou
>>
> --
> 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/0e4dbe3c-7b38-4e61-8e64-f96dc2c44dd3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0e4dbe3c-7b38-4e61-8e64-f96dc2c44dd3%40googlegroups.com?utm_medium=email_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/CAL8_rkHAv1qmfW%3DzWao92cHs2jDFsSGNEv21Fg%3D6FF%3DAo8PjuA%40mail.gmail.com.


required help to save SECRET_KEY and Third party Private API key

2020-05-18 Thread Anirudh choudhary
Hello everyone

I am hosting my website on google cloud platform on Ubuntu VM instance. I
cannot find a way to set the environment variable in the machine

Like when I type on my local machine os.environ.get("SECRET_KEY") it give
me the key but when I type the same command on VM instance it shows me null

I have tried some method like to edit the
1./etc/environment
2.~/.bashrc
but none of the files is giving me the secret Key

waiting for expert answer

thankyou

-- 
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/CAL8_rkGKMhR-OVF4f_nC5dQHPShnkfRTLu9XgO%3D-0DwLfAup_g%40mail.gmail.com.


Re: hosting django app on app engine

2020-04-23 Thread Anirudh choudhary
You can host your website on Google vm  instance , heroku or python
anywhere
For hosting on heroku try :-
https://www.codingforentrepreneurs.com/blog/go-live-with-django-project-and-heroku/

For hosting on pythonanywhere .com
Try any tutorial from.youtube

On Thu, 23 Apr, 2020, 12:18 AM VenkataSivaRamiReddy, <
vennavenkat...@gmail.com> wrote:

> Hi can you share any reference link. I am looking for deploy my djanago
> application but I don't know how to deploy
>
> On Wed, Apr 22, 2020, 18:44 Anirudh choudhary <
> anirudhchoudary...@gmail.com> wrote:
>
>> hi to all! I am hosting my blogging app on google app engine in a
>> standard environment. the website deploys successfully. but when I try to
>> go to any other URL like anirudhmalik.in to anirudhmalik/blog/list/ it
>> shows me 500 server error on the server side I am using PostgreSQL instance
>> and the logs message only show me the error
>> projects/anirudhmalik-274008/logs/appengine.googleapis.com%2Frequest_log"
>>
>>
>> but I couldn't get any hint from this message and none of the post
>> requests is
>> working on the website and everything is working fine in a local server
>> or my local machine
>>
>> you can check the website on anirudhmalik.in
>>
>> and you can also give suggestion is google app engine is good to host
>> your Django project
>> and other cheap college student type hosting service
>> thankyou
>>
>>
>> main.py
>>
>> from annyportfolio.wsgi import application
>>
>> app=application
>>
>> app.yaml file
>>
>> runtime: python37
>>
>> handlers:
>> # This configures Google App Engine to serve the files in the app's static
>> # directory.
>> - url: /static
>> static_dir: static-storage/
>>
>>
>> # This handler routes all requests not caught above to your main app. It
>> is
>> # required when static routes are defined, but can be omitted (along with
>> # the entire handlers section) when there are no static files defined.
>>
>> - url: /.*
>> secure: always
>> redirect_http_response_code: 301
>> script: auto
>>
>>
>>
>> env_variables:
>> DJANGO_SETTINGS_MODULE: annyportfolio.settings
>>
>>
>>
>> --
>> 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/CAL8_rkG8qwM491qCcX18qgukA_ao4_ZjH8%2B-K01m17vOTcTTNw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAL8_rkG8qwM491qCcX18qgukA_ao4_ZjH8%2B-K01m17vOTcTTNw%40mail.gmail.com?utm_medium=email_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/CAGiJVX3tOsLwGxuvU_TXCPhb0-xZej8xm8SB4KnDdqEZgsZSQQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGiJVX3tOsLwGxuvU_TXCPhb0-xZej8xm8SB4KnDdqEZgsZSQQ%40mail.gmail.com?utm_medium=email_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/CAL8_rkGXxgUr_Fjzv5KJAwHq1NPXyMQPRoN-fj9HMPZXn-o7sw%40mail.gmail.com.


hosting django app on app engine

2020-04-22 Thread Anirudh choudhary
hi to all! I am hosting my blogging app on google app engine in a standard
environment. the website deploys successfully. but when I try to go to any
other URL like anirudhmalik.in to anirudhmalik/blog/list/ it shows me 500
server error on the server side I am using PostgreSQL instance and the logs
message only show me the error
projects/anirudhmalik-274008/logs/appengine.googleapis.com%2Frequest_log"

but I couldn't get any hint from this message and none of the post requests
is
working on the website and everything is working fine in a local server or
my local machine

you can check the website on anirudhmalik.in

and you can also give suggestion is google app engine is good to host your
Django project
and other cheap college student type hosting service
thankyou


main.py

from annyportfolio.wsgi import application

app=application

app.yaml file

runtime: python37

handlers:
# This configures Google App Engine to serve the files in the app's static
# directory.
- url: /static
static_dir: static-storage/


# This handler routes all requests not caught above to your main app. It is
# required when static routes are defined, but can be omitted (along with
# the entire handlers section) when there are no static files defined.

- url: /.*
secure: always
redirect_http_response_code: 301
script: auto



env_variables:
DJANGO_SETTINGS_MODULE: annyportfolio.settings

-- 
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/CAL8_rkG8qwM491qCcX18qgukA_ao4_ZjH8%2B-K01m17vOTcTTNw%40mail.gmail.com.


Can't find the .sql file when config the MySQL as backend server

2020-04-02 Thread Anirudh choudhary


-- 
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/CAL8_rkGVzh_ONQDyhurzGv7J3bhdNqxWhWS-cyUkt6fi71r%2BSg%40mail.gmail.com.


Re: Looking for internship

2019-12-22 Thread Anirudh choudhary
Bhai kya copy paste kar diya kya


On Sun, 22 Dec, 2019, 2:24 PM Deepak Singh, 
wrote:

> Hello all
>
> I am looking for internship in Delhi or pune. I am currently in final year
> of engineering from computer science. I am ready to work as part time ,
> full time, home based.
>
> Thankyou
>
> --
> 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/CAOjV4wEOyY8i3cr%3DqB1hjT54vDqT%2BsCMZCpP-L-Z4dtO-RSsGA%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/CAL8_rkGLwXdckJpcEHCwHMARvH-hP5obz2DpGUOiawwaOmD%3DLA%40mail.gmail.com.


Looking for internship

2019-12-10 Thread Anirudh choudhary
Hello all
I am looking for internship in Delhi or pune. I am currently in 6 sem of
engineering mechatronics in ADYPU.
I am ready to work as part time , full time, home based.
Thankyou

-- 
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/CAL8_rkFJ7G2m5h-uO_TerHm%2B_Apb%3DMPp%2BsevvgWx4t0Xr8wZuA%40mail.gmail.com.


Re: Can we make 1 function to check the objects need update and update them

2018-08-30 Thread Anirudh choudhary
I have read it already and the best I found from the documentation is the 
signals but signals only save when save command is given and it is manually 

On Thursday, August 30, 2018 at 12:19:17 PM UTC+5:30, Mikhailo Keda wrote:
>
> Check Django documentation https://docs.djangoproject.com/en/2.1/
>

-- 
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/7968bced-1a38-442f-93d8-9469a9fff5ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with mi first hello world please problems with urls

2018-08-30 Thread Anirudh choudhary
if you understand English then use include() in your mysite.urls.py 
which is in from django.urls import include

On Wednesday, August 22, 2018 at 10:31:19 PM UTC+5:30, Dario Coronel wrote:
>
> El problema que tengo es el siguiente soy un novato recien conociendo el 
> mundo de python y django estaba siguiendo los pasos de la documentacion 
> para crear una primera aplicacion consegui instalr django y craer con 
> startproject un projecti inicial sin problemas, mi primer problema se 
> presenta cuando configuro las urls al crear con el $python manage.py 
> startapp polls dichos archivos sigo los pasos hasta donde en el archivo 
> polls/views.py  se incrusta el siguiente codigo 
>
>
> polls/views.py
>  from django.http import HttpResponse
>
>
> def index(request):
> return HttpResponse("Hello, world. You're at the polls index.")
>
> luego sigue
> crear un archivo urls.py en el mismo directorio
>
> polls/
> __init__.py
> admin.py
> apps.py
> migrations/
> __init__.py
> models.py
> tests.py
> urls.py
> views.py
>
>
> luego sigue incrustar el codigo en el archivo
>
>
> polls/urls.py
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('', views.index, name='index'),
> ]
>
> seguido de agregar el siguiente codigo al siguiente directorio
>
> mysite/urls.py
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> De ahi en teoria al ejecutar en la consola $python manage.py runserver debria 
> de poder ver el hola mundo y solo me da el error de 
>
> Not Found
>
> The requested URL / was not found on this server.
>
>
>
> cual seria mi error agradecreia mucho una ayuda.
>
>

-- 
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/fb4c03f1-8d23-4ca0-bb11-b0a0a9ba1145%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Base Views error importing articles.models

2018-08-30 Thread Anirudh choudhary
this error means that the module articles is not in the articels and file 
name models. you may be getting this error because of spelling 

On Monday, August 27, 2018 at 7:05:43 PM UTC+5:30, Sandy Leon wrote:
>
> Hello everyone,
>
> I am trying to add another simple 'home' page to my website which is at 
> this point
> just the basic site after you finish the tutorial. I am following the 
> 'Base Views' documentation but keep getting an error when trying to import 
> 'from articles.models import Articles' the error 
> reads ModuleNotFoundError: No module named 'articles'
>
> Any help with this would be greatly appreciated!
>

-- 
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/ae5a5ba3-a67f-4093-b8b7-164c7f96d265%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can we make 1 function to check the objects need update and update them

2018-08-30 Thread Anirudh choudhary
I am Writing the program which will collect all the content and display it 
and I want this to be robust but i am not able to find in documentation 
related 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/3a46800f-9c74-4b50-af0e-0542224f3f49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


User is not working as foreign Key after the Custom model

2018-08-15 Thread Anirudh choudhary

I have try every thing like (settings.AUTH_USER_MODEL and get_user-model() 
, User importing from accounts app but when i create hero i always get User 
as None)
#this is my hero app models file
from django.db import models
from django.conf import settings
from accounts.models import User
from django.contrib.auth import get_user_model
from django.db.models.signals import pre_save
# Create your models here.
User = settings.AUTH_USER_MODEL

class Hero(models.Model):
user = models.ForeignKey(User ,null=True , blank = True , on_delete
=models.CASCADE)
name = models.CharField(max_length=239 , null=True , blank=True)

def __str__(self):
return str(self.user)

#this is my custom User model file:
from django.db import models
from django.contrib.auth.models import AbstractBaseUser,BaseUserManager

class UserManager(BaseUserManager):
def create_user(self, email, full_name=None , password = None , is_active = 
True , is_staff = False , is_admin = False):
if not email:
raise ValueError("User must have a email id to SIGN IN")
if not password:
raise ValueError("User MUST PUT PASSWORD")
user_obj = self.model(
email = self.normalize_email(email),
full_name = full_name,
)
user_obj.set_password(password)
user_obj.staff = is_staff
user_obj.active = is_active
user_obj.admin = is_admin
user_obj.save(using = self._db)
return user_obj

def create_staffuser(self , email , password = None,full_name=None):
user = self.create_user(
email,
password=password,
full_name=full_name,
is_staff=True,
)
user.save(using = self._db)
return user

def create_superuser(self , email , password = None,full_name=None):
user = self.create_user(
email,
password=password,
full_name=full_name,
is_admin=True,
is_staff=True,
)
user.save(using = self._db)
print(user)
return user

class User(AbstractBaseUser):
email = models.EmailField(max_length = 255,unique = True)
full_name = models.CharField(max_length = 255,blank = True,null = True)
active = models.BooleanField(default= True)
staff = models.BooleanField(default = False)
admin = models.BooleanField(default=False)
timestamp = models.DateTimeField(auto_now_add=True)

USERNAME_FIELD = 'email'

objects = UserManager()
REQUIRED_FIELDS = ['full_name']

def __str__(self):
return str(self.email)

def get_full_name(self):
if self.full_name:
return self.full_name
return self.email


def get_short_name(self):
return self.email

def has_perm(self , perm , obj=None):
return True

def has_module_perms(self , app_label):
return True 

@property
def is_staff(self):
return self.staff

@property
def is_admin(self):
return self.admin

@property
def is_active(self):
return self.active

#this is admin.py file in custom USer:

from django.contrib import admin
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from accounts.models import User
from .forms import UserAdminChangeForm,UserAdminCreationForm
from django.contrib.auth import get_user_model


# Register your models here.

class UserAdmin(admin.ModelAdmin):
add_form = UserAdminChangeForm #update View
form = UserAdminCreationForm #creation form

list_display = ("email" ,"admin")
list_filter = ("admin","staff","active")
fieldsets = (
(None , {'fields':('email','password1','password2')}),
('Personal Info', {'fields':("full_name",)}),
('Permissions',{"fields":("admin","active","staff")}),
)

add_fieldsets = (
(None ,{
'classes':('wide',),
'fields':('email','password1','password2')}
),
)
search_fields = ("email",)
ordering = ('email',)
filter_horizontal = ()


admin.site.register(User,UserAdmin)

admin.site.unregister(Group)


#and last this is the settings.py file in project:

"""
Django settings for pricealert project.

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

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

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/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__)))
TEMPLATE_DIR = os.path.join(BASE_DIR , 'templates')
STATIC_DIR = os.path.join(BASE_DIR , 'static')
MEDIA_DIR = os.path.join(BASE_DIR , 'media')

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


# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '7m_*98)!hicsm912u%-7@n=n!63r@ax72xm6b@y*v99dp9!l43'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#installed app
'accounts',
'store',
'alert',
'items',
'hero',
]

AUTH_USER_MODEL = 'accounts.User'

MIDDLEWARE = [

Re: Help

2018-07-08 Thread Anirudh choudhary

>
> HI Umar kambala 

 Indentation means if we consider a case to use a if loop then i can be 
written like 

if(condition):
   do this
else:
   else do this 

if you getting this error it may you have used the wrong syntax

Thank You
 

-- 
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/bc6d979d-180d-488c-af20-12f79159dc69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reverse for 'single' with keyword arguments '{'slug': 'sdas'}' not found. 1 pattern(s) tried: ['groups\\/posts\\/in\\/(?P[0-9]+)$']

2018-07-08 Thread Anirudh choudhary
hi I to all the to all who sees this male I am trying one project in which 
everything  is good but when I call something from using slug I got this 
error

Here are my models.py,HTML and HTML while in which I am calling and urls.py 
in groups directories 
/**---+++-+***
from django.urls import path

from groups import views


app_name = 'groups'

urlpatterns = [
path("", views.ListGroups.as_view(), name="all"),
path("new/", views.CreateGroup.as_view(), name="create"),
path("posts/in/",views.SingleGroup.as_view(),name="single"),
path("join/",views.JoinGroup.as_view(),name="join"),
path("leave/",views.LeaveGroup.as_view(),name="leave"),
]

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><**-+**-++
{% extends "groups/group_base.html" %}
{% block pregroup %}


{% if user.is_authenticated %}

Welcome back

@{{user.username}}


{% endif %}
Groups

Welcome to the Groups Page! Select a Group with a shared interest!

{% if user.is_authenticated %}

 Create New Group!
{% endif %}

{% endblock %} {% block group_content %}


{% for group in object_list %}

{{ group.name }}

{{ group.description|safe }}


{{ group.members.count }} member{{ 
group.members.count|pluralize }}


{{ group.posts.count }} post{{ 
group.posts.count|pluralize }}




{% endfor %}


{% endblock %}

<><><><><>><><><><><><><><><><><><><><><><><><><><><<<><><><><><><><><<>><><><><><><><><><><><><><><><><><><><><><><><
from django.db import models
from django.utils.text import slugify
from django.conf import settings
from django.urls import reverse
from django.contrib.auth import get_user_model
from django import template
# Create your models here.
User = get_user_model()
register = template.Library()


class Group(models.Model):
name = models.CharField(max_length = 200 , unique = True, verbose_name = 'Enter 
You Name ' )
slug = models.SlugField(allow_unicode=True , unique = True)
description = models.TextField(blank=True, default='')
description_html = models.TextField(editable=False, default='', blank=True)
members = models.ManyToManyField(User,through="GroupMembers")

def __str__(self):
return self.name

def save(self,*args,**kwargs):
self.slug = slugify(self.name)
super().save(*args,**kwargs)

def get_absolute_url(self):
return reverse("groups:single",kwargs={"slug":self.slug})

class Meta:
ordering = ["name"]


class GroupMembers(models.Model):
group = models.ForeignKey(Group,on_delete = models.CASCADE , related_name=
'memberships')
user = models.ForeignKey(User , on_delete = models.CASCADE , related_name=
'user_groups')

def __str__(self):
return self.user

class Meta:
unique_together = ('group' , 'user')



#and the error i am getting is :

Environment: Request Method: GET Request URL: http://127.0.0.1:8000/groups/ 
Django Version: 2.0.2 Python Version: 3.6.4 Installed Applications: 
['accounts', 'groups', 'posts', 'django.contrib.admin', 
'django.contrib.auth', 'django.contrib.contenttypes', 
'django.contrib.sessions', 'django.contrib.messages', 
'django.contrib.staticfiles', 'bootstrap4'] Installed 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'] Template error: 
In template 
C:\Users\anny\Desktop\social_clone4\social_clone\socialclone\templates\base.html,
 
error at line 12 Reverse for 'single' with keyword arguments '{'slug': 
'sdas'}' not found. 1 pattern(s) tried: 
['groups\\/posts\\/in\\/(?P[0-9]+)$'] 2 :  3 :  
4 :  5 : https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css; 
6 : 
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
 
7 : crossorigin="anonymous"> 8 : https://code.jquery.com/jquery-3.3.1.slim.min.js"; 
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
 
9 : crossorigin="anonymous"> 10 : https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"; 
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
 
11 : crossorigin="anonymous"> 12 : https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"; 
integrity="sha384-smHYKdLADwkXOn 1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp 
0Mk8ck+5T" 13 : crossorigin="anonymous"> 14 :  15 :  16 : Simple 
Social 17 :  18 :  19 :  20 :  21 :  22 :  Traceback: File 
"C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" 
in 

Re: help

2018-07-06 Thread Anirudh choudhary
Add on_delete = models.CASCADE
 EVERY WHERE YOU ARE USING FOREIGN KEY

On Fri, 6 Jul 2018, 4:43 p.m. Umar Kambala,  wrote:

> please this the error i got when i run python manage.py makemigrations
>
>  File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
> line 371, in execute_from_command_line
> utility.execute()
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
> line 347, in execute
> django.setup()
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py",
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py",
> line 112, in populate
> app_config.import_models()
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py",
> line 198, in import_models
> self.models_module = import_module(models_module_name)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py",
> line 10, in 
> class Topic (models.Model):
>   File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py",
> line 13, in Topic
> board = models.ForeignKey(Board, related_name='topics')
> TypeError: __init__() missing 1 required positional argument: 'on_delete'
>
>
> this are the codes
>
> from django.db import models
> from django.contrib.auth.models import User
>
>
> class Board(models.Model):
> name = models.CharField(max_length=30, unique=True)
> description = models.CharField(max_length=100)
>
>
> class Topic (models.Model):
> subject = models.CharField(max_length=255)
> last_updated = models.DateTimeField()
> board = models.ForeignKey(Board, related_name='topics')
> starter = models.ForeignKey(User, related_name='topics')
>
>
> class Post(models.Model):
> message = models.TextField(max_length=4000)
> topic = models.ForeignKey(Topic, related_name='posts')
> created_at = models.DateTimeField(auto_now_add=True)
> updated_at = models.DateTimeField(null=True)
> created_by = models.ForeignKey(User, related_name='posts')
> updated_by = models.ForeignKey(User, null=True, related_name='+')
>
>
> --
> 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/CAPkbFbaHq8Mgz_ZLnmC1EWQmT7FodSbEaWnd7buTcRR85aYTSg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAL8_rkHSc6Y64G_vNqmyFmTj_Nw0%2BROKrvnED-c%3D3A6WbGJHjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.