Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
see the "{" bracket near options? you didn't close it sir.

On Wed, 22 Mar, 2023, 1:07 am Vairamuthu Puvanachandran, <
vai.pu...@gmail.com> wrote:

> my settings.py is having a problem right now, miss matching of the "(",
> "{" and "["
>
> Can you help me to resolve that?
>
> vairam
>
>  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',
> ],
> ),
> },
> },
> ]
>
>
> On Tuesday, March 21, 2023 at 11:56:48 a.m. UTC-4 Jeman Kumar wrote:
>
>> hello sir, Did you add the apps in the setting.py file?
>>
>> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
>> vai@gmail.com> wrote:
>>
>>> I am 76 yr old retired Engineer in Canada.
>>>
>>>
>>>
>>> I am new to Python and Django.
>>>
>>>
>>>
>>> I was looking for help and I found your site.
>>>
>>>
>>>
>>> I am stuck now.
>>>
>>>
>>>
>>> I followed the “polls.app” tutorial and had the “Hello welcome .. page
>>> under the project directory “mysite”.
>>>
>>>
>>>
>>> Previously I had two applications in a different project name.
>>>
>>>
>>>
>>> I added one application called “calc” in the project directory “mysite”.
>>>
>>>
>>>
>>> I ran into an error. I attach the “print screen” output.
>>>
>>>
>>>
>>> I spent some time but still I couldn’t solve
>>>
>>>
>>>
>>> I appreciate any help you can provide.
>>>
>>>
>>>
>>> I also wish to be a volunteer.
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>> Vairam
>>>
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%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/e660d778-4a2f-4aa9-a39e-0c029f0be026n%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/CALmE1TsBcq51p9zajGGqPLOJPYUDn-8cSut1RLpVGnL4rYDLDw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Vairamuthu Puvanachandran
my settings.py is having a problem right now, miss matching of the "(",  
"{" and "["

Can you help me to resolve that?

vairam

 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',
],
),
},
},
]


On Tuesday, March 21, 2023 at 11:56:48 a.m. UTC-4 Jeman Kumar wrote:

> hello sir, Did you add the apps in the setting.py file?
>
> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
> vai@gmail.com> wrote:
>
>> I am 76 yr old retired Engineer in Canada. 
>>
>>  
>>
>> I am new to Python and Django.
>>
>>  
>>
>> I was looking for help and I found your site.
>>
>>  
>>
>> I am stuck now. 
>>
>>  
>>
>> I followed the “polls.app” tutorial and had the “Hello welcome .. page 
>> under the project directory “mysite”. 
>>
>>  
>>
>> Previously I had two applications in a different project name. 
>>
>>  
>>
>> I added one application called “calc” in the project directory “mysite”.
>>
>>  
>>
>> I ran into an error. I attach the “print screen” output.
>>
>>  
>>
>> I spent some time but still I couldn’t solve
>>
>>  
>>
>> I appreciate any help you can provide.
>>
>>  
>>
>> I also wish to be a volunteer.
>>
>>  
>>
>>  
>>
>> Regards,
>>
>> Vairam 
>>
>>  
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%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/e660d778-4a2f-4aa9-a39e-0c029f0be026n%40googlegroups.com.


Re: Stuck with Django

2023-03-21 Thread yash thadani
Hi Vairam

What exactly you are stuck with?

Regards
Yash

On Tue, Mar 21, 2023 at 9:23 PM Vairamuthu Puvanachandran <
vai.pu...@gmail.com> wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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/ac733821-bd95-4219-8481-3a435e9febddn%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/CANuKP%3DDTZ4sH3ws5sD-q%2BEUT5PSJALivdYCOuySGjF-%3DJuo8%2Bw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Abdulrahman Abbas
Your attached pictures are not clear

On Tue, Mar 21, 2023, 16:53 Vairamuthu Puvanachandran 
wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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/ac733821-bd95-4219-8481-3a435e9febddn%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/CAGGqo0MM2RXJjN7MbzrNvSW8eX1dQATKmBzEMJH6vx1%3D-uAbGw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
you have to add apps to "installed apps" list in settings.py

On Tue, 21 Mar, 2023, 9:26 pm Jeman Kumar,  wrote:

> hello sir, Did you add the apps in the setting.py file?
>
> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
> vai.pu...@gmail.com> wrote:
>
>> I am 76 yr old retired Engineer in Canada.
>>
>>
>>
>> I am new to Python and Django.
>>
>>
>>
>> I was looking for help and I found your site.
>>
>>
>>
>> I am stuck now.
>>
>>
>>
>> I followed the “polls.app” tutorial and had the “Hello welcome .. page
>> under the project directory “mysite”.
>>
>>
>>
>> Previously I had two applications in a different project name.
>>
>>
>>
>> I added one application called “calc” in the project directory “mysite”.
>>
>>
>>
>> I ran into an error. I attach the “print screen” output.
>>
>>
>>
>> I spent some time but still I couldn’t solve
>>
>>
>>
>> I appreciate any help you can provide.
>>
>>
>>
>> I also wish to be a volunteer.
>>
>>
>>
>>
>>
>> Regards,
>>
>> Vairam
>>
>>
>>
>> --
>> 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/ac733821-bd95-4219-8481-3a435e9febddn%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/CALmE1TtQAOD3V-gTOqt1MYdKDMUQS35v3MfV4ToMcz_AMD%2B%2BKA%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
hello sir, Did you add the apps in the setting.py file?

On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
vai.pu...@gmail.com> wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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/ac733821-bd95-4219-8481-3a435e9febddn%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/CALmE1TvvPL2kmiP6G3e3GmDb3x_NqM-irXY_gvSe6sFBhU6wNg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-15 Thread Chetan Ganji
It seems to me like you are not entering the url name
In place of 'polls:vote' try to enter the name of the url given to that url
For Your Reference
https://docs.djangoproject.com/en/4.1/ref/templates/builtins/#url
I hope it helps you!
Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Wed, Mar 15, 2023 at 1:14 AM Sandip Bhattacharya <
sand...@showmethesource.org> wrote:

