Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread James Schneider
On Mon, Jun 4, 2018, 12:37 PM Melvyn Sopacua wrote: > On maandag 4 juni 2018 20:40:03 CEST Richard Brockie wrote: > > > On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua > wrote: > > > > This isn't a problem. Neither url nor reverse is capable of returning > URLs > > > > with hostnames, at least

Re: App not Defined - Getting Started

2018-06-04 Thread Priya
Hi Jamie, I think you should put single quotes inside include() which expects a path for your apps(polls) urls.py. So try- path('polls/',include('polls.urls')) Hope this helps. On Tue, 5 Jun 2018, 2:59 a.m. Jaime Escobar, wrote: > Hi, > I am a completely beginner in django and also python

Re: error: can not import the name 'path'

2018-06-04 Thread Aphiso Media
Whats version are you using? Im on mobile so i cant open urls.py. If you're using a version earlier than 2.0 you need to use url instead of path. Do you have from django.urls import path? On Mon, Jun 4, 2018, 4:29 PM anguboy wrote: > i am new in django, so in my first app ,am stack at mapping

Re: Generating server-side off-line HTML of Django pages ...

2018-06-04 Thread Bernd Wechner
Thanks Melvyn, looks exactly like what I wanted! Will investigate. I had a feeling this could not be a novel or unique use case. Regards, Bernd. On Monday, 4 June 2018 20:09:25 UTC+10, Melvyn Sopacua wrote: > > On maandag 4 juni 2018 08:00:08 CEST Bernd Wechner wrote: > > > Say I have a page

error: can not import the name 'path'

2018-06-04 Thread anguboy
i am new in django, so in my first app ,am stack at mapping the URL and I get an error that can not import name 'path' ,,which is in the tmn(my_app) folder , please help -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

App not Defined - Getting Started

2018-06-04 Thread Jaime Escobar
Hi, I am a completely beginner in django and also python programming. I am trying to follow the online documentation tutorial in which a poll website is created, but just running the server after created the polls it throws the error "name 'polls' is not defined". Can you help me? Unhandled

Best way to add an image from a filefield to django 2.0 admin?

2018-06-04 Thread Mark Phillips
I have a Document model that uploads an image. I have a DocumentMetaData model with a JSON field where I "crud" metadata for the documents in the Document model. I would like to add the image of the document in the Document model to the change form of the DocumentMetaData model in the admin. How

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 20:40:03 CEST Richard Brockie wrote: > On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua wrote: > > This isn't a problem. Neither url nor reverse is capable of returning URLs > > with hostnames, at least not that I'm aware of. Only django.contrib.site > >

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Richard Brockie
On Mon, Jun 4, 2018 at 9:01 PM Melvyn Sopacua wrote: > This isn't a problem. Neither url nor reverse is capable of returning URLs > with hostnames, at least not that I'm aware of. Only django.contrib.site >

Re: calculate the followers difference/grow by day

2018-06-04 Thread Daniel Germano Travieso
Hello! I don't quite understand what you mean by the followers difference by day, but as that difference by day is not a property of each model tuple, but a property of a specific day, you can write a view to handle that processing. Custom model Managers are used to either add manager methods or

Re: installation help please

2018-06-04 Thread Daniel Germano Travieso
If you are using Windows, I highly recommend you to use a tool such as Conda or VirtualEnv. It greatly increases the level of encapsulation of your different django projects you may create, as each one may use different python or django modules. Check Conda out at

Re: Multisite strategy

2018-06-04 Thread Daniel Germano Travieso
Hello Carlo, I don't see what you mean by change the current site at runtime? If you mean change the site the user is accessing, just forward the user via the URL to the proper site you mean to reach. Hope it helps! *[]'s* *Daniel Germano Travieso* *Engenharia da Computação Turma: 013*

Re: Error running WSGI application

2018-06-04 Thread Joseph Mutumi
Hello, Check https://help.pythonanywhere.com/pages/DebuggingImportError/#django-specific-issues And make sure your directory structure is as recommended: /home/myusername `-- myproject/ |-- __init__.py `-- myproject/ |-- __init__.py `-- settings.py If it is not, then

Re: Flask-supermarket forms creation

