Re: Django production deployment on my VPS

2018-06-30 Thread Gerardo Palazuelos Guerrero
hi Kamal,
I found this link as part of a django training I did in a udemy course 
(https://www.udemy.com/the-ultimate-beginners-guide-to-django-python-web-dev-website).

Link is:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

I hopes that helps you.
Gerardo.



El 30/06/2018, a la(s) 21:22, Kamal Sharma  escribió:

> Dear Django community,
> 
> I have developed my django application but i am facing problem to deploy it 
> on my "virtual private server". And tutorial of production deployment are 
> making me so confuse so i am unable to deploy it.
> Can you please share with me the steps to deploy my django project on 
> production with VPS.
> 
> Your immediate action will be highly appreciated.
> 
> Thanks
> 
> Kamal Sharma
> -- 
> 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/095a451f-4b0a-49e6-8d2a-baa3f53832c9%40googlegroups.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/AFCC3BE9-B379-430D-9D96-0AD19EB0F298%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django production deployment on my VPS

2018-06-30 Thread Kamal Sharma
Dear Django community,

I have developed my django application but i am facing problem to deploy it 
on my "virtual private server". And tutorial of production deployment are 
making me so confuse so i am unable to deploy it.
Can you please share with me the steps to deploy my django project on 
production with VPS.

Your immediate action will be highly appreciated.

Thanks

Kamal Sharma

-- 
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/095a451f-4b0a-49e6-8d2a-baa3f53832c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database

2018-06-30 Thread Mike Dewhirst
I've used both. If you have a choice use Postgres. 

Mike

Connected by Motorola

ABHISHEK PARMAR <150305105...@paruluniversity.ac.in> wrote:

>Should i use postgres or mysql ?
>
>-- 
>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/CAErr1ZUERxGq26gkkhmPG_1iOdKwvMpHCoZdu2uJEhVhjNLXUQ%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/e060brfnkg2hen7383muowx6.1530400605221%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database

2018-06-30 Thread Mark Phillips
Use whichever one you are more familiar with, unless there is a technical
reason for your specific project to pick one over the other. Familiarity is
important if you are just learning django, as you don't need too many
learning curves at the same time. Sometimes, it is helpful to look at the
tables that django creates to debug a problem. Knowing how to quickly
access the db can be important. Or, sometimes injecting data into the db
can help with debugging. At the end of the day, they are just tools, so use
the one that you like the most. Personally, I prefer a left handed spanner
the most

Mark

On Sat, Jun 30, 2018 at 1:21 PM, Joshua Kayode 
wrote:

> Use postgresql,  but you can find reasons not to!,  the choice between
> MySQL and postgresql is more or less personal! Both have their strengths
> and weakness!
>
> On Jun 30, 2018 14:05, "ABHISHEK PARMAR" <150305105052@paruluniversity.
> ac.in> wrote:
>
>> Should i use postgres or mysql ?
>>
>> --
>> 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/ms
>> gid/django-users/CAErr1ZUERxGq26gkkhmPG_1iOdKwvMpHCoZdu2uJEh
>> VhjNLXUQ%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/CAEL9fCFf4MrrW3mPjXzUqYrwPxjbe
> 29boD6QHPZFALXm3F_gsw%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/CAEqej2O%3DzFjqmpciDCu7ZvHTrsv6rZEVAQthDYQO0dRDdsjGDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database

2018-06-30 Thread Joshua Kayode
Use postgresql,  but you can find reasons not to!,  the choice between
MySQL and postgresql is more or less personal! Both have their strengths
and weakness!

On Jun 30, 2018 14:05, "ABHISHEK PARMAR" <150305105...@paruluniversity.ac.in>
wrote:

> Should i use postgres or mysql ?
>
> --
> 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/CAErr1ZUERxGq26gkkhmPG_1iOdKwvMpHCoZdu2uJEhVhjNLXUQ%
> 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/CAEL9fCFf4MrrW3mPjXzUqYrwPxjbe29boD6QHPZFALXm3F_gsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Cannot add choice filed with radio buttons in my model form using widget but only charfield.

2018-06-30 Thread Saloni Kalra
*post-form.html*
{% extends "posts/post_base.html" %}

{% load bootstrap3 %}

{% block post_content %}
{% if not form.instance.pk %}
Create Post
{% else %}
Update Post
{% endif %}

{% csrf_token %}
{% bootstrap_form form %}


{% endblock %}


*models.py*
from django.conf import settings
from django.urls import reverse
from django.db import models

import misaka

from django.contrib.auth import get_user_model
User = get_user_model()

class Teacher(models.Model):
teacher_name = models.CharField(blank=False, max_length=100,
unique=True, null=False)

def __str__(self):
return self.teacher_name

class Subject(models.Model):
subject_name = models.CharField(blank=False, max_length=100,
unique=True, null=False)

def __str__(self):
return self.subject_name

class Post(models.Model):

user = models.ForeignKey(User, related_name="posts",
on_delete=models.CASCADE)
teacher = models.ForeignKey(Teacher, related_name="posts",
on_delete=models.CASCADE, null = False, blank = False)
subject = models.ForeignKey(Subject, related_name="posts",
on_delete=models.CASCADE, null = False, blank = False)
created_at = models.DateTimeField(auto_now=True)
param1 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The objectives of this course were made clear to me by this
teacher.")
param2 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The teacher speaks, articulates and explains concepts
clearly.")
param3 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The teacher adheres to the timings schedule and enforces
discipline in the class.")
param4 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "Interest generated by the teacher.")
param5 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The lectures were well structured and focused on the
topics.")
param6 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "Accessibility of the teacher in and out of the class.")
param7 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The teacher has fair knowledge on the subject matter.")
param8 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "Effective use of teaching aids.")
param9 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "Time spend on lecturing by teacher for course coverage was
sufficient and lesson plan was followed.")
param10 = models.PositiveIntegerField(blank=False, null=False,
verbose_name = "The teacher encourage students to raise pertinent questions
and answer them.")
average = models.FloatField()
message = models.CharField(blank=False, max_length=100, null=True,
verbose_name = "Anything else you want to say.")

def __str__(self):
return self.teacher.teacher_name

def get_absolute_url(self):
return reverse(
"posts:single",
kwargs={
"username": self.user.username,
"pk": self.pk
}
)

def save(self, *args, **kwargs):
self.average = (self.param1 + self.param2 + self.param3 +
self.param4 + self.param5 + self.param6 + self.param7 +self. param8 +
self.param9 + self.param10)/10
super().save(*args, **kwargs)

class Meta:
ordering = ["-created_at"]
unique_together = ["user", "teacher", "subject"]


*forms.py*
from django import forms

from posts import models


class PostForm(forms.ModelForm):

class Meta:
model = models.Post
fields = ("teacher","subject","param1","param2","param3","param4",

"param5","param6","param7","param8","param9","param10","message")
choices = (
(1,'Unsatisfactory'),
(2,'Satisfactory'),
(3,'Good'),
(4,'Very Good'),
(5,'Outstanding')
)
widgets = {
'param1':forms.TypedChoiceField(choices=choices,
widget=forms.RadioSelect, coerce=int),
'message': forms.Textarea(attrs={'cols': 80, 'rows': 20}),
}

-- 
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/CAMO5YApwyjBSZgFEKHc6F0c1NVJCwdPkpnr%3DY%2B%3DV00hZsPSCcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-06-30 Thread Jason
I meant the tutorial at 
https://docs.djangoproject.com/en/2.0/intro/tutorial01/

That said, there's a few different ways you can actually deploy, but 
digitalocean has some good resources for starting out.

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04

This one shows how to use apache on ubuntu, and you should be able to 
extrapolate to use wamp.

what I would do is just set up a simple view to return a http response 
saying "working", and map that to the root.  Something like 

app/views

def index(request):
return HttpResponse("Working!")

app/urls

from app.views import index
urlpatterns = [
path('', index), 
]

and hit localhost.  That'll be all you need.

Hi,
> Thanks.
> Yes, I went thru the Mozilla library tutorial on a fedora dev machine to 
> the point where I realized I needed to do more with the last mile, so to 
> speak working on setup of the production server part on Windows and wamp.
> Seems most tuts end at manage.py runserver, or start into deployment from 
> dev to production.  I can't seem to locate a good uptodate tut for wamp 
> that shows how to test everything is working properly in a simple manner 
> for the wsgi part.
>
> I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py) 
> is working with apache, before spending too much more time building a site. 
>  
>
> On Sat, Jun 30, 2018 at 2:54 AM, Jason > 
> wrote:
>
>> appreciate the detailed report :-)
>>
>> so, have you set up the django tutorial project?  that application method 
>> in wsgi doesn't make any sense.  you should have urls and views set up in 
>> your project
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/-eJaLuJ85KE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com .
>> To post to this group, send email to django...@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/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.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/6f5e5996-a85e-4eb6-b5e4-804f7379a2b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-06-30 Thread Bob Bobsled
Hi,
Thanks.
Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
the point where I realized I needed to do more with the last mile, so to
speak working on setup of the production server part on Windows and wamp.
Seems most tuts end at manage.py runserver, or start into deployment from
dev to production.  I can't seem to locate a good uptodate tut for wamp
that shows how to test everything is working properly in a simple manner
for the wsgi part.