> Can you share your urls.py?
>
>
> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
>
> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org
> 
> .
>

-- 
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/CAMKMUjthNav_nSy_%3Dci7mxQ-6OLRaXOzRJ6ZjGjAXap5nuY5Tg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Here.

urls.py

from django.urls import path

from . import views


app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('/', views.DetailView.as_view(), name='detail'),
path('/results/', views.ResultsView.as_view(), name='results'),
path('/vote/', views.vote, name='vote'),
]


On Tue, Mar 14, 2023 at 3:44 PM Sandip Bhattacharya <
sand...@showmethesource.org> wrote:

> Can you share your urls.py?
>
>
> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
>
> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
> 
> .
>
>
> --
> 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/8mapBVGvyMA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org
> 
> .
>

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


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
This should be your views for vote.


from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse

from .models import Choice, Question
# ...
def vote(request, question_id):
question = get_object_or_404(Question, pk=question_id)
try:
selected_choice = question.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
# Redisplay the question voting form.
return render(request, 'polls/detail.html', {
'question': question,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
# Always return an HttpResponseRedirect after successfully dealing
# with POST data. This prevents data from being posted twice if a
# user hits the Back button.
return HttpResponseRedirect(reverse('polls:results', args=(
question.id,)))

On Tue, Mar 14, 2023, 20:34 Nithin Kumar  wrote:

> question.id or question_id both gave the same result.
> These are the views.
>
> from django.shortcuts import get_object_or_404, render
> from django.http import HttpResponse, Http404, HttpResponseRedirect
> from django.template import loader
> from .models import Choice,Question
> from django.urls import reverse
>
> # Create your views here.
>
> def index(request):
> latest_question_list = Question.objects.order_by('-pub_date')[:5]
> template = loader.get_template('polls/index.html')
> context = {
> 'latest_question_list': latest_question_list,
> }
> return render(request, 'polls/index.html',context)
>
>
> def detail(request, question_id):
> try:
> question = Question.objects.get(pk=question_id)
> except Question.DoesNotExist:
> raise Http404("Question Does not exist")
> return render(request, 'polls/detail.html', {'question':question})
>
>
>
> def results(request, question_id):
> question = get_object_or_404(Question, pk=question_id)
> return render(request, 'polls/results.html', {'question': question})
>
> def vote(request, question_id):
> return HttpResponse("You're voting on question %s." % question_id)
>
>
>
>
>
> On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:
>
>> Let's see your views.
>>
>> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
>> juw...@gmail.com> wrote:
>>
>>> question_id=question.id
>>>
>>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:
>>>
 Hi,

 Stuck with this problem

 https://docs.djangoproject.com/en/4.1/intro/tutorial04/

 NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)'
 not found. 1 pattern(s) tried: ['polls/>>>
 My detail.html is like this and it is failing at Line 1.
 I checked all solutions online but no luck.

 
 {% csrf_token %}
 
 {{ question.question_text }}
 {% if error_message %}{{ error_message }}
 {% endif %}
 {% for choice in question.choice_set.all %}
 
 {{
 choice.choice_text }}
 {% endfor %}
 
 
 

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%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/1d230ed2-73f0-4609-b53b-e620dff5d302n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe 

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Brian Carey
I think you need to check your urls.py.

⁣Get BlueMail for Android ​

On Mar 14, 2023, 1:33 PM, at 1:33 PM, Nithin Kumar  
wrote:
>question.id or question_id both gave the same result.
>These are the views. 
>
>from django.shortcuts import get_object_or_404, render
>from django.http import HttpResponse, Http404, HttpResponseRedirect
>from django.template import loader
>from .models import Choice,Question
>from django.urls import reverse
>
># Create your views here.
>
>def index(request):
>latest_question_list = Question.objects.order_by('-pub_date')[:5]
>template = loader.get_template('polls/index.html') 
>context = {
>'latest_question_list': latest_question_list,
>}
>return render(request, 'polls/index.html',context)
>
>
>def detail(request, question_id):
>try:
>question = Question.objects.get(pk=question_id)
>except Question.DoesNotExist:
>raise Http404("Question Does not exist")
>return render(request, 'polls/detail.html', {'question':question})
>
>
>
>def results(request, question_id):
>question = get_object_or_404(Question, pk=question_id)
>   return render(request, 'polls/results.html', {'question': question})
>
>def vote(request, question_id):
>return HttpResponse("You're voting on question %s." % question_id)
>
>
>
>
>
>On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:
>
>> Let's see your views.
>>
>> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
>> juw...@gmail.com> wrote:
>>
>>> question_id=question.id
>>>
>>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar 
>wrote:
>>>
 Hi,

 Stuck with this problem 

 https://docs.djangoproject.com/en/4.1/intro/tutorial04/

 NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)'
>not 
 found. 1 pattern(s) tried: ['polls/>>>
 My detail.html is like this and it is failing at Line 1. 
 I checked all solutions online but no luck. 

 
 {% csrf_token %}
 
 {{ question.question_text }}
 {% if error_message %}{{ error_message }}
 {% endif %}
 {% for choice in question.choice_set.all %}
 
 {{ 
 choice.choice_text }}
 {% endfor %}
 
 
 

 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 

>https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>>
>https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%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/1d230ed2-73f0-4609-b53b-e620dff5d302n%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/21c8dec2-8e46-4885-8522-6eae37dd9ed9%40gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Sandip Bhattacharya
Can you share your urls.py?


> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
> 
> Hi,
> 
> Stuck with this problem 
> 
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
> 
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
> found. 1 pattern(s) tried: ['polls/ 
> My detail.html is like this and it is failing at Line 1. 
> I checked all solutions online but no luck. 
> 
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{% 
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{ choice.choice_text 
> }}
> {% endfor %}
> 
> 
> 
> 
> -- 
> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
question.id or question_id both gave the same result.
These are the views. 

from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import loader
from .models import Choice,Question
from django.urls import reverse

# Create your views here.

def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
template = loader.get_template('polls/index.html') 
context = {
'latest_question_list': latest_question_list,
}
return render(request, 'polls/index.html',context)


def detail(request, question_id):
try:
question = Question.objects.get(pk=question_id)
except Question.DoesNotExist:
raise Http404("Question Does not exist")
return render(request, 'polls/detail.html', {'question':question})



def results(request, question_id):
question = get_object_or_404(Question, pk=question_id)
return render(request, 'polls/results.html', {'question': question})

def vote(request, question_id):
return HttpResponse("You're voting on question %s." % question_id)





On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:

> Let's see your views.
>
> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
> juw...@gmail.com> wrote:
>
>> question_id=question.id
>>
>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:
>>
>>> Hi,
>>>
>>> Stuck with this problem 
>>>
>>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>>
>>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
>>> found. 1 pattern(s) tried: ['polls/>>
>>> My detail.html is like this and it is failing at Line 1. 
>>> I checked all solutions online but no luck. 
>>>
>>> 
>>> {% csrf_token %}
>>> 
>>> {{ question.question_text }}
>>> {% if error_message %}{{ error_message }}
>>> {% endif %}
>>> {% for choice in question.choice_set.all %}
>>> 
>>> {{ 
>>> choice.choice_text }}
>>> {% endfor %}
>>> 
>>> 
>>> 
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%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/1d230ed2-73f0-4609-b53b-e620dff5d302n%40googlegroups.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
Let's see your views.

On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman 
wrote:

> question_id=question.id
>
> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar 
> wrote:
>
>> Hi,
>>
>> Stuck with this problem
>>
>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>
>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
>> found. 1 pattern(s) tried: ['polls/>
>> My detail.html is like this and it is failing at Line 1.
>> I checked all solutions online but no luck.
>>
>> 
>> {% csrf_token %}
>> 
>> {{ question.question_text }}
>> {% if error_message %}{{ error_message }}{%
>> endif %}
>> {% for choice in question.choice_set.all %}
>> 
>> {{
>> choice.choice_text }}
>> {% endfor %}
>> 
>> 
>> 
>>
>> --
>> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%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/CALGeGE3X4o_uE-302%2Bt36q%2B%3DVToch7qfYWDdxuY94bXsUk4FGg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Muhammad Juwaini Abdul Rahman
question_id=question.id

On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:

> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%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/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com.


Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Hi,

Stuck with this problem 

https://docs.djangoproject.com/en/4.1/intro/tutorial04/

NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
found. 1 pattern(s) tried: ['polls/
{% csrf_token %}

{{ question.question_text }}
{% if error_message %}{{ error_message }}{% 
endif %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text 
}}
{% endfor %}




-- 
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/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2021-07-14 Thread Tony Chang
Dear MH,

I also stuck here.

When I run *~*# python3 -m pip install mod-wsgi

I got the same error message: RuntimeError: The 'apxs' command appears not 
to be installed or is not executable. Please check the list of 
prerequisites in the documentation for this package and install any missing 
Apache httpd server packages.

I installed the Apache HTTP Server 2.4.43 from Synology DSM 6.2.4-25556 
Package Center. The apex is found in the system.

*~*# find / -iname apx*

/volume1/@appstore/Apache2.4/usr/local/bin/apxs

Could you share with me the way you got out from here?

Thanks

Best Regards,

Tony

MH 在 2020年3月3日 星期二下午9:01:31 [UTC+8] 的信中寫道:

> Dear nitish
>
> Thanks for your reply. I guess it is kind of a linux that Synology uses, 
> but it is different from other distros. So many advice on the internet 
> builds upon the ability to install packages via apt-get or ipkg, but both 
> are not available here. Somehow (really only somehow) I got entware/opkg 
> installed. But since then I have problems with the installations of most 
> packages there.
>
> Here are the results of my adaption of your suggested commands:
>
> /opt/bin# ./opkg find httpd
> /opt/bin#
>
> So, it seems there is no httpd24 on this repo.
>
> /opt/bin# ./opkg install apache
> Package apache (2.4.37-2) installed in root is up to date.
>
> /opt/bin# ./opkg install gcc
> Package gcc (7.4.0-5) installed in root is up to date.
>
> /opt/bin# sudo python3.5 -m pip install mod-wsgi
> Collecting mod-wsgi
>   Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
> ERROR: Command errored out with exit status 1:
>  command: /usr/local/bin/python3.5 -c 'import sys, setuptools, 
> tokenize; sys.argv[0] = 
> '"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"'; 
> __file__='"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"';f=getattr(tokenize,
>  
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
> egg_info --egg-base /tmp/pip-install-24inw61_/mod-wsgi/pip-egg-info
>  cwd: /tmp/pip-install-24inw61_/mod-wsgi/
> Complete output (5 lines):
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/tmp/pip-install-24inw61_/mod-wsgi/setup.py", line 168, in 
> 
> 'missing Apache httpd server packages.' % APXS)
> RuntimeError: The 'apxs' command appears not to be installed or is not 
> executable. Please check the list of prerequisites in the documentation 
> for this package and install any missing Apache httpd server packages.
> 
> ERROR: Command errored out with exit status 1: python setup.py egg_info 
> Check the logs for full command output.
>
> I guess there are many problems, but this is just a start.
>
> Best regards
> MH
>
>
> On Monday, March 2, 2020 at 9:04:23 PM UTC+1, MH wrote:
>>
>> Hi there
>>
>> I am rather a newbie, but after some problems I got django installed on 
>> my Synology Diskstation. So, I ignored many other problems and am very 
>> happy that I built my very first, very simple app. And now I would like to 
>> move it from the development stage to the production stage. Obviously I 
>> should make a change to a distinct webserver. Synology offers nginx and 
>> apache 2.4. I installed both. And now I do not really know how to proceed. 
>> Out there, there are many instructions to use something called mod-wsgi. 
>> But I cannot install this from the package center of the Diskstation.
>>
>> I also tried to get opkg working. And this did not turn out so well, too. 
>> Most packages return an error, when I try to install something. Before this 
>> gets too elusive, I would ask you for guidance and then I can provide you 
>> with the following error messages.
>>
>> Best regards
>> MH
>>
>

-- 
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/37c87088-0375-4c7a-b490-c7e21799cfa5n%40googlegroups.com.


I have been stuck for Django checkbox

2020-12-29 Thread ok
 Please anyone can solve this for me  Stackoverflow link-https://stackoverflow.com/questions/65493274/how-to-get-data-from-different-table-using-ajax-in-form-of-checkbox-in-django



-- 
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/0FDF3880-1140-41B5-82B2-9A2AB5D0F946%40hxcore.ol.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Reach out to me privately, I'll assist you further.

On Fri, Mar 6, 2020 at 12:32 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> Finally I figured out, which of my gunicorn versions belonged to the right
> python3 that I invoked earlier. Now it seems to start. I write seems
> because in the browser it now immediately gives me an error that it cannot
> find a certain module "docx". I will come back to that in a different post.
>
> But thanks for all so far!
>
> --
> 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/adbc08e4-4c83-405f-9042-d38ba2a5%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/CAFwtXp1Z6bBJFp8nGQ8vWUqp%3DTcReMch-MCJoLfnwXf%2B75ZmTQ%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

Finally I figured out, which of my gunicorn versions belonged to the right 
python3 that I invoked earlier. Now it seems to start. I write seems 
because in the browser it now immediately gives me an error that it cannot 
find a certain module "docx". I will come back to that in a different post.

But thanks for all so far!

-- 
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/adbc08e4-4c83-405f-9042-d38ba2a5%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread V. J
Zdravím vás, myslíme že přístup byl udělen jen pár lidem kteří odvádí dobrou práci, jelikož by bylo dost nebezpečné udělit přístup všem, tak pokud vas mohu poprosit obraťte se s žádostí na ně. A pokud uznaji za vhodné že je to potřeba, provedou opravu, nebo doplnění. Pokud se mýlím, tak mě kontaktujte a prenastavim pravidla přístupu. Přeji hezký den s pozdravem Vasek JachimOdesláno z mého telefonu Huawei Původní zpráva Předmět: Re: Stuck with Django on a Synology DiskstationOdesílatel: 'MH' via Django users Komu: Django users Kopie: Is there anything particular hat I have to write into that wsgi.py file?



-- 
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/0bfe682d-5dda-4f50-85bc-1239b17a82a3%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/-kdq1xj-ohu8uudyni2w-qp6yfm-r1fto6-uhymk84wh307-guno8r-c497jr9gy14j-8vrumlx66jke-aw50mvkek1qxdc72ifubmccbwl6u8u-idee96zjjyzg7gdypxqtaqh-jvqrulz2p1np-1icriq.1583442428804%40email.android.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
If I am not totally mistaken it could be that gunicorn wants to work with 
python2.7 while I did everything with python3. But how could I direct 
gunicorn to take python3?

-- 
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/f355d8d1-fe22-4adb-9915-8f16f52f5c8b%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Make sure you're in the root of the project and run:

gunicorn -w 4 project.wsgi:application

you dont need to change anything.

On Thu, Mar 5, 2020, 10:51 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Is there anything particular hat I have to write into that wsgi.py file?
>
> --
> 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/0bfe682d-5dda-4f50-85bc-1239b17a82a3%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/CAFwtXp3H3izqTPSrKXcUWsf2vk_ZSBTOjBeSuFJ66dirDu-crA%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Is there anything particular hat I have to write into that wsgi.py file?

-- 
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/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

but would that help me right now? Besides the problem of finding the right 
pip, I mean? As you can see, even now my gunicorn won't work :(



On Thursday, March 5, 2020 at 4:04:46 PM UTC+1, Omar Abou Mrad wrote:
>
> As of Python 3.3 virtual environments are builtin, it would be wise to get 
> used to them.
>
> https://docs.python.org/3/library/venv.html
>
>

-- 
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/6c3a2e5f-a496-47e4-b216-94d8e651e029%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
 gunicorn -w 4 wsgi:application
[2020-03-05 15:55:51 +] [4472] [INFO] Starting gunicorn 19.9.0
[2020-03-05 15:55:51 +] [4472] [INFO] Listening at: http://127.0.0.1:8000 
(4472)
[2020-03-05 15:55:51 +] [4472] [INFO] Using worker: sync
[2020-03-05 15:55:51 +] [4483] [INFO] Booting worker with pid: 4483
[2020-03-05 15:55:51 +] [4483] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4483] [INFO] Worker exiting (pid: 4483)
[2020-03-05 15:55:51 +] [4484] [INFO] Booting worker with pid: 4484
[2020-03-05 15:55:51 +] [4484] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4484] [INFO] Worker exiting (pid: 4484)
[2020-03-05 15:55:51 +] [4486] [INFO] Booting worker with pid: 4486
[2020-03-05 15:55:51 +] [4486] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4486] [INFO] Worker exiting (pid: 4486)
[2020-03-05 15:55:51 +] [4487] [INFO] Booting worker with pid: 4487
[2020-03-05 15:55:51 +] [4487] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4487] [INFO] Worker exiting (pid: 4487)
[2020-03-05 15:55:51 +] [4472] [INFO] Shutting down: Master
[2020-03-05 15:55:51 +] [4472] [INFO] Reason: Worker failed to boot.



-- 
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/32ff3661-129e-49df-8061-3ad51493951e%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
As of Python 3.3 virtual environments are builtin, it would be wise to get
used to them.

https://docs.python.org/3/library/venv.html

On Thu, Mar 5, 2020 at 4:57 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> /volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
> Defaulting to user installation because normal site-packages is not
> writeable
> Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib
> /python3.5/site-packages (20.0.4)
> Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
> usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
>
> The output for this folder is identical for pip3 and pip 3.5.
>
> /usr/bin$ ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Defaulting to user installation because normal site-packages is not
> writeable
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> ERROR: Could not install packages due to an EnvironmentError: [Errno 13]
> Permission denied:
> '/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
> Check the permissions.
>
> and as root:
> /usr/bin# ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> Successfully installed gunicorn-19.10.0
>
> I will now try it again.
>
>
> --
> 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/30b9b540-6224-4906-98f1-f0a3ff0ebb01%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/CAFwtXp352iNvORHWxm1WJPdpL6dtJqkmS4aACbGtRJpUqByi8g%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
/volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.5/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)

