Re: Multisite strategy

2018-05-31 Thread Carlo Ascani
Il giorno mer 23 mag 2018 alle ore 17:02 Daniel Germano Travieso
 ha scritto:
>
> Hello!
> The Sites Framework is exactly what you need (and the proper 
> internationalization/localization for the languages).
> Just set up your 3 sites the Django way (creating the propper settings.py for 
> each site)
> Then you can run each site using `manage.py runserver  --settings 
> .py`
>
> You can access each different site in development by going to localhost:
>
> As a suggestion, to avoid overhead in the creation of a site that is only 
> responsible for the choice of the site and language, I would assing one of 
> the two sites to be the default one, but the first action the user takes when 
> accessing the site is to choose location and language, but it is a personal 
> thing and your way can and will work fine!
>
> Hope it helps!


Thank you!

Is it possible to change the current site at runtime?


>
> []'s
> Daniel Germano Travieso
> Engenharia da Computação Turma: 013
> Unicamp
>
> On Tue, May 22, 2018 at 3:31 AM, Carlo Ascani  wrote:
>>
>> Hi all,
>>
>> I'd like to implement something like this:
>>
>> One Django project to serve 3 sites:
>> 1. `domain.com` which is the "master" site, containing just a landing page
>> 2. `de.domain.com` which is the "German" site
>> 3. `en.domain.com` which is the "UK" site
>>
>> `de` and `en` refers the location, not the language (e.g. 
>> `de.domain.com/en/` is the German site in English)
>>
>> If you go to `domain.com` you can choose the language and the country, and 
>> you are just redirected to the right place.
>>
>> Is `contrib.site` suitable for that scenario?
>> I was thinking at 3 different sites.
>> If so, how can I use them locally while in development?
>>
>> Any other suggestions?
>>
>> Best,
>> Carlo
>>
>>
>> --
>> 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/3b068855-78e7-4742-890d-1fc8a545b4f4%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/CABF8kZM%2BD-4Cou6s0bHJC15MeXLjeEaVrLBLdDTHd5%3DG1%3DupPA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Carlo Ascani aka carloratm

http://carlo.ratm.gitlab.io
carloratm@freenode

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


Re: href not working

2018-05-31 Thread Mike Dewhirst

On 31/05/2018 1:56 PM, Caleb Bryson wrote:
So i am trying to create a directory with a Home,Blog,and Contact 
selection. But every time i click on one of them they all go back to 
the home page.


It feels like your urls.py is insufficiently fleshed out or maybe your 
home page url isn't fully formed. Django obviously thinks that whatever 
is handed in can be interpreted as requesting the home page view.


For example, I would expect your home page url pattern (url or re_path 
depending on Django version) might look something like ...


url_patterns = [
    url(r'^$', home_page_view),
    ...
]

If you have omitted that $ anything will match and your home page view 
will be called.


Just a guess


How do i fix this, and here is the secton of code below. let me know 
if you need to see more




Home
Blog
Contact


--
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/9dc7004b-4fff-412d-8560-6308f13db92c%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/073f2ff6-a8a9-da49-0e16-575db697b3f6%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


A Web Developer is currently needed for a contract job in Lagos,Nigeria

2018-05-31 Thread Adefioye Temidayo

URGENT A Web Developer is currently needed for a contract job in 
Lagos,Nigeria Location: 70% remote Pay: #300,000 - #400,000 Preferred: * 3 
years+ experience in web development * Python Django * Apache & uWSGI 
server configuration * Experience with project planning and estimation. * 
Experience working with Angular 2 or 4 * Relational Databases/SQL: * 
PostgreSQL * Query creation & optimization * Refactoring code 
inefficiencies with database operations * Agile Software Development- SCRUM 
* Test Driven Development and Unit Testing * Continuous Integration * 
Source control management tools: Mercurial (preferred), Git, SVN.TFS(Team 
foundation Server) * Experience with Responsive Design If you are 
interested kindly send your portfolio to temidjoy.adefi...@diylaw.ng