2018-06-04 Thread Joseph Mutumi
Hello, Check Django formset documentation: https://docs.djangoproject.com/en/2.0/topics/forms/formsets/ For Flask, if you are using WTForms check the using the combination of FieldList with FormField: http://wtforms.simplecodes.com/docs/0.6/fields.html#field-enclosures Though this is a Django

Re: one-to-one GenericRelation best practices

2018-06-04 Thread Joseph Mutumi
Hello, May be you want to subclass GenericForeignKey: class GenericOneToOne(GenericForeignKey): many_to_one = False one_to_many = False one_to_one = True Though have not tried it so YMMV. Kind regards On Thu, May 31, 2018 at 8:59 PM, Vitor Barbosa wrote: > Hello! This is my

Re: Creating Reports in Django Admin Panel

2018-06-04 Thread Joseph Mutumi
Hello, You'll first need to create a custom admin page. Create your view and add it to the urls.py like normal. Then you extend the admin base template and display your aggregation in there: {% extends "admin/base_site.html" %} {% block title %}Stats title{% endblock %} {% block content %}Stats

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 12:58:39 CEST Gerald Brown wrote: > I have been using ./manage.py shell for awhile and now all of a sudden it > has stopped working with the error "AttributeError: 'property' object has > no attribute '__dict__'". I get the same error with anything I enter after > the

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 13:26:24 CEST Richard Brockie wrote: > However, I'm pretty sure that we will need to make some changes to our > project to deal with links when the site is being accessed through > "subdomain.sponsor.url/". You are correct that {% url %} is used in the > templates as well

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Andréas Kühne
Hi, I got really strange issues when I upgraded my ubuntu machine from 17.04 to 17.10 when they changed the python version that was shipped with ubuntu (only going from python3.5 to 3.6 I THINK). This made all of my python environments stop working and I had to recreate them from scratch. Have

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread 'Anthony Flury' via Django users
On 04/06/18 12:01, Gerald Brown wrote: On Monday, June 4, 2018 at 6:58:39 PM UTC+8, Gerald Brown wrote: I have been using ./manage.py shell for awhile and now all of a sudden it has stopped working with the error "AttributeError: 'property' object has no attribute '__dict__'".  I

Re: Sponsor subdomain pointing to part of our Django site?

2018-06-04 Thread Richard Brockie
Hi Melvyn, Thanks for the reply. We will test this after getting the ssl certificates sorted out. However, I'm pretty sure that we will need to make some changes to our project to deal with links when the site is being accessed through "subdomain.sponsor.url/". You are correct that {% url %} is

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Gerald Brown
On Monday, June 4, 2018 at 6:58:39 PM UTC+8, Gerald Brown wrote: > > I have been using ./manage.py shell for awhile and now all of a sudden it > has stopped working with the error "AttributeError: 'property' object has > no attribute '__dict__'". I get the same error with anything I enter

python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Gerald Brown
I have been using ./manage.py shell for awhile and now all of a sudden it has stopped working with the error "AttributeError: 'property' object has no attribute '__dict__'". I get the same error with anything I enter after the ./manage.py (i.e. runserver, dbshell, etc) I think it might have

Re: Generating server-side off-line HTML of Django pages ...

2018-06-04 Thread Melvyn Sopacua
On maandag 4 juni 2018 08:00:08 CEST Bernd Wechner wrote: > Say I have a page on my Django website (because I do) that I would like to > take a snapshot of on an automated basis on the server itself with a > crontab say. I imagine writing a small python script that I could run, that > loads

Re: Django bugfix release: 2.0.6

2018-06-04 Thread Umar Kambala
Thanks for the help, After making that corrections, I have another error which is 'APP_DIRS': True, SyntaxError: invalid syntax Need more help On Jun 3, 2018 11:37 AM, "刘家伟" wrote: > Django need template dir to store your html ,so in the setting.py , you > shuold set the template dir like this:

Generating server-side off-line HTML of Django pages ...

2018-06-04 Thread Bernd Wechner
Say I have a page on my Django website (because I do) that I would like to take a snapshot of on an automated basis on the server itself with a crontab say. I imagine writing a small python script that I could run, that loads Django, a settings file, knows a URL and has a way of saying "give me