I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py) is
working with apache, before spending too much more time building a site.

On Sat, Jun 30, 2018 at 2:54 AM, Jason  wrote:

> appreciate the detailed report :-)
>
> so, have you set up the django tutorial project?  that application method
> in wsgi doesn't make any sense.  you should have urls and views set up in
> your project
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/-eJaLuJ85KE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.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/CALWZDaPoCygU8hSSYcsEpQnHGE%2B52EUxAyOko3kPRhR12t6HCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Queryset calculation and then filter/exclude/limit data rendered

2018-06-30 Thread rod termaat
I figured it out.  Probably not the ideal solution, but it works for now.

I did not realize you could use an IF tag in the the template.  I then 
passed the fromDate and toDate into the template and used that to limit the 
records to only that particular month.

Hopefully as my skills increase I will find more elegant solutions.

rod

On Friday, June 29, 2018 at 3:02:58 PM UTC-5, rod termaat wrote:
>
> I totally get what you are saying and thanks.  I tried a similar strategy. 
>  I do qs = Check.objects.all()  and then I have to do the calculation as 
> there is no balance in the model so I generate it on the fly in the for 
> loop.  My hope was to then filter qs like you show.  It works, but my 
> balance calculation is lost which is integral to the process.
>
> my filter code looks like:
> monthdata = check_list.filter(dater__gte=CalendarFromMonth, 
> dater__lte=CalendarToMonth)
>
> After some research that seemed like expected behavior where filter goes 
> back thru the OCR where as I was hoping it would just filter on check_list 
> and therefore retain the balance amount.
>
> Thanks for your perspective, rod
>
>
> On Friday, June 29, 2018 at 3:13:46 AM UTC-5, Derek wrote:
>>
>> Its not completely clear what you are doing.
>>
>> You need to avoid logic in your template; but you say "excluding data 
>> from the the queryset in the for loop which is easy in other languages, but 
>> this also seemed to be a no go".  That is not the case if your logic is 
>> written in the correct way.
>>
>> In my case I need to present a month-by-month view of orders; the UI 
>> displays day-by-day entries for the selected month (defaults to current 
>> month) with two "buttons" (hyperlinks) that are set to a +1 and -1 delta 
>> relative to the current month number so the user can jump back and forth 
>> easily.  The function in the views.py file accepts the month number as an 
>> argument and filters orders based on that month e.g. in your case you might 
>> do:
>>
>> qs = Check.objects.all()
>>
>> if selected_month:
>> qs = qs.filter(created__month=int(selected_month))
>>
>> where selected_month would be a argument passed into your view.  You can 
>> then apply other calculation logic on the list.  
>>
>>
>> On Thursday, 28 June 2018 02:09:21 UTC+2, rod termaat wrote:
>>>
>>> I have a small checkbook application where I store transactions 
>>> (expenses and income) amounts by date.  I render these to a template using 
>>> python to add the cumulative balance prior to render.  This work fine for 
>>> my little application, but not too sure how scalable it will be over time.
>>>
>>>
>>> My goal is to have this displayed by month with the running balance.  I 
>>> first researched custom pagination, but found nothing on date pagination by 
>>> month and year.  I then started down the road of excluding data from the 
>>> the queryset in the for loop which is easy in other languages, but this 
>>> also seemed to be a no go.  My current thought is to exclude the data from 
>>> the queryset in the for loop and move the data into a dictionary or list, 
>>> or json.
>>>
>>>
>>> Any advice for me?  Right now I need all objects from the Check model to 
>>> get an accurate balance and then I need to filter that to limit the records 
>>> by month.
>>>
>>>
>>> Finally, I did tried to filter the check_list after the balance was 
>>> added, but found out that does not work as the query goes back to the model 
>>> and I loose the balance.
>>>
>>>
>>> Here is my model
>>>
>>>
>>> class Check(models.Model):
>>>
>>> """
>>>
>>> Model representing a checkbook transaction.
>>>
>>> """
>>>
>>> check_type = (('CR', 'credit'),('DR', 'debit'),('SV', 
>>> 'savings'),('DT', 'debt reduction'),)
>>>
>>> 
>>>
>>> dater = models.DateField(help_text=' .the date of the transaction')
>>>
>>> type = models.CharField(max_length=2, choices=check_type, 
>>> help_text=' .credit or debit')
>>>
>>> category = models.ForeignKey('Category', on_delete=models.SET_NULL, 
>>> null=True)
>>>
>>> name = models.CharField(max_length=100, help_text=' .description')
>>>
>>> amount = models.IntegerField(default=0, help_text=' .amount')
>>>
>>> cleared = models.BooleanField(help_text=' .cleared with the bank?')
>>>
>>> created = models.DateTimeField(auto_now_add=True)
>>>
>>>
>>> Here is my function view
>>>
>>>
>>> def checkbookList(request):
>>>
>>> check_list = Check.objects.all()
>>>
>>> #checks = Check.objects.all()
>>>
>>>
>>>
>>> balance = 0
>>>
>>> #for chk in checks:
>>>
>>> for chk in check_list:
>>>
>>> balance += chk.amount
>>>
>>> chk.balance = balance
>>>
>>>
>>> if chk.cleared:
>>>
>>> chk.cleared = '\u221A'
>>>
>>> else:
>>>
>>> chk.cleared = '-'
>>>
>>>
>>> return render(request, 'checkbook/checkbook.html', {'checks': 
>>> check_list})
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Dj