The output for this folder is identical for pip3 and pip 3.5.

/usr/bin$ ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] 
Permission denied: 
'/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
Check the permissions.

and as root:
/usr/bin# ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
Successfully installed gunicorn-19.10.0

I will now try it again.


-- 
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/30b9b540-6224-4906-98f1-f0a3ff0ebb01%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users

To be quite honest, this is really challenging for me, because the synology 
OS drove me nuts. I am under the impression that I have multiple 
installations of python and pip running now.

In order to get an overview, I will now try to find every pip on my system 
and to install gunicorn everywhere. (I would wish I just had one central 
apt-get command here)...

~/.local/bin$ ./pip3 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

~/.local/bin$ ./pip3.5 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Using cached gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
Installing collected packages: gunicorn
  WARNING: The script gunicorn is installed in 
'/var/services/homes/admin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this 
warning, use --no-warn-script-location.
Successfully installed gunicorn-20.0.4

and

./pip3.8 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

These were all from the same directory. Next post with more infos from 
other folders.




-- 
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/d9a4564c-08f7-48d8-ae5b-822656dc32b4%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
gunicorn is yielding the same error as the standard python command I gave
you,
whereas you use python3 to fire up the django development server. I'll
venture
a guess and say the problem is due to the environment.

Are you using any virtual environment or installing system wide?
How did you install django?
How did you install gunicorn?
Did you use pip?
Do you have a pip3?
Does "pip --version" and "pip3 --version" yield different results?

If you answered yes to the last 3 questions, try removing gunicorn using pip
and installing it using pip3.

On Thu, Mar 5, 2020 at 3:59 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> python -c "import django.core.wsgi" && echo "Yup, works!"
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named django.core.wsgi
>
>
> but
> python3 manage.py runserver 0:8000
> Watching for file changes with StatReloader
> Performing system checks...
>
> System check identified no issues (0 silenced).
> March 05, 2020 - 14:42:06
> Django version 3.0.3, using settings 'project.settings'
> Starting development server at http://0:8000/
> Quit the server with CONTROL-C.
>
>
>
> --
> 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/645cfdfa-1861-4ac8-97bf-c3be4c273196%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/CAFwtXp29duqw%2BzCRZR9Ts-kEtTfF-_jgJNqv_42h%2BDZaTOG6Pg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

python -c "import django.core.wsgi" && echo "Yup, works!"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django.core.wsgi


but
python3 manage.py runserver 0:8000
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 05, 2020 - 14:42:06
Django version 3.0.3, using settings 'project.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.



-- 
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/645cfdfa-1861-4ac8-97bf-c3be4c273196%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Is django installed properly?
Are you still able to use runserver?
What happens when you run the following?

python -c "import django.core.wsgi" && echo "Yup, works!"

also, looking further into your error log, make sure you're in the proper
directory.
(i may have given you the wrong one earlier, run the below and see if it
works)

cd /var/services/homes/admin/DjangoProject/project/
gunicorn -w 4 project.wsgi:application

On Thu, Mar 5, 2020 at 2:34 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Somehow I cannot write everything into one post that I wanted to reply.
> Here comes the rest of my original post.
>
>
> gunicorn -w 4 wsgi:application
> [... continued ...]
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>  Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
> [2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
> [2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
> [2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.
>
> The wsgi filee only consists of:
>
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
>
> application = get_wsgi_application()
>
>
> What should I do differently?
>
> --
> 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/d6ab1255-5fc0-4800-b618-555b34848422%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/CAFwtXp29ynfVBdOx%2BptFHrZercMLTPy4Y7o85Oae_3sCEA4VOw%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Somehow I cannot write everything into one post that I wanted to reply. 
Here comes the rest of my original post.


gunicorn -w 4 wsgi:application
[... continued ...]
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
 Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
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/d6ab1255-5fc0-4800-b618-555b34848422%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you 

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you 

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Change your working directory to "project" (the directory containing
wsgi.py) and use:

 gunicorn -w 4 wsgi:application

It should work.

On Thu, Mar 5, 2020 at 10:14 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Could anyone tell me how to start correctly the unicorn (integration)?
>
> --
> 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/e4404c7e-e6d1-460d-9c22-e4571f1b7528%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/CAFwtXp0UjVBWMSiW8v-CBn1ZQfwAwg23Fdwr8TEutXQNvZh3xw%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Could anyone tell me how to start correctly the unicorn (integration)?

-- 
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/e4404c7e-e6d1-460d-9c22-e4571f1b7528%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-04 Thread 'MH' via Django users
Hi Omar

Actually I do not know why apache is better than the development webserver 
from django or gunicorn, but I wanted to give it a try. The installation 
worked.

Now I am not sure what I am doing wrong:

gunicorn project/wsgi.py:application
[2020-03-04 13:46:26 +] [28939] [INFO] Starting gunicorn 19.9.0
[2020-03-04 13:46:26 +] [28939] [INFO] Listening at: http://127.0.0.1:8000 
(28939)
[2020-03-04 13:46:26 +] [28939] [INFO] Using worker: sync
[2020-03-04 13:46:26 +] [28950] [INFO] Booting worker with pid: 28950
[2020-03-04 13:46:26 +] [28950] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 354, in 
import_app
ImportError: Failed to find application, did you mean 
'project/wsgi:application'?
[2020-03-04 13:46:26 +] [28950] [INFO] Worker exiting (pid: 28950)
[2020-03-04 13:46:26 +] [28939] [INFO] Shutting down: Master
[2020-03-04 13:46:26 +] [28939] [INFO] Reason: Worker failed to boot.

I just found this file in my project folder in a folder below the manage.py 
command. So therefore I thought that this could be the right wsgi file. I 
did not write anything into it.

-- 
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/2f03ec91-59e7-4060-bf53-78c4fb5d1d2b%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread Omar Abou Mrad
[Alternative] While this shouldn't be considered as a way to circumvent
learning how to
configure apache or nginx to serve/proxy python apps, you can also consider
sticking
to pure python dependencies (if this is for personal use). you can ignore
the webserver
completely and simply opt for [1] gunicorn for app serving and use [2]
whitenoise for
serving static files.

[1] https://gunicorn.org/
[2] http://whitenoise.evans.io/

On Tue, Mar 3, 2020 at 3:02 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Andreas
>
> I want to build a little system, which consists of several django apps
> that help me in my daily life. But I don't want to upload documents about
> insurances and stuff to any cloud. Therefore I wanted a solution on premise
> and the NAS seemed to be a good choice. Could be wrong about that. So far I
> was happy with development version, but it seems difficult to install other
> things like mod-wsgi.
>
> Best regards
> MH
>
> --
> 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/564baec6-a88e-4360-bb13-9518b1f40634%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/CAFwtXp0W%3D%2BmbYxq1iYVv8AgP%3DE4_KPo6FgLCu5qE_KxabiGLfg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread 'MH' via Django users
Dear Andreas

I want to build a little system, which consists of several django apps that 
help me in my daily life. But I don't want to upload documents about 
insurances and stuff to any cloud. Therefore I wanted a solution on premise 
and the NAS seemed to be a good choice. Could be wrong about that. So far I 
was happy with development version, but it seems difficult to install other 
things like mod-wsgi.

Best regards
MH

-- 
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/564baec6-a88e-4360-bb13-9518b1f40634%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread 'MH' via Django users
Dear nitish

Thanks for your reply. I guess it is kind of a linux that Synology uses, 
but it is different from other distros. So many advice on the internet 
builds upon the ability to install packages via apt-get or ipkg, but both 
are not available here. Somehow (really only somehow) I got entware/opkg 
installed. But since then I have problems with the installations of most 
packages there.

Here are the results of my adaption of your suggested commands:

/opt/bin# ./opkg find httpd
/opt/bin#

So, it seems there is no httpd24 on this repo.

/opt/bin# ./opkg install apache
Package apache (2.4.37-2) installed in root is up to date.

/opt/bin# ./opkg install gcc
Package gcc (7.4.0-5) installed in root is up to date.

/opt/bin# sudo python3.5 -m pip install mod-wsgi
Collecting mod-wsgi
  Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
ERROR: Command errored out with exit status 1:
 command: /usr/local/bin/python3.5 -c 'import sys, setuptools, 
tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"';f=getattr(tokenize,
 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
egg_info --egg-base /tmp/pip-install-24inw61_/mod-wsgi/pip-egg-info
 cwd: /tmp/pip-install-24inw61_/mod-wsgi/
Complete output (5 lines):
Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/pip-install-24inw61_/mod-wsgi/setup.py", line 168, in 

'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not 
executable. Please check the list of prerequisites in the documentation for 
this package and install any missing Apache httpd server packages.

ERROR: Command errored out with exit status 1: python setup.py egg_info 
Check the logs for full command output.

I guess there are many problems, but this is just a start.

Best regards
MH


On Monday, March 2, 2020 at 9:04:23 PM UTC+1, MH wrote:
>
> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my 
> Synology Diskstation. So, I ignored many other problems and am very happy 
> that I built my very first, very simple app. And now I would like to move 
> it from the development stage to the production stage. Obviously I should 
> make a change to a distinct webserver. Synology offers nginx and apache 
> 2.4. I installed both. And now I do not really know how to proceed. Out 
> there, there are many instructions to use something called mod-wsgi. But I 
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too. 
> Most packages return an error, when I try to install something. Before this 
> gets too elusive, I would ask you for guidance and then I can provide you 
> with the following error messages.
>
> Best regards
> MH
>

-- 
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/ca388790-6dbf-448b-bde6-da14b055e9de%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread Andréas Kühne
Hi,

I don't think this is actually possible. Django runs python and not only
simple html. Nginx and apache are simple webservers. So unless you can get
good access to the terminal on the diskstation - I wouldn't even try this.
Why do you want to have the application running on a disk station?

Regards,

Andréas


Den mån 2 mars 2020 kl 21:04 skrev 'MH' via Django users <
django-users@googlegroups.com>:

> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my
> Synology Diskstation. So, I ignored many other problems and am very happy
> that I built my very first, very simple app. And now I would like to move
> it from the development stage to the production stage. Obviously I should
> make a change to a distinct webserver. Synology offers nginx and apache
> 2.4. I installed both. And now I do not really know how to proceed. Out
> there, there are many instructions to use something called mod-wsgi. But I
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too.
> Most packages return an error, when I try to install something. Before this
> gets too elusive, I would ask you for guidance and then I can provide you
> with the following error messages.
>
> Best regards
> MH
>
> --
> 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/3b30b913-c881-451d-a25e-3539eaefa035%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/CAK4qSCcNLXD%2BG2ihPhQ%2BM%2BcwwaC3NYwJ5424mxjrbOSCMdYM4A%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-02 Thread nitish kumar
Hi MH,


what flavour of Linux you are using. if it is centos/redhat you can use 
below steps.

   $sudo yum install httpd24-devel.x86_64 gcc git
 $sudo python3.5 -m pip install  mod-wsgi


once installed you need to add site configuration and permissions to your 
Django code.

 $ cd ~/django_app
 $python manage.py makemigrations
 $python manage.py migrate
 Note: if you get any errors remove  "db.sqlite3" file and execute the above 2 
commands
 $python manage.py collectstatic
 $sudo chown :www-data db.sqlite3
 $sudo service apache2 restart


If packages are not available you have to try the offline installation. and 
you need to install dependencies manually.

ping me if you need more help(https://twitter.com/vullinitish)



On Tuesday, 3 March 2020 01:34:23 UTC+5:30, MH wrote:
>
> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my 
> Synology Diskstation. So, I ignored many other problems and am very happy 
> that I built my very first, very simple app. And now I would like to move 
> it from the development stage to the production stage. Obviously I should 
> make a change to a distinct webserver. Synology offers nginx and apache 
> 2.4. I installed both. And now I do not really know how to proceed. Out 
> there, there are many instructions to use something called mod-wsgi. But I 
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too. 
> Most packages return an error, when I try to install something. Before this 
> gets too elusive, I would ask you for guidance and then I can provide you 
> with the following error messages.
>
> Best regards
> MH
>

-- 
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/073b40dd-1379-405e-8c44-b582b72173ac%40googlegroups.com.


Stuck with Django on a Synology Diskstation

2020-03-02 Thread 'MH' via Django users
Hi there

I am rather a newbie, but after some problems I got django installed on my 
Synology Diskstation. So, I ignored many other problems and am very happy 
that I built my very first, very simple app. And now I would like to move 
it from the development stage to the production stage. Obviously I should 
make a change to a distinct webserver. Synology offers nginx and apache 
2.4. I installed both. And now I do not really know how to proceed. Out 
there, there are many instructions to use something called mod-wsgi. But I 
cannot install this from the package center of the Diskstation.

I also tried to get opkg working. And this did not turn out so well, too. 
Most packages return an error, when I try to install something. Before this 
gets too elusive, I would ask you for guidance and then I can provide you 
with the following error messages.

Best regards
MH

-- 
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/3b30b913-c881-451d-a25e-3539eaefa035%40googlegroups.com.


Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2014-07-28 Thread Chou Sunny

i had the same problem by just copying the text on the web, pasting on 
textedit, and saving it into html.
when i open html by Xcode, you will see extra lines, more than the text on 
the web.
simply re-edit html by Xcode, the problem is solved.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7cc3cb58-aa98-4fcd-90bf-24f0ec2bdb63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Daniel Roseman
On Thursday, 17 May 2012 19:39:53 UTC+1, Bob Loblaw wrote:
>
> I was cruising along fine, but am stuck now...  Any help would be 
> greatly appreciated 
>
> OS: Mac OS X Version 10.6.8 
> Python: 2.6.1 
> Django: 1.4 
>
> Issue: system throwing an error message during template rendering when 
> trying to implement Django template system.  So I guess I must have a 
> config snag somewhere in Django. 
>
>
>
> Here is the error message... 
>
> Error during template rendering 
>
> In template /data/templates/polls/index.html, error at line 20 
> Invalid block tag: ' 10p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> color: #008080; background-color: #e0ffb8} 
> 11p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> background-color: #e0ffb8} 
> 12p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; 
> color: #80; background-color: #e0ffb8} 
> 13span.s1 {color: #99} 
> 14span.s2 {color: #00} 
> 15span.s3 {color: #80} 
> 16span.s4 {color: #bb8844} 
> 17   
> 18 
> 19 
> 20{% 
> if latest_poll_list  class="s1">%} 
> 21   
>   class="s3">ul 
> 22{% class="s2"> for poll in  span>latest_poll_list %} b> 
> 23lia span> href="/polls/ span>{{  span>poll.id }} span>/" class="s1">{{ poll.question class="s2"> }} class="s3">/a/li 
> 24   
>   class="s1">{% endfor %} span> 
> 25/ul 
> 26{% else 
>  class="s1">%} 
> 27   
>   class="s3">pNo polls are available. class="s3">/p 
> 28{% endif 
>  class="s1">%} 
> 29 
> 30 
>
>
> Here is the index.html (verbatim from tutorial)... 
>
> {% if latest_poll_list %} 
>  
> {% for poll in latest_poll_list %} 
> {{ poll.question }} li> 
> {% endfor %} 
>  
> {% else %} 
> No polls are available. 
> {% endif %} 
>

That's not the template file that's being used, as you can see from the 
error traceback - the real file appears to have a whole load of extraneous 
formatting in it. Are you using something like Word to edit your templates?
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VePKXyM265AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Marcin Tustin
This is your problem:  {% else %}

Everything between {% and %} is interpreted as template-syntax code.

On Thu, May 17, 2012 at 7:39 PM, Bob Loblaw  wrote:

> I was cruising along fine, but am stuck now...  Any help would be
> greatly appreciated
>
> OS: Mac OS X Version 10.6.8
> Python: 2.6.1
> Django: 1.4
>
> Issue: system throwing an error message during template rendering when
> trying to implement Django template system.  So I guess I must have a
> config snag somewhere in Django.
>
>
>
> Here is the error message...
>
> Error during template rendering
>
> In template /data/templates/polls/index.html, error at line 20
> Invalid block tag: ' 10  p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> color: #008080; background-color: #e0ffb8}
> 11  p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> background-color: #e0ffb8}
> 12  p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier;
> color: #80; background-color: #e0ffb8}
> 13  span.s1 {color: #99}
> 14  span.s2 {color: #00}
> 15  span.s3 {color: #80}
> 16  span.s4 {color: #bb8844}
> 17
> 18  
> 19  
> 20  {%
> if latest_poll_list  class="s1">%}
> 21   class="s3">ul
> 22  {% class="s2"> for poll in  span>latest_poll_list %} b>
> 23  lia span> href="/polls/ span>{{  span>poll.id }} span>/" class="s1">{{ poll.question class="s2"> }} class="s3">/a/li
> 24   class="s1">{% endfor %} span>
> 25  /ul
> 26  {% else  class="s1">%}
> 27   class="s3">pNo polls are available. class="s3">/p
> 28  {% endif  class="s1">%}
> 29  
> 30  
>
>
> Here is the index.html (verbatim from tutorial)...
>
> {% if latest_poll_list %}
>
>{% for poll in latest_poll_list %}
>{{ poll.question }} li>
>{% endfor %}
>
> {% else %}
>No polls are available.
> {% endif %}
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Newbie Stuck on Django Tutorial 3 - Django Template system

2012-05-17 Thread Bob Loblaw
I was cruising along fine, but am stuck now...  Any help would be
greatly appreciated

OS: Mac OS X Version 10.6.8
Python: 2.6.1
Django: 1.4

Issue: system throwing an error message during template rendering when
trying to implement Django template system.  So I guess I must have a
config snag somewhere in Django.



Here is the error message...

Error during template rendering

In template /data/templates/polls/index.html, error at line 20
Invalid block tag: '

Re: Stuck re:Practical Django Projects 2nd E...

2009-07-19 Thread klaut



On Jul 18, 9:57 pm, Rob B  wrote:
> Huge thanks Tanja - worked a treat.
>
> Any ideas why the book has it the other way around?
>

I think it is just a typo :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B
Huge thanks Tanja - worked a treat.

Any ideas why the book has it the other way around?

2009/7/18 klaut 

>
>
>
> On Jul 18, 6:30 pm, "Rob B (uk)"  wrote:
> > Bit stumped on chapter 4.
> >
> > Every thing is working except I'm getting a 'Page not found (404)'
> > when I try to view any entries.
> >
> > View:
> > def entry_detail(request, year, month, day, slug):
> > import datetime, time
> > date_stamp = time.strptime(year+month+day, "%Y%b%d")
> > pub_date = datetime.date(*date_stamp[:3])
> > return render_to_response('coltrane/entry_detail.html',
> >   { 'entry': Entry.objects.get
> > (pub_date__year=pub_date.year,
> >
> > pub_date__month=pub_date.month,
> >
> > pub_date__day=pub_date.day,
> >
> > slug=slug) })
> >
> > Url:
> > (r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
> > \w]+)/$', 'coltrane.views.entry_detail'),
> >
> > Any ideas?
>
> Yes. You should switch the ... P? .. part to  ...?P ...
> The question mark should precede the character P.
>
> Hope it helps.
> Tanja
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread klaut



On Jul 18, 6:30 pm, "Rob B (uk)"  wrote:
> Bit stumped on chapter 4.
>
> Every thing is working except I'm getting a 'Page not found (404)'
> when I try to view any entries.
>
> View:
> def entry_detail(request, year, month, day, slug):
>         import datetime, time
>         date_stamp = time.strptime(year+month+day, "%Y%b%d")
>         pub_date = datetime.date(*date_stamp[:3])
>         return render_to_response('coltrane/entry_detail.html',
>                                   { 'entry': Entry.objects.get
> (pub_date__year=pub_date.year,
>
> pub_date__month=pub_date.month,
>
> pub_date__day=pub_date.day,
>
> slug=slug) })
>
> Url:
> (r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
> \w]+)/$', 'coltrane.views.entry_detail'),
>
> Any ideas?

Yes. You should switch the ... P? .. part to  ...?P ...
The question mark should precede the character P.

Hope it helps.
Tanja
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Lakshman Prasad
If you get a page not found, verify the slug (the entire url pattern for
that pattern), either from the console or admin, that it exists.

On Sat, Jul 18, 2009 at 4:30 PM, Rob B (uk) wrote:

>
> Bit stumped on chapter 4.
>
> Every thing is working except I'm getting a 'Page not found (404)'
> when I try to view any entries.
>
> View:
> def entry_detail(request, year, month, day, slug):
>import datetime, time
>date_stamp = time.strptime(year+month+day, "%Y%b%d")
>pub_date = datetime.date(*date_stamp[:3])
>return render_to_response('coltrane/entry_detail.html',
>  { 'entry': Entry.objects.get
> (pub_date__year=pub_date.year,
>
> pub_date__month=pub_date.month,
>
> pub_date__day=pub_date.day,
>
> slug=slug) })
>
> Url:
> (r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
> \w]+)/$', 'coltrane.views.entry_detail'),
>
>
> Any ideas?
> >
>


-- 
Regards,
Lakshman
becomingguru.com
lakshmanprasad.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B (uk)

Bit stumped on chapter 4.

Every thing is working except I'm getting a 'Page not found (404)'
when I try to view any entries.

View:
def entry_detail(request, year, month, day, slug):
import datetime, time
date_stamp = time.strptime(year+month+day, "%Y%b%d")
pub_date = datetime.date(*date_stamp[:3])
return render_to_response('coltrane/entry_detail.html',
  { 'entry': Entry.objects.get
(pub_date__year=pub_date.year,
 
pub_date__month=pub_date.month,
 
pub_date__day=pub_date.day,
 
slug=slug) })

Url:
(r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
\w]+)/$', 'coltrane.views.entry_detail'),


Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---