Re: Error running Django tutorial

2018-09-20 Thread Joel
Show the urls.py after adding everything. Note that there must be two
urls.py. One in the project folder, another in the app folder

On Fri 21 Sep, 2018, 12:18 AM Asong nkemzi,  wrote:

> Hello, Ruth did you ever solve this problem? I am experiencing exactly the
> same issue
>
> On Thursday, March 17, 2016 at 4:07:11 PM UTC-4, Ruth wrote:
>>
>> I am getting the very same problem, despite adding include to my
>> mysite\urls.py file.
>> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS
>> Could it be a python 2.7 problem?
>> Thanks,
>> Ruth
>>
>> On Saturday, February 27, 2016 at 11:50:39 AM UTC-8, Mike Kipling wrote:
>>>
>>> I am working through the Django tutorial *Writing your first Django
>>> app, part 1.*
>>> I am using Windows 10, python 3.5.1 and Django 1.9.2 .
>>>
>>> In the *Write your first view* section:
>>> after writing the polls/views.py and polls/urls.py files,
>>> and modifying the manage/urls.py file,
>>> and starting the server,
>>>
>>> When I go to http://localhost:8000/polls/ in the browser I get the
>>> following error:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://localhost:8000/polls/
>>>
>>> Using the URLconf defined in mysite.urls, Django tried these URL
>>> patterns, in this order:
>>>
>>>1. ^admin/
>>>
>>> The current URL, polls/, didn't match any of these.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/778da3c3-92a0-4560-b2e2-7b7d5539ad85%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8tX_Vr5%3DN95%3DKSGUr6uyzxMB5Dta-FjnqSjg%3DywkO8QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Release 1.11.16 on hold?

2018-09-20 Thread Nef
Hi everyone,

Does someone know what has happened with the release 1.11.16 with ETA 1st 
of September? It seems the bugfix for "Race condition in 
QuerySet.update_or_create() that could result in data loss" has already 
been closed...

https://docs.djangoproject.com/en/1.11/releases/1.11.16/

Thank you,
Nef

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d9f9a74-4e0a-45e6-be2d-93b3fdde96a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2018-09-20 Thread Asong nkemzi
Hello, Ruth did you ever solve this problem? I am experiencing exactly the 
same issue

On Thursday, March 17, 2016 at 4:07:11 PM UTC-4, Ruth wrote:
>
> I am getting the very same problem, despite adding include to my 
> mysite\urls.py file.
> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS
> Could it be a python 2.7 problem?
> Thanks,
> Ruth
>
> On Saturday, February 27, 2016 at 11:50:39 AM UTC-8, Mike Kipling wrote:
>>
>> I am working through the Django tutorial *Writing your first Django app, 
>> part 1.*
>> I am using Windows 10, python 3.5.1 and Django 1.9.2 .
>>  
>> In the *Write your first view* section:  
>> after writing the polls/views.py and polls/urls.py files, 
>> and modifying the manage/urls.py file, 
>> and starting the server,
>>  
>> When I go to http://localhost:8000/polls/ in the browser I get the 
>> following error:
>>
>> Page not found (404) 
>> Request Method: GET 
>> Request URL: http://localhost:8000/polls/
>>
>> Using the URLconf defined in mysite.urls, Django tried these URL 
>> patterns, in this order:
>>
>>1. ^admin/
>>
>> The current URL, polls/, didn't match any of these.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/778da3c3-92a0-4560-b2e2-7b7d5539ad85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django restful project standalone

2018-09-20 Thread Jani Tiainen
Hi.

Could you also describe what are you trying to achieve? People might have
good solutions for you if you provide more detailed information.

to 20. syysk. 2018 klo 14.10 Peter Mudoko  kirjoitti:

> Hi guys am experimenting how i can use django restful framework in a
> standalone python project , i am trying to import from rest_framework
> import status
> from rest_framework.generics import GenericAPIView, from
> rest_framework.response import Response but this error is propping always
> how can i handle it considering its not a djangle project how can i hack it
>
>   File
> "/home/peter/.local/lib/python3.6/site-packages/django/conf/__init__.py",
> line 42, in _setup
> % (desc, ENVIRONMENT_VARIABLE))
> django.core.exceptions.ImproperlyConfigured: Requested setting
> INSTALLED_APPS, but settings are not configured. You must either define the
> environment variable DJANGO_SETTINGS_MODULE or call settings.configure()
> before accessing settings.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/db3f868d-81d3-4b94-9909-6e456ef5b6a5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread Alessandro Dentella


Hi Raffaele,