Database

2018-06-30 Thread ABHISHEK PARMAR
Should i use postgres or mysql ?

-- 
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/CAErr1ZUERxGq26gkkhmPG_1iOdKwvMpHCoZdu2uJEhVhjNLXUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't access my django runserver

2018-06-30 Thread Anirudh Jain
You forgot to put 'comma' after DIRS': [os.path.join(BASE_DIR,
'templates')] in templates.

It should be DIRS': [os.path.join(BASE_DIR, 'templates')],

On Sat 30 Jun, 2018, 15:52 Umar Kambala,  wrote:

>
> this are my codes...
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
> ALLOWED_HOSTS = ['localhost', '.pythonanywhere.com']
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> 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 = 'mysite.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',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'mysite.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.0/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.0/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.0/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'GMT'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.0/howto/static-files/
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'STATIC')
> MASSAGE_STORAGE = 'django.contrib.message.storage.session.SessionStorage'
>
>
> this what i get when i run python manage.py runserver
> 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 317, in execute
> settings.INSTALLED_APPS
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 56, in __getattr__
> self._setup(name)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 43, in _setup
> self._wrapped = Settings(settings_module)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 106, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   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 674, in exec_module
>   File "", line 781, in get_code
>   File "", line 741, in
> source_to_code
>   File "", line 219, in
> _call_with_frames_removed
>   File "C:\Users\Admin\Desktop\Djan Polls\mysite\mysite\settings.py", line
> 60
> 'APP_DIRS': True,
>  ^
> SyntaxError: invalid syntax
>
> On Fri, Jun 29, 2018 at 6:00 AM, Mikhailo Keda  wrote:
>
>> show your code
>>
>> --
>> 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://grou