-- 
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/c09a28d7-a6c6-4de8-9727-8bd39b7de9c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Mohammed Noor
I think the mistake is using a '/' before the name inside href. Try changing it 
from href= '/contact'/ to href= 'contact/' 

Have a great day 

> On 31-May-2018, at 9:26 AM, Caleb Bryson  wrote:
> 
> So i am trying to create a directory with a Home,Blog,and Contact selection. 
> But every time i click on one of them they all go back to the home page. How 
> do i fix this, and here is the secton of code below. let me know if you need 
> to see more
> 
> 
> 
> Home
> Blog
> Contact
> 
>   
> -- 
> 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/9dc7004b-4fff-412d-8560-6308f13db92c%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/AD00040D-010E-4613-BAA8-07A3C028FAF9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


installation help please

2018-05-31 Thread kailash jangu
guys i installed django version 2.0.5 in windows but when i use 
django-admin command it shows me error what path i should i go with to get 
start with my newproject and do database api driver has role in it. i have 
my django-admin executive and python file in pyhton36/scripts what do i do 
help please...

-- 
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/139a9b30-7301-4ac9-a0af-816621fda116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: installation help please

2018-05-31 Thread Rafael E. Ferrero
please use some kind of virtual environment... in linux its virtualenvs


Rafael E. Ferrero

2018-05-31 8:06 GMT-03:00 kailash jangu :

> guys i installed django version 2.0.5 in windows but when i use
> django-admin command it shows me error what path i should i go with to get
> start with my newproject and do database api driver has role in it. i have
> my django-admin executive and python file in pyhton36/scripts what do i do
> help please...
>
> --
> 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/139a9b30-7301-4ac9-a0af-816621fda116%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/CAJJc_8XS%2BdX_sTQUXQcLPrDSFaszLzhoAqayWHZF0Ax2bp4ptQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Melvyn Sopacua
On donderdag 31 mei 2018 05:56:59 CEST Caleb Bryson wrote:
> So i am trying to create a directory with a Home,Blog,and Contact
> selection. But every time i click on one of them they all go back to the
> home page.

If the url in your addressbar is /blog/  after clickin on it, but you see the 
homepage content, then your homepage url pattern matches too much.

If you get redirected to the homepage, then there's something wrong in your 
blog view code.

Given that it applies to both contact and blog, the first option is more 
likely, but you could be making the same mistake in both views.

-- 
Melvyn Sopacua

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


Re: A Web Developer is currently needed for a contract job in Lagos,Nigeria

2018-05-31 Thread Oladipupo Elegbede
You may want to talk to Tim Akinbo.
taki...@gmail.com
+2348033797801

He's highly highly recommended if he's available.

Regards.

On Thu, May 31, 2018, 06:11 Adefioye Temidayo  wrote:

>
> URGENT A Web Developer is currently needed for a contract job in
> Lagos,Nigeria Location: 70% remote Pay: #300,000 - #400,000 Preferred: * 3
> years+ experience in web development * Python Django * Apache & uWSGI
> server configuration * Experience with project planning and estimation. *
> Experience working with Angular 2 or 4 * Relational Databases/SQL: *
> PostgreSQL * Query creation & optimization * Refactoring code
> inefficiencies with database operations * Agile Software Development- SCRUM
> * Test Driven Development and Unit Testing * Continuous Integration *
> Source control management tools: Mercurial (preferred), Git, SVN.TFS(Team
> foundation Server) * Experience with Responsive Design If you are
> interested kindly send your portfolio to temidjoy.adefi...@diylaw.ng
>
> --
> 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/c09a28d7-a6c6-4de8-9727-8bd39b7de9c7%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/CAHjgLX6FwOKHKMuCdEgr6uDOc5ei%2Bat%3DsTBFVnE7FhHN8-BfpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

url(r'^admin/', admin.site.urls),

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

url(r'^', views.index, name='index'),

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

template_name='blog/post.html')),

]