On Thu, Sep 20, 2018 at 03:36:11PM +0200, Raffaele Salmaso wrote:
>On Thu, Sep 20, 2018 at 3:25 PM sandro dentella
><[1]sandro.dente...@gmail.com> wrote:
>
>from django.conf import settings
>from django.test.runner import DiscoverRunner
>class GeneraliDiscoverRunner(DiscoverRunner):
>def __init__(self, *args, **kwargs):
>settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage'
>super().__init__(*args, **kwargs)
>It seems that this changes the Storage in all situations apart from the
>fields declared in the models via the storage=ThumbnailStorage. I guess
>when model are read the settings from the runner has not yet been set.
>Is there a way to set the Storage in due time?
>
>Not really sure, but you can use override_settings from
>django.test.utils as
>from django.test.utils import override_settings
>@override_settings(DEFAULT_FILE_STORAGE='web.storage.TestStorage')
>class GeneraliDiscoverRunner(DiscoverRunner):
>pass
>(override_settings does a lot of other things)
>or use a custom DJANGO_SETTINGS_MODULE

really I've already tried it as well, but it happens the same: it
doesn't work for the Storage declared in the models.

I'd need to set the settings *before* the models are read. It seems
that the runner is instantiated too late!


sandro

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


Re: DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread Raffaele Salmaso
On Thu, Sep 20, 2018 at 3:25 PM sandro dentella 
wrote:

>
>
> from django.conf import settings
> from django.test.runner import DiscoverRunner
>
>
> class GeneraliDiscoverRunner(DiscoverRunner):
> def __init__(self, *args, **kwargs):
> settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage'
> super().__init__(*args, **kwargs)
>
> It seems that this changes the Storage in all situations apart from the
> fields declared in the models via the storage=ThumbnailStorage. I guess
> when model are read the settings from the runner has not yet been set. Is
> there a way to set the Storage in due time?
>
> Not really sure, but you can use override_settings from django.test.utils
as

from django.test.utils import override_settings
@override_settings(DEFAULT_FILE_STORAGE='web.storage.TestStorage')
class GeneraliDiscoverRunner(DiscoverRunner):
pass

(override_settings does a lot of other things)

or use a custom DJANGO_SETTINGS_MODULE

-- 
| Raffaele Salmaso
| https://salmaso.org
| https://bitbucket.org/rsalmaso
| https://github.com/rsalmaso

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


DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread sandro dentella
Hi,

I have a storage that create some thumbnail and is declared in some  
models' fields. It's created inheriting from DEFAULT_FILE_STORAGE and it 
just works fine both in FileSystemStorage and in Aws. 

For this project need the aws Storage (from Django_storages) but when 
testing I prefer the local FileSystemStorage, so my TEST_RUNNER sets the 
desired one as follows:



from django.conf import settings
from django.test.runner import DiscoverRunner


class GeneraliDiscoverRunner(DiscoverRunner):
def __init__(self, *args, **kwargs):
settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage'
super().__init__(*args, **kwargs)

It seems that this changes the Storage in all situations apart from the 
fields declared in the models via the storage=ThumbnailStorage. I guess 
when model are read the settings from the runner has not yet been set. Is 
there a way to set the Storage in due time?


Thanks in advance
sandro
*:-)

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


Re: Django restful project standalone

2018-09-20 Thread farmankhan977


On Thursday, September 20, 2018 at 4:40:57 PM UTC+5:30, Peter Mudoko wrote:
>
> Hi guys am experimenting how i can use django restful framework in a 
> standalone python project , i am trying to import from rest_framework 
> import status
> from rest_framework.generics import GenericAPIView, from 
> rest_framework.response import Response but this error is propping always 
> how can i handle it considering its not a djangle project how can i hack it
>
>   File 
> "/home/peter/.local/lib/python3.6/site-packages/django/conf/__init__.py", 
> line 42, in _setup
> % (desc, ENVIRONMENT_VARIABLE))
> django.core.exceptions.ImproperlyConfigured: Requested setting 
> INSTALLED_APPS, but settings are not configured. You must either define the 
> environment variable DJANGO_SETTINGS_MODULE or call settings.configure() 
> before accessing settings.
>
>
https://stackoverflow.com/questions/15556499/django-db-settings-improperly-configured-error

please check link 

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


Django restful project standalone

2018-09-20 Thread Peter Mudoko
Hi guys am experimenting how i can use django restful framework in a 
standalone python project , i am trying to import from rest_framework 
import status
from rest_framework.generics import GenericAPIView, from 
rest_framework.response import Response but this error is propping always 
how can i handle it considering its not a djangle project how can i hack it

  File 
"/home/peter/.local/lib/python3.6/site-packages/django/conf/__init__.py", 
line 42, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting 
INSTALLED_APPS, but settings are not configured. You must either define the 
environment variable DJANGO_SETTINGS_MODULE or call settings.configure() 
before accessing settings.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db3f868d-81d3-4b94-9909-6e456ef5b6a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.