Re: Can't access my django runserver

2018-06-30 Thread Glen D souza
I think there is a ' , ' missing after 'DIRS' in Templates settings

On Saturday, 30 June 2018, Umar Kambala  wrote:

>
> this are my codes...
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
> ALLOWED_HOSTS = ['localhost', '.pythonanywhere.com']
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> 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 = 'mysite.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',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'mysite.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.0/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.0/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.0/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'GMT'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.0/howto/static-files/
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'STATIC')
> MASSAGE_STORAGE = 'django.contrib.message.storage.session.SessionStorage'
>
>
> this what i get when i run python manage.py runserver
> 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 317, in
> execute
> settings.INSTALLED_APPS
>   File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\conf\__init__.py", line 56, in __getattr__
> self._setup(name)
>   File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\conf\__init__.py", line 43, in _setup
> self._wrapped = Settings(settings_module)
>   File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\conf\__init__.py", line 106, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   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 674, in exec_module
>   File "", line 781, in get_code
>   File "", line 741, in
> source_to_code
>   File "", line 219, in
> _call_with_frames_removed
>   File "C:\Users\Admin\Desktop\Djan Polls\mysite\mysite\settings.py",
> line 60
> 'APP_DIRS': True,
>  ^
> SyntaxError: invalid syntax
>
> On Fri, Jun 29, 2018 at 6:00 AM, Mikhailo Keda  wrote:
>
>> show your code
>>
>> --
>> 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 ht