Do you see what I need to change?
On Thursday, May 31, 2018 at 4:31:47 AM UTC-4, Mike Dewhirst wrote:
>
> On 31/05/2018 1:56 PM, Caleb Bryson wrote: 
> > So i am trying to create a directory with a Home,Blog,and Contact 
> > selection. But every time i click on one of them they all go back to 
> > the home page. 
>
> It feels like your urls.py is insufficiently fleshed out or maybe your 
> home page url isn't fully formed. Django obviously thinks that whatever 
> is handed in can be interpreted as requesting the home page view. 
>
> For example, I would expect your home page url pattern (url or re_path 
> depending on Django version) might look something like ... 
>
> url_patterns = [ 
>  url(r'^$', home_page_view), 
>  ... 
> ] 
>
> If you have omitted that $ anything will match and your home page view 
> will be called. 
>
> Just a guess 
>
>
> > How do i fix this, and here is the secton of code below. let me know 
> > if you need to see more 
> > 
> >  
> >  
> > Home 
> > Blog 
> > Contact 
> >  
> >  
> > -- 
> > 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 post to this group, send email to django...@googlegroups.com 
>  
> > . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
> > 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/1fb184b5-04e1-4592-90b4-bafaa4809dbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

url(r'^admin/', admin.site.urls),

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

url(r'^', views.index, name='index'),

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

template_name='blog/post.html')),

]

Do you see what I need to change?

On Thursday, May 31, 2018 at 7:11:46 AM UTC-4, Mohammed Noor wrote:
>
> I think the mistake is using a '/' before the name inside href. Try 
> changing it from href= '/contact'/ to href= 'contact/' 
>
> Have a great day 
>
> On 31-May-2018, at 9:26 AM, Caleb Bryson > 
> wrote:
>
> So i am trying to create a directory with a Home,Blog,and Contact 
> selection. But every time i click on one of them they all go back to the 
> home page. How do i fix this, and here is the secton of code below. let me 
> know if you need to see more
>
> 
>
> Home
> Blog
> Contact
>
>   
>
> -- 
> 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 post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%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/e7cc8fdf-03a2-4d4e-a8f6-1b949714fbc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

url(r'^admin/', admin.site.urls),

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

url(r'^', views.index, name='index'),

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

template_name='blog/post.html')),

]

Do you see what I need to change?

On Thursday, May 31, 2018 at 9:01:23 AM UTC-4, Melvyn Sopacua wrote:
>
> On donderdag 31 mei 2018 05:56:59 CEST Caleb Bryson wrote: 
> > So i am trying to create a directory with a Home,Blog,and Contact 
> > selection. But every time i click on one of them they all go back to the 
> > home page. 
>
> If the url in your addressbar is /blog/  after clickin on it, but you see 
> the 
> homepage content, then your homepage url pattern matches too much. 
>
> If you get redirected to the homepage, then there's something wrong in 
> your 
> blog view code. 
>
> Given that it applies to both contact and blog, the first option is more 
> likely, but you could be making the same mistake in both views. 
>
> -- 
> Melvyn Sopacua 
>

-- 
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/2ed614e4-cb26-47ef-9bfb-4e07d10b5ef2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


calculate the followers difference/grow by day

2018-05-31 Thread João Paulo
 
Hey guys,

I´m using SQLite and trying to calculate the followers difference by day

This is my model:

class Statistics(models.Model):
followers = models.IntegerField()
last_update = models.DateTimeField(auto_now_add=True)

This are my database rows:

"6" "50" "*2018-05-29* 00:25:48.276102"
"1" "100" "*2018-05-29* 00:26:48.276102"
"3" "200" "*2018-05-30* 00:27:04.178444"
"5" "250" "*2018-05-30* 00:30:04.178444"
"4" "300" "*2018-05-31* 00:27:04.178444"

And the result I´m tryting to achieve is:

followers | last_update
150  
*2018-05-30*50   

*2018-05-31*
*# I´m new to Django and thinking about use a Manager, but don't know if´s 
doable using a Manager# Does anyone has a suggestion ?*

-- 
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/3196a628-a53f-41ac-bcbf-6cc8b8a66016%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Melvyn Sopacua
On donderdag 31 mei 2018 15:49:28 CEST Caleb Bryson wrote:
> my blog view.py is empty at the moment
> 
> 
> Mysite url.py
> 
> from django.contrib import admin
> 
> from django.conf.urls import url, include
> 
> 
> 
> urlpatterns = [
> 
> url(r'^admin/', admin.site.urls),
> 
> url(r'^', include( 'hybridair.urls')),

This matches anything that has a beginning. So that always matches, anything 
after it, is ignored (Django works on first match base).


> url(r'^', views.index, name='index'),

And again.

So anything that is not admin, goes to the homepage.
-- 
Melvyn Sopacua

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


Re: A Web Developer is currently needed for a contract job in Lagos,Nigeria

2018-05-31 Thread Adefioye Temidayo
Hello,
Kindly send in your portfolio

Cheers!

On Thu, May 31, 2018 at 4:32 PM, Rakesh Singh  wrote:

> I am interested for this job. If you need any information please let me
> know.
>
> On Thu, May 31, 2018 at 1:07 PM, Adefioye Temidayo 
> wrote:
>
>>
>> URGENT A Web Developer is currently needed for a contract job in
>> Lagos,Nigeria Location: 70% remote Pay: #300,000 - #400,000 Preferred: * 3
>> years+ experience in web development * Python Django * Apache & uWSGI
>> server configuration * Experience with project planning and estimation. *
>> Experience working with Angular 2 or 4 * Relational Databases/SQL: *
>> PostgreSQL * Query creation & optimization * Refactoring code
>> inefficiencies with database operations * Agile Software Development- SCRUM
>> * Test Driven Development and Unit Testing * Continuous Integration *
>> Source control management tools: Mercurial (preferred), Git, SVN.TFS(Team
>> foundation Server) * Experience with Responsive Design If you are
>> interested kindly send your portfolio to temidjoy.adefi...@diylaw.ng
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/c09a28d7-a6c6-4de8-9727-8bd39b7de9c7%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> *Thanks & Regards*
>
> *Rakesh Singh*
> *Diverse Lynx LLC*
> *Technical Project Manager*
> *786 9230 528*
> *rakesh...@gmail.com *
> P Please consider your environmental responsibility - think before you
> print!
>
>
> --
> 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/CADJJcgYr2hc2-sy%3DWHccn_mrWRo%3DjGzAwJv-
> rwRi1uxFPdXgig%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


one-to-one GenericRelation best practices

2018-05-31 Thread Vitor Barbosa
Hello! This is my first question, so please excuse any mistakes.

I'm using django 1.8 (working on migration to 2.0).

I need to implement a one-to-one generic relation. To illustrate suppose I
have three classes, the first representing and abstract class in a store
and the other specific products which need extra information:


AbstractProduct(models.Model):

sale = GenericRelation('Sales')
class Meta:
abstract = True

Books(AbstractProduct):


Magazines(AbstractProduct):



Now I need to create a models for 'Sales'. Each sale is of a specific
product. Following https://docs.djangoproject.com/en/2.0/ref/
contrib/contenttypes/#generic-relations I used:

class Sales(models.Model):

content_type = models.ForeignKey(...)
object_id = models.PositiveIntegerField(...)
content_object = GenericForeignKey('content_type', 'object_id')


My problem is that by using this approach whenever I do

>>> Books.objects.get(pk=1).sale

I get back a manager since django does not know it is a one-to-one
relation. And it makes me think that maybe I'm approaching this in the
wrong way.

My question is:
(a) is this design a good solution for this problem? Is there a better
approach? Has anyone solved a similar problem in a better way?
(b) is there a way to create a generic One-To-One relation?

I'm open to answers pointing to good blogs/books/articles which give a more
formal approach to this kind of design issue, if you know a good one.

Thanks in advance! Yours,

Vitor.


-- 
Vitor Quintanilha Barbosa

-- 
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/CAB-MUC7h4S32XE8nj7%2BtpeYdv%3DtH%3DQBX3ghx0rVxU%2BF0mTAakg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: URL Concatenation Issue

2018-05-31 Thread John Regis, Jr.
I have *href="about/"*. Also tried *href="./about/"* and same result.

On Wed, May 30, 2018 at 10:23 PM, Spence Patrick  wrote:

> Is your link tag href="./about" or href="/about/"
>
> On Wed, May 30, 2018, 19:14  wrote:
>
>> Hello,
>>
>> I'm debugging an issue that I'm having with my URL patterns. In my HTML I
>> have an "about me" page that is linking to an about.html file in my
>> templates/blog/ directory. When I load the homepage and click on the "about
>> me" link than "domain.com/about/" loads, which matches the URL pattern
>> in my blog/urls.py file, and the page renders perfectly fine.
>>
>> However, while on the "about me" page I can't link to any other page
>> because the URL pattern starts to concatenate instead of overwrite (if that
>> makes any sense). For example, if I click on "about me" again than Django
>> tries to load domain.com/about/about and I get an error.
>>
>> I'm using a python 3.5.2 venv and I'm running Django 2.0.5. I'm new to
>> programming by the way (to include Python, Django, HTML/CSS).
>>
>> --
>> 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/1213b3f9-c74b-4af9-b585-61f2423720f0%
>> 40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/UB1iqDXjy3g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAD6-5Ch7%3DSTQGPdPg3iU%3Dvy2H1GMqcFnycBqb5bquXGDDV6ZB
> A%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: URL Concatenation Issue

2018-05-31 Thread John Regis, Jr.
In blog/urls.py I have my my homepage mapped to my view.index. Are you
saying to also map view.about as well? Also, when you say namespace are you
saying to create a dictionary and include my index (blog) and about pages
as values? New to Python so I'm trying to still wrap my head around the
utilization of python dictionaries.

On Wed, May 30, 2018 at 10:42 PM, Aditya Singh 
wrote:

> For this you have provide an app inside your urls and refer to it as
> home:about where home is the app name and about is the page to be rendered.
> Also provide namespace in the urls so that the url is linked to the app
> name.
> Kind Regards,
> Aditya
>
> On Thu, May 31, 2018, 7:54 AM Spence Patrick 
> wrote:
>
>> Is your link tag href="./about" or href="/about/"
>>
>> On Wed, May 30, 2018, 19:14  wrote:
>>
>>> Hello,
>>>
>>> I'm debugging an issue that I'm having with my URL patterns. In my HTML
>>> I have an "about me" page that is linking to an about.html file in my
>>> templates/blog/ directory. When I load the homepage and click on the "about
>>> me" link than "domain.com/about/" loads, which matches the URL pattern
>>> in my blog/urls.py file, and the page renders perfectly fine.
>>>
>>> However, while on the "about me" page I can't link to any other page
>>> because the URL pattern starts to concatenate instead of overwrite (if that
>>> makes any sense). For example, if I click on "about me" again than Django
>>> tries to load domain.com/about/about and I get an error.
>>>
>>> I'm using a python 3.5.2 venv and I'm running Django 2.0.5. I'm new to
>>> programming by the way (to include Python, Django, HTML/CSS).
>>>
>>> --
>>> 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/1213b3f9-c74b-4af9-b585-61f2423720f0%
>>> 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/CAD6-5Ch7%3DSTQGPdPg3iU%3Dvy2H1GMqcFnycBqb5bquXGDDV6ZB
>> A%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/UB1iqDXjy3g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAEPfumjqtuz9bTfh%2Bfk%3D8iFYOKUQwSGpQqwwuyqX%2BQ%
> 3DABgL3%3Dw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Implementing a 'please wait' page

2018-05-31 Thread Mohammed Noor
Hello Guys,

I currently have a process running on my django application which takes about 
10-15 minutes to complete. 

Currently, the user clicks on a 'submit' button and this process starts. The 
web page remains in a hung state for the complete time this process takes to 
run and after say 10-15 mins another 'results' page is displayed. 


I want to be able to display a page saying 'please wait for '  after submit button is clicked. Can you please 
give me any ideas on how to implement this. 


Here is a rough representation of my code flow: 

Main function (): 
-lots of code
-call to sub function() //this is the guy taking 10-15 mins to execute
-if sub function() returns true then proceed else break and exit. 
 -remaining code of Main function()

As you might have guessed, I want to be able to change the display when this 
sub function () is hit. Btw, main function () is executed when user clicks on 
submit button. 


Appreciate your help! 

Thanks and Have a great day,
Mohammed Noor

-- 
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/5CF991C0-FB63-47BA-9A2A-47224E468D0B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


dumpdata fails with crytpic error

2018-05-31 Thread Bernd Wechner
Just tried this:

$ python3 manage.py dumpdata --format json --indent 4 > data.json
CommandError: Unable to serialize database: 'NoneType' object has no 
attribute 'is_authenticated'

Anyone seen this before. How does one diagnose this given the vague nature 
of the message? I mean I presume it's complaining because there's an 
illegal value in a field in the database. But you think it's mention which 
field in which model on which record? Is there a quick way to find out?

Regards,

Bernd.

-- 
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/32b8f2a7-cbe2-420d-baee-5101e00a7038%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: dumpdata fails with crytpic error

2018-05-31 Thread Mike Dewhirst

On 1/06/2018 2:22 PM, Bernd Wechner wrote:

Just tried this:

|
$ python3 manage.py dumpdata --format json --indent 4>data.json
CommandError:Unableto serialize database:'NoneType'objecthas 
noattribute 'is_authenticated'

|

Anyone seen this before. How does one diagnose this given the vague 
nature of the message? I mean I presume it's complaining because 
there's an illegal value in a field in the database. But you think 
it's mention which field in which model on which record? Is there a 
quick way to find out?


I haven't seen it before but I would say it is your user model. 
is_authenticated is an attribute of django.contrib.auth.user (actually 
AbstractUser I think).


Don't know whether --verbosity=2 would give you more error info.

Here is mine which does work ...

python manage.py dumpdata --settings=proj.settings.dev --indent=2 
--verbosity=0 --natural-primary --natural-foreign --all > dump.json


Note the settings arg which is required for manage.py to find the 
correct database if you don't have DJANGO_SETTINGS_MODULE established in 
your environment.


Mike



Regards,

Bernd.
--
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/32b8f2a7-cbe2-420d-baee-5101e00a7038%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/3d810e88-9ebb-cb5f-416d-4d0e82c023c9%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-05-31 Thread Mark Phillips
Have you looked at celery (http://www.celeryproject.org/) to handle the
long running process? Perhaps in conjunction with redis (https://redis.io/)?

If you passed the long running process to celery, then you could change the
page to "say please wait".

Mark

On Thu, May 31, 2018 at 4:35 PM, Mohammed Noor  wrote:

> Hello Guys,
>
> I currently have a process running on my django application which takes
> about 10-15 minutes to complete.
>
> Currently, the user clicks on a 'submit' button and this process starts.
> The web page remains in a hung state for the complete time this process
> takes to run and after say 10-15 mins another 'results' page is displayed.
>
>
> I want to be able to display a page saying 'please wait for  time taken to complete process>'  after submit button is clicked. Can you
> please give me any ideas on how to implement this.
>
>
> Here is a rough representation of my code flow:
>
> Main function ():
> -lots of code
> -call to sub function() //this is the guy taking 10-15 mins to execute
> -if sub function() returns true then proceed else break and exit.
>  -remaining code of Main function()
>
> As you might have guessed, I want to be able to change the display when
> this sub function () is hit. Btw, main function () is executed when user
> clicks on submit button.
>
>
> Appreciate your help!
>
> Thanks and Have a great day,
> Mohammed Noor
>
> --
> 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/5CF991C0-FB63-47BA-9A2A-47224E468D0B%40gmail.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/CAEqej2OTHwsOe5svxqbd31h1NSniROe9pnmbDm%2BN3vPGtUPTSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.