Re: django windows apache tell if apache is working

2018-06-30 Thread Jason
appreciate the detailed report :-)

so, have you set up the django tutorial project?  that application method 
in wsgi doesn't make any sense.  you should have urls and views set up in 
your project

-- 
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/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't access my django runserver

2018-06-30 Thread Jason
you're missing a comma at the end of 

 'DIRS': [os.path.join(BASE_DIR, 'templates')]

for future reference, if you want people to help you, give the information 
up front as well as context.  Your original posting showed minimal 
information, so there was nothing we could do until you posted the above.

You should also be using a text editor like atom, sublime, vscode, etc with 
a graphical linter so you can see syntax errors like the above more easily.

-- 
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/65a0ae6d-c957-4b65-b8f9-8c8ccffd58ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't access my django runserver

2018-06-30 Thread Umar Kambala
this are my codes...

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

ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
ALLOWED_HOSTS = ['localhost', '.pythonanywhere.com']


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

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 = 'mysite.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',
],
},
},
]

WSGI_APPLICATION = 'mysite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/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.0/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.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'GMT'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'STATIC')
MASSAGE_STORAGE = 'django.contrib.message.storage.session.SessionStorage'


this what i get when i run python manage.py runserver
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 317, in execute
settings.INSTALLED_APPS
  File
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
line 56, in __getattr__
self._setup(name)
  File
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
line 43, in _setup
self._wrapped = Settings(settings_module)
  File
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
  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 674, in exec_module
  File "", line 781, in get_code
  File "", line 741, in source_to_code
  File "", line 219, in
_call_with_frames_removed
  File "C:\Users\Admin\Desktop\Djan Polls\mysite\mysite\settings.py", line
60
'APP_DIRS': True,
 ^
SyntaxError: invalid syntax

On Fri, Jun 29, 2018 at 6:00 AM, Mikhailo Keda  wrote:

> show your code
>
> --
> 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/3d5e9f26-3170-440f-b06b-9b9f7ef976d0%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django use