Re: Channels & WebSocket - failed: Error during WebSocket handshake: Unexpected response code: 403

2019-03-11 Thread Sam Taiwo
I'm not sure, but it looks like you are trying to connect to a localhost
which is fine locally but not in production. You probably need to change
your frontend code to route properly. This is all speculation as you have
not shown your application code, I don't think you'll get many good
answers...

On Tue, Mar 12, 2019, 00:48 stunaz  wrote:

> Hi,
> my set works well in dev, but failed in production
>
> Here is my logs on my server, any advises?
>
>
> 2019-03-11 20:33:22,819 DEBUGParsing Redis URI
> 'redis://localhost:6379'
> 2019-03-11 20:33:22,819 DEBUGCreating tcp connection to ('localhost',
> 6379)
> 2019-03-11 20:33:22,829 DEBUGWebSocket closed for ['127.0.0.1', 49358]
> 2019-03-11 20:33:27,915 DEBUGUpgraded connection ['127.0.0.1', 49364]
> to WebSocket
> 2019-03-11 20:33:27,917 INFO failing WebSocket opening handshake ('Access
> denied')
> 2019-03-11 20:33:27,918 WARNING  dropping connection to peer tcp4:127.0.
> 0.1:49364 with abort=False: Access denied
> 2019-03-11 20:33:27,919 DEBUGWebSocket ['127.0.0.1', 49364] rejected
> by application
>
> --
> 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/b8fb8b10-de4f-46b7-bf96-d4ce4ad86993%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/CAHKA7fBOf_qqMn0%2BcWx%3D6SSyVFZtwi40gEmA2DrQK5Km31KkVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels & WebSocket - failed: Error during WebSocket handshake: Unexpected response code: 403

2019-03-11 Thread stunaz
Hi,
my set works well in dev, but failed in production

Here is my logs on my server, any advises?


2019-03-11 20:33:22,819 DEBUGParsing Redis URI 'redis://localhost:6379'
2019-03-11 20:33:22,819 DEBUGCreating tcp connection to ('localhost', 
6379)
2019-03-11 20:33:22,829 DEBUGWebSocket closed for ['127.0.0.1', 49358]
2019-03-11 20:33:27,915 DEBUGUpgraded connection ['127.0.0.1', 49364] 
to WebSocket
2019-03-11 20:33:27,917 INFO failing WebSocket opening handshake ('Access 
denied')
2019-03-11 20:33:27,918 WARNING  dropping connection to peer tcp4:127.0.0.1:
49364 with abort=False: Access denied
2019-03-11 20:33:27,919 DEBUGWebSocket ['127.0.0.1', 49364] rejected by 
application

-- 
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/b8fb8b10-de4f-46b7-bf96-d4ce4ad86993%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hiii to all

2019-03-11 Thread Gilbeesh Kosma
Welcome in world of  django, i think you must start with a Poll app.
On Mar 12, 2019 2:02 AM, "sahukara harish" 
wrote:

> can any one suggest a simple django project to me.plz
> i am fresher so it can help me to improve my technical knowledge.
>
> --
> 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/CAJTXQ2PSJsaZHBLxRtPwGQ7wx9AGt
> 61O95C4iym7Jz2X5GpPcA%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/CABV4%2BX5C-cJJVTYkQvG97XY7FD30SD_Xy%2BVqXeQz79yZw4AFeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


hiii to all

2019-03-11 Thread sahukara harish
can any one suggest a simple django project to me.plz
i am fresher so it can help me to improve my technical knowledge.

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


Re: Connection Reset by Peer

2019-03-11 Thread Alex Snyder
There's no browser involved. Just another server. If I manually post it 
works fine.

On Monday, March 11, 2019 at 2:17:22 PM UTC-5, Jani Tiainen wrote:
>
> Hi.
>
> Usually error means that client (browser) terminated connection before 
> request was completely handled and returned to client.
>
>
>
>
> ma 11. maalisk. 2019 klo 17.58 Alex Snyder  > kirjoitti:
>
>> Hello,
>> I'm working on a webhook receiver and all was working fine the other day. 
>> Now I'm receiving connection reset by peer errors. The data being posted is 
>> getting received so and I can't figure out why it all of a sudden started 
>> giving errors.
>>
>> Could it be that connections are coming in too quickly? It didn't have a 
>> problem with it before.
>>
>> I'm getting the following:
>> Exception happened during processing of request from ('redacted', 58812)
>> Traceback (most recent call last):
>>   File 
>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line 
>> 650, in process_request_thread
>> self.finish_request(request, client_address)
>>   File 
>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line 
>> 360, in finish_request
>>
>> self.RequestHandlerClass(request, client_address, self)
>>   File 
>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", line 
>> 720, in __init__
>> self.handle()
>>   File 
>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
>>  
>> line 171, in han
>> dle
>> self.handle_one_request()
>>   File 
>> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
>>  
>> line 179, in han
>> dle_one_request
>> self.raw_requestline = self.rfile.readline(65537)
>>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socket.py", line 
>> 589, in readinto
>> return self._sock.recv_into(b)
>> ConnectionResetError: [Errno 54] Connection reset by peer
>>
>>
>> My View
>>
>> @require_POST
>> @csrf_exempt
>> def computer_checkin(request):
>> if request.method == 'POST':
>> #ip = get_client_ip(request)
>> print(request)
>> #request_data = json.loads(request.body.decode("utf-8"))
>> #print(ip)
>> return HttpResponse(201)
>> else:
>> return HttpResponse(400)
>> # if ip in allowed_ip:
>> # #print(request_data['webhook']['webhookEvent'])
>> # return HttpResponse('Pong')
>> # else
>> # return HttpResponseForbidden('Permissions denied')
>>
>>
>> This is what the sending server gives for an error:
>> Exception while trying to post event to 
>> http://redacted:8000/webhooks/ComputerCheckIn - I/O error on POST 
>> request for "http://redacted:8000/webhooks/ComputerCheckIn":Connect to 
>> redacted:8000 [/redacted] failed: connect timed out; nested exception is 
>> org.apache.http.conn.ConnectTimeoutException: Connect to redacted:8000 
>> [/redacted] failed: connect timed out
>>
>>
>> -- 
>> 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/343df769-44f3-4316-882e-a701280b358a%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/12b526ed-da4c-4473-b813-7bbb2c787dfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connection Reset by Peer

2019-03-11 Thread Jani Tiainen
Hi.

Usually error means that client (browser) terminated connection before
request was completely handled and returned to client.




ma 11. maalisk. 2019 klo 17.58 Alex Snyder 
kirjoitti:

> Hello,
> I'm working on a webhook receiver and all was working fine the other day.
> Now I'm receiving connection reset by peer errors. The data being posted is
> getting received so and I can't figure out why it all of a sudden started
> giving errors.
>
> Could it be that connections are coming in too quickly? It didn't have a
> problem with it before.
>
> I'm getting the following:
> Exception happened during processing of request from ('redacted', 58812)
> Traceback (most recent call last):
>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py",
> line 650, in process_request_thread
> self.finish_request(request, client_address)
>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py",
> line 360, in finish_request
>
> self.RequestHandlerClass(request, client_address, self)
>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py",
> line 720, in __init__
> self.handle()
>   File
> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
> line 171, in han
> dle
> self.handle_one_request()
>   File
> "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
> line 179, in han
> dle_one_request
> self.raw_requestline = self.rfile.readline(65537)
>   File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socket.py", line
> 589, in readinto
> return self._sock.recv_into(b)
> ConnectionResetError: [Errno 54] Connection reset by peer
>
>
> My View
>
> @require_POST
> @csrf_exempt
> def computer_checkin(request):
> if request.method == 'POST':
> #ip = get_client_ip(request)
> print(request)
> #request_data = json.loads(request.body.decode("utf-8"))
> #print(ip)
> return HttpResponse(201)
> else:
> return HttpResponse(400)
> # if ip in allowed_ip:
> # #print(request_data['webhook']['webhookEvent'])
> # return HttpResponse('Pong')
> # else
> # return HttpResponseForbidden('Permissions denied')
>
>
> This is what the sending server gives for an error:
> Exception while trying to post event to
> http://redacted:8000/webhooks/ComputerCheckIn - I/O error on POST request
> for "http://redacted:8000/webhooks/ComputerCheckIn":Connect to
> redacted:8000 [/redacted] failed: connect timed out; nested exception is
> org.apache.http.conn.ConnectTimeoutException: Connect to redacted:8000
> [/redacted] failed: connect timed out
>
>
> --
> 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/343df769-44f3-4316-882e-a701280b358a%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/CAHn91odNQT-kvNmh8fSdgPLOhzRGaSzGTCHaJHzT_yQL4KtGVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Abdulrasheed Ibrahim
Off course, I'll love to join.

On Mon, Mar 11, 2019 at 2:54 PM Joshua Kayode 
wrote:

> Hello dear try this: *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI
> *
>
> On Mon, Mar 11, 2019, 14:43 Cathbert Mutaurwa 
>> Im receiving a message saying my invite is invalid.
>>
>> On Mon, 11 Mar 2019, 15:30 Joshua Kayode, 
>> wrote:
>>
>>> Here is the link *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI*
>>>
>>> On Mon, Mar 11, 2019, 14:20 Cathbert Mutaurwa >> wrote:
>>>
 I am in south africa, is it possible if i wanna join?

 On Mon, 11 Mar 2019, 15:15 Joshua Kayode, 
 wrote:

> Greetings, if you are a django developer in Nigeria, would you
> consider joining a WhatsApp group?
>
> --
> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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%2BjnFn8qUCeJRZyTvXknPCEhTrreSGDcYMwCXDaNzktt9b%2B4QQ%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/CAEL9fCGAFZ7nVwprFniryyYsCf5yesOk%2BaaC8aq20Uo3sXfVgA%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%2BjnFn-yyJKQAqYWG2vcFTfTkG%3D8T69qXSg2-vB%2BDjP3kpLFBQ%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/CAEL9fCFjAbYwikvZmOKjshdwj_ubaG4Wa-r4j-ZFPr%2B99Dym6w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Abdulrasheed Ibrahim
about.me/abdoul


-- 
You received this message because you are 

Re: Using sessions key variables as a url argument

2019-03-11 Thread Ranganath Kulkarni
You can define urlpatterns as below:

url(r'^club_home/$/teams/', include('clubkit.clubs.urls'), name='clubs'),


So that $ will match for any single value primary key.

On Sunday, March 10, 2019 at 2:57:43 PM UTC, GavinB841 wrote:
>
> Hi all, 
>
> I am not sure if this is possible as I could find nothing online but would 
> appreciate any alternative solution.
>
>- In my view I obtain a pk which is set as a session key 
>- I need to pass that session key variable into the url argument.
>
> e.g. http://127.0.0.1:8000/club_home//teams/
>
> Code below, any other samples of code needed let me know
>
> Thanks
> Gav
>
> *Main Urls*
>
> urlpatterns = [
> url('admin/', admin.site.urls),
> url(r'^club_home/', include('clubkit.clubs.urls'), name='clubs'),
> ]
>
> *Urls.py*
>
> urlpatterns = [
> path('', views.club_home, name='club_home'),
> path('teams/', views.TeamInfo.as_view(), name='teams'),
> path('pitches/', views.PitchInfo.as_view(), name='pitches'),
> ]
>
> *View.py:*
>
> def club_home(request, pk=None):
> if pk:
> request.session['pk'] = pk
> club = ClubInfo.objects.filter(pk=pk)
> club_posts = ClubPosts.objects.filter(club_id=club[0])
> else:
> club_pk = request.session.get('pk')
> club = ClubInfo.objects.filter(pk=club_pk)
> club_posts = ClubPosts.objects.filter(club_id=club[0])
> args = {'club': club,
> 'club_posts': club_posts
> }
> return render(request, 'club_home_page.html', args)
>
>
> *Séanadh Ríomhphoist/Email DisclaimerTá an ríomhphost seo agus aon chomhad 
> a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin 
> é. Is féidir tuilleadh a léamh anseo. 
>   
> This e-mail and any 
> files transmitted with it are confidential and are intended solely for use 
> by the addressee. Read more here. 
>  *
>
>

-- 
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/f1c01eb1-7255-4b65-a9bc-90a8910c5143%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Lazy ForeignKey references break in upgrade from 1.9 to 1.10

2019-03-11 Thread James
Hey everyone,

While upgrading from 1.9 to 1.10, I got errors that lazy ForeignKey 
references cannot be resolved similar to the following (full stack trace is 
included below):

ValueError: Related model 'appname.ModelName' cannot be resolved

This occurs with anything from simple models to abstract models, 
referencing other models within the same app, other apps, and recursive 
relationships ('self').

In searching, I've found similar issues relating to migrations, however 
this happens when I call manage.py "runserver" or "shell". I haven't run or 
defined any migrations in 1.10 yet.



Full stack trace (using Django 1.10; directories and the app name have been 
obfuscated from the original)
Note: This error references a model using an abstract model, but as stated 
above this is just one instance where it doesn't work. If I were to 
temporarily comment out the field, it would just error out with the next 
one.

user@host:/pwd$ python manage.py shell
Traceback (most recent call last):
  File "./manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 367, in execute_from_command_line
utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 341, in execute
django.setup()
  File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 
27, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", 
line 108, in populate
app_config.import_models(all_models)
  File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 
199, in import_models
self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in 
import_module
__import__(name)
  File "/pwd/app/models.py", line 482, in 
class Employee(EmployeeDatedFieldsAbstractModel, AbstractBaseUser, 
PermissionsMixin):
  File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", 
line 309, in __new__
new_class._prepare()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", 
line 349, in _prepare
if not opts.managers or cls._requires_legacy_default_manager():
  File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", 
line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/options.py", 
line 374, in managers
manager = copy.copy(manager)
  File "/usr/local/lib/python2.7/copy.py", line 88, in copy
rv = reductor(2)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", 
line 208, in __getstate__
self._fetch_all()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", 
line 1085, in _fetch_all
self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", 
line 54, in __iter__
results = compiler.execute_sql()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 824, in execute_sql
sql, params = self.as_sql()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 369, in as_sql
extra_select, order_by, group_by = self.pre_sql_setup()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 46, in pre_sql_setup
self.setup_query()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 37, in setup_query
self.select, self.klass_info, self.annotation_col_map = 
self.get_select()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 194, in get_select
for c in self.get_default_columns():
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler
.py", line 516, in get_default_columns
column = field.get_col(alias)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/
related.py", line 954, in get_col
return super(ForeignKey, self).get_col(alias, output_field or 
self.target_field)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/
related.py", line 855, in target_field
return self.foreign_related_fields[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/
related.py", line 595, in foreign_related_fields
return tuple(rhs_field for lhs_field, rhs_field in self.related_fields 
if rhs_field)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/
related.py", line 582, in related_fields
self._related_fields = self.resolve_related_fields()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/
related.py", line 567, in resolve_related_fields
raise ValueError('Related model %r cannot be resolved' % 
self.remote_field.model)
ValueError: Related model 'app.Department' cannot be resolved


-- 

Fatal error

2019-03-11 Thread lakshmyyreddy
Hii all 
While I am creating django project I have getting this type of error Fatal 
error in launcher : Unable to create process using'"'
I tried python -m pip install --upgrade pip
Python -m pip install -U pip
Python -m pip install virtualenv

Can anybody please help me

-- 
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/15d843bb-1b95-4a0d-ba7b-2e5023fd15d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Connection Reset by Peer

2019-03-11 Thread Alex Snyder
Hello,
I'm working on a webhook receiver and all was working fine the other day. 
Now I'm receiving connection reset by peer errors. The data being posted is 
getting received so and I can't figure out why it all of a sudden started 
giving errors.

Could it be that connections are coming in too quickly? It didn't have a 
problem with it before.

I'm getting the following:
Exception happened during processing of request from ('redacted', 58812)
Traceback (most recent call last):
  File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", 
line 650, in process_request_thread
self.finish_request(request, client_address)
  File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", 
line 360, in finish_request

self.RequestHandlerClass(request, client_address, self)
  File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socketserver.py", 
line 720, in __init__
self.handle()
  File 
"/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
 
line 171, in han
dle
self.handle_one_request()
  File 
"/Users/myuser/anaconda3/envs/myenv/lib/python3.7/site-packages/django/core/servers/basehttp.py",
 
line 179, in han
dle_one_request
self.raw_requestline = self.rfile.readline(65537)
  File "/Users/myuser/anaconda3/envs/myenv/lib/python3.7/socket.py", line 
589, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer


My View

@require_POST
@csrf_exempt
def computer_checkin(request):
if request.method == 'POST':
#ip = get_client_ip(request)
print(request)
#request_data = json.loads(request.body.decode("utf-8"))
#print(ip)
return HttpResponse(201)
else:
return HttpResponse(400)
# if ip in allowed_ip:
# #print(request_data['webhook']['webhookEvent'])
# return HttpResponse('Pong')
# else
# return HttpResponseForbidden('Permissions denied')


This is what the sending server gives for an error:
Exception while trying to post event to 
http://redacted:8000/webhooks/ComputerCheckIn - I/O error on POST request 
for "http://redacted:8000/webhooks/ComputerCheckIn":Connect to 
redacted:8000 [/redacted] failed: connect timed out; nested exception is 
org.apache.http.conn.ConnectTimeoutException: Connect to redacted:8000 
[/redacted] failed: connect timed out


-- 
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/343df769-44f3-4316-882e-a701280b358a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Font Awesome does not work locally

2019-03-11 Thread Ing.Daniel Bojorge
Try to see the console output of your web browser.  There you can see the
url where want to load fontawesome_all.css file.


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes*

*WebService RestFul API con Python usando Django RestFrameWork*

*Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*

*Programación en Capas (Web y Escritorio)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El lun., 11 mar. 2019 a las 9:12, Mujab Nasraldeen (<
mujabnasraldee...@gmail.com>) escribió:

>  font awesome does not work locally .. without using: https://use.fontawesome.com/releases/v5.7.2/css/all.css;
> integrity="
> sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
> crossorigin="anonymous">
>
>  I replaced it with: 
>
> but when but when i type:  .. but
> the page displays as a square
>
> How to solve this problem???
>
> --
> 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/57773dd9-1a60-4c58-a706-a39959e9e28e%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/CAMQeQjaD4MNvG3_8CK_9kV4jdGnaXW%3DVeDZ%2B-QMithVVsmyD6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Font Awesome does not work locally

2019-03-11 Thread Joel Mathew
It's related to your static address. You're probably not setting the
correct relative path. Check the tutorials on how the settings for STATIC
files work
Sincerely yours,

 Joel G Mathew



On Mon, 11 Mar 2019 at 20:42, Mujab Nasraldeen 
wrote:

>  font awesome does not work locally .. without using: https://use.fontawesome.com/releases/v5.7.2/css/all.css;
> integrity="
> sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
> crossorigin="anonymous">
>
>  I replaced it with: 
>
> but when but when i type:  .. but
> the page displays as a square
>
> How to solve this problem???
>
> --
> 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/57773dd9-1a60-4c58-a706-a39959e9e28e%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_-_zEBrvdsfK79K-0dOQ2aPpc%3DnP-2uNQQF7mdX637UDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Font Awesome does not work locally

2019-03-11 Thread Mujab Nasraldeen
 font awesome does not work locally .. without using: https://use.fontawesome.com/releases/v5.7.2/css/all.css; integrity="
sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" 
crossorigin="anonymous">

 I replaced it with: 

but when but when i type:  .. but 
the page displays as a square

How to solve this problem???

-- 
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/57773dd9-1a60-4c58-a706-a39959e9e28e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Listing the number of acts or posts in a given category in django

2019-03-11 Thread rakshitam0407
How do I list the NUMBER of posts under a given category and display it in 
the format of :-
 
   Category1 : 100 // number of acts in Category1
   Category2 : 200 // number of acts in Category2

Please help me out as soon as possible

-- 
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/de5983e2-5d8b-4386-aef5-4688ce7e4f37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AttributeError: type object 'NHTTrainerInline' has no attribute '_meta'

2019-03-11 Thread raghav b
I keep getting this error not sure what i am doing wrong!!

Traceback (most recent call last):
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py",
 
line 225, in wrapper
fn(*args, **kwargs)
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py",
 
line 109, in inner_run
autoreload.raise_last_exception()
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py",
 
line 248, in raise_last_exception
raise _exception[1]
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py",
 
line 337, in execute
autoreload.check_errors(django.setup)()
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py",
 
line 225, in wrapper
fn(*args, **kwargs)
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\__init__.py",
 
line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\registry.py",
 
line 120, in populate
app_config.ready()
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\contrib\admin\apps.py",
 
line 24, in ready
self.module.autodiscover()
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\contrib\admin\__init__.py",
 
line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\module_loading.py",
 
line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py",
 
line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File "C:\Users\IBM_ADMIN\TrainingCentral\NHT\admin.py", line 38, in 

admin.site.register([NHTTrainer, NHTTrainerInline])
  File 
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\contrib\admin\sites.py",
 
line 103, in register
if model._meta.abstract:
AttributeError: type object 'NHTTrainerInline' has no attribute '_meta'


Models:

from django.db import models
from TRAC.models import Candidate


# Create your models here.
location = (
('Bangalore-EGL', 'Bangalore-EGL'),
('Bangalore-MTP', 'Bangalore-MTP'),
('Pune', 'Pune'),
('Noida', 'Noida'),
('Gurgaon', 'Gurgaon'),
('Hyderabad', 'Hyderabad'),
)


class NHTTrainer(models.Model):
employee_id = models.CharField(max_length=9, primary_key=True)
first_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=200)
created = models.DateField(auto_now_add=True)
updated = models.DateField(auto_now_add=True)

def __str__(self):
return self.first_name + " " + self.middle_name + " " + self.last_name

class Meta:
verbose_name_plural = "NHT Trainers"
verbose_name = "NHT Trainer"


class NHTBatch(models.Model):
BatchID = models.CharField(max_length=100, primary_key=True)
start_date = models.DateField()
end_date = models.DateField()
location = models.CharField(max_length=200, choices=location)
total_days_in_training = models.IntegerField(default=5)
total_number_of_agents = models.IntegerField()
trainer = models.ForeignKey(NHTTrainer, on_delete=models.DO_NOTHING)

def __str__(self):
return self.BatchID

class Meta:
verbose_name_plural = "Batches"


class NHTraineeDetails(Candidate):
employeeID = models.CharField(max_length=9)
NHTBatch = models.ForeignKey(NHTBatch, on_delete=models.DO_NOTHING)

class Meta:
verbose_name_plural = "NHT Trainee Details"



Admin:

from django.contrib import admin
from .models import *
# Register your models here.


class NHTTrainerInline(admin.TabularInline):
model = NHTTrainer
fk_name = "NHTTrainer"


class NHTraineeDetailsInline(admin.TabularInline):
model = NHTraineeDetails
fk_name = "NHTraineeDetails"


class NHTBatchInline(admin.TabularInline):
model = NHTBatch
fk_name = "NHTBatch"


class AdminInline(admin.ModelAdmin):
inlines = [
NHTTrainerInline,
NHTraineeDetailsInline,
NHTBatchInline,
]

class Meta:
verbose_name_plural = "Add Batches"


admin.site.register([NHTTrainer, NHTTrainerInline])

Re: how to create a Django project without using an IDE, but using the django-admin startproject command

2019-03-11 Thread Carlos Eduardo
Another tip is using templates to create your project. I'm developing one 
but the first version is already published. I added the template on GitHub 
with a good how-to.

https://github.com/tresloukadu/Django-Bootstrap-Project

Em sábado, 9 de março de 2019 15:15:01 UTC-3, Ando Rakotomanana escreveu:
>
> Hello, I'm still starting with django. And I have a problem with the 
> creation of the project, I write: "django-admin startproject DjangoTest" in 
> the cmd of my windows and it tells me that django-admin is not an internal 
> command. While I typed the same code this morning in the cmd and it worked. 
> And I do not understand why?
> I have python 2.7.0 and 3.7.2 and django 1.6.2 installed on my windows 8.1
>

-- 
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/547baceb-dd22-49a0-a667-18bce52b4dfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Joshua Kayode
Hello dear try this: *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI
*

On Mon, Mar 11, 2019, 14:43 Cathbert Mutaurwa  Im receiving a message saying my invite is invalid.
>
> On Mon, 11 Mar 2019, 15:30 Joshua Kayode, 
> wrote:
>
>> Here is the link *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI*
>>
>> On Mon, Mar 11, 2019, 14:20 Cathbert Mutaurwa >
>>> I am in south africa, is it possible if i wanna join?
>>>
>>> On Mon, 11 Mar 2019, 15:15 Joshua Kayode, 
>>> wrote:
>>>
 Greetings, if you are a django developer in Nigeria, would you consider
 joining a WhatsApp group?

 --
 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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%2BjnFn8qUCeJRZyTvXknPCEhTrreSGDcYMwCXDaNzktt9b%2B4QQ%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/CAEL9fCGAFZ7nVwprFniryyYsCf5yesOk%2BaaC8aq20Uo3sXfVgA%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%2BjnFn-yyJKQAqYWG2vcFTfTkG%3D8T69qXSg2-vB%2BDjP3kpLFBQ%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/CAEL9fCFjAbYwikvZmOKjshdwj_ubaG4Wa-r4j-ZFPr%2B99Dym6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Cathbert Mutaurwa
Im receiving a message saying my invite is invalid.

On Mon, 11 Mar 2019, 15:30 Joshua Kayode,  wrote:

> Here is the link *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI*
>
> On Mon, Mar 11, 2019, 14:20 Cathbert Mutaurwa 
>> I am in south africa, is it possible if i wanna join?
>>
>> On Mon, 11 Mar 2019, 15:15 Joshua Kayode, 
>> wrote:
>>
>>> Greetings, if you are a django developer in Nigeria, would you consider
>>> joining a WhatsApp group?
>>>
>>> --
>>> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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%2BjnFn8qUCeJRZyTvXknPCEhTrreSGDcYMwCXDaNzktt9b%2B4QQ%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/CAEL9fCGAFZ7nVwprFniryyYsCf5yesOk%2BaaC8aq20Uo3sXfVgA%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%2BjnFn-yyJKQAqYWG2vcFTfTkG%3D8T69qXSg2-vB%2BDjP3kpLFBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Joshua Kayode
Thank you for your interest Here is the link:
https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI

On Mon, Mar 11, 2019, 14:33 Sarah Nwandu  Yes @joshuakayode...@gmail.com
>
> On Mon, Mar 11, 2019 at 2:16 PM Joshua Kayode 
> wrote:
>
>> Greetings, if you are a django developer in Nigeria, would you consider
>> joining a WhatsApp group?
>>
>> --
>> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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/CAGQ0LK1Q88G%2Bus_LDuBuXcJ0t2HPbp%3Db560pE%3Dno9Fch%3DHhWLw%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/CAEL9fCH_46CqAfZwXhGjJtSyOHcZtYJGZRk81_UYTFgrCsu1hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread federico abah
Yes.
I am a Django developer from Equatorial Guinea and would like to join a
watsapp group. It will be helpful.


Atentamente
Federico

A segunda, 11 de mar de 2019, 13:33, Sarah Nwandu 
escreveu:

> Yes @joshuakayode...@gmail.com
>
> On Mon, Mar 11, 2019 at 2:16 PM Joshua Kayode 
> wrote:
>
>> Greetings, if you are a django developer in Nigeria, would you consider
>> joining a WhatsApp group?
>>
>> --
>> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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/CAGQ0LK1Q88G%2Bus_LDuBuXcJ0t2HPbp%3Db560pE%3Dno9Fch%3DHhWLw%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/CAFDzUvX%2B46JPNTf0sSvewOa4YL-_NJTynkNAk%2BtD1u8VZbr9bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What step am I missing?

2019-03-11 Thread Joseph Jones
Thank you so much, does one bring up the cd command in the python terminal?

On Mon, Mar 11, 2019 at 8:07 AM Kayode Oladipo 
wrote:

> You have to be in the project level directory to access 'manage.py'.
> Use the 'cd' command in the terminal to do this.
>
> On Sun, Mar 10, 2019, 23:23 Joseph Jones 
>> Hello all!
>> I have been reading
>> https://www.packtpub.com/application-development/learn-python-programming-second-edition
>>  Since
>> November, so I am very much new to the Python community. I am currently on
>> chapter 14 "Web development" which suggests completing the tutorial on
>> djangoproject.com after installing Django of course. When I've run the
>> first two commands in the cmd of my PC I get the output the tutorial would
>> indicate. However when I run the command .../> py manage.py runserver I
>> receive a command error that no such file exists. My question is what
>> mistake am I making? I'm hypothesizing one is to create a file entitled
>> "manage.py' before beginning, however unless I'm misreading the text in the
>> tutorial the command .../> django-admin startproject runserver
>> auto-generates said file. Any suggestions on what I'm doing wrong would be
>> immensely appreciated. Let me apologize in advance if I either, ask for
>> clarification in any responses(again I am new), or mess up again through
>> out the course of the tutorial and again reach out to the community. Thank
>> you for any help,
>> Joseph
>>
>> --
>> 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/CAJGsC5OzcyMwrW%3D-EmU%2B-3o8esQ2JeVQoJScq%3DHy_mtsxKRuKQ%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%2BARzD8BiTZ8Rzfi9twFF7GTzYpBZqpCdpR3K_tGW5b1Rfsdrw%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/CAJGsC5N2poHoALgwHLkk%3D9o9jGeUZ1NStedbnBS-oLdYgVzSQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Sarah Nwandu
Yes @joshuakayode...@gmail.com

On Mon, Mar 11, 2019 at 2:16 PM Joshua Kayode 
wrote:

> Greetings, if you are a django developer in Nigeria, would you consider
> joining a WhatsApp group?
>
> --
> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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/CAGQ0LK1Q88G%2Bus_LDuBuXcJ0t2HPbp%3Db560pE%3Dno9Fch%3DHhWLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What step am I missing?

2019-03-11 Thread Joseph Jones
On Mon, Mar 11, 2019 at 8:07 AM Kayode Oladipo 
wrote:

> You have to be in the project level directory to access 'manage.py'.
> Use the 'cd' command in the terminal to do this.
>
> On Sun, Mar 10, 2019, 23:23 Joseph Jones 
>> Hello all!
>> I have been reading
>> https://www.packtpub.com/application-development/learn-python-programming-second-edition
>>  Since
>> November, so I am very much new to the Python community. I am currently on
>> chapter 14 "Web development" which suggests completing the tutorial on
>> djangoproject.com after installing Django of course. When I've run the
>> first two commands in the cmd of my PC I get the output the tutorial would
>> indicate. However when I run the command .../> py manage.py runserver I
>> receive a command error that no such file exists. My question is what
>> mistake am I making? I'm hypothesizing one is to create a file entitled
>> "manage.py' before beginning, however unless I'm misreading the text in the
>> tutorial the command .../> django-admin startproject runserver
>> auto-generates said file. Any suggestions on what I'm doing wrong would be
>> immensely appreciated. Let me apologize in advance if I either, ask for
>> clarification in any responses(again I am new), or mess up again through
>> out the course of the tutorial and again reach out to the community. Thank
>> you for any help,
>> Joseph
>>
>> --
>> 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/CAJGsC5OzcyMwrW%3D-EmU%2B-3o8esQ2JeVQoJScq%3DHy_mtsxKRuKQ%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%2BARzD8BiTZ8Rzfi9twFF7GTzYpBZqpCdpR3K_tGW5b1Rfsdrw%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/CAJGsC5PvHUjG_P9%3D8KXQjBjGh7vgdGVQaAeheb8%2BuQt_SFGWdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Joshua Kayode
Here is the link *https://chat.whatsapp.com/Fq7rxuwkE3V1ebmGGjpaAI*

On Mon, Mar 11, 2019, 14:20 Cathbert Mutaurwa  I am in south africa, is it possible if i wanna join?
>
> On Mon, 11 Mar 2019, 15:15 Joshua Kayode, 
> wrote:
>
>> Greetings, if you are a django developer in Nigeria, would you consider
>> joining a WhatsApp group?
>>
>> --
>> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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%2BjnFn8qUCeJRZyTvXknPCEhTrreSGDcYMwCXDaNzktt9b%2B4QQ%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/CAEL9fCGAFZ7nVwprFniryyYsCf5yesOk%2BaaC8aq20Uo3sXfVgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello From Nigeria

2019-03-11 Thread Cathbert Mutaurwa
I am in south africa, is it possible if i wanna join?

On Mon, 11 Mar 2019, 15:15 Joshua Kayode,  wrote:

> Greetings, if you are a django developer in Nigeria, would you consider
> joining a WhatsApp group?
>
> --
> 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/CAEL9fCFn_XXW26_wXAz0K%3DaHTA31mhWMhhCQcxvpMSn1ZMSuEg%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%2BjnFn8qUCeJRZyTvXknPCEhTrreSGDcYMwCXDaNzktt9b%2B4QQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Hello From Nigeria

2019-03-11 Thread Joshua Kayode
Greetings, if you are a django developer in Nigeria, would you consider
joining a WhatsApp group?

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


Re: What step am I missing?

2019-03-11 Thread Kayode Oladipo
You have to be in the project level directory to access 'manage.py'.
Use the 'cd' command in the terminal to do this.

On Sun, Mar 10, 2019, 23:23 Joseph Jones  Hello all!
> I have been reading
> https://www.packtpub.com/application-development/learn-python-programming-second-edition
>  Since
> November, so I am very much new to the Python community. I am currently on
> chapter 14 "Web development" which suggests completing the tutorial on
> djangoproject.com after installing Django of course. When I've run the
> first two commands in the cmd of my PC I get the output the tutorial would
> indicate. However when I run the command .../> py manage.py runserver I
> receive a command error that no such file exists. My question is what
> mistake am I making? I'm hypothesizing one is to create a file entitled
> "manage.py' before beginning, however unless I'm misreading the text in the
> tutorial the command .../> django-admin startproject runserver
> auto-generates said file. Any suggestions on what I'm doing wrong would be
> immensely appreciated. Let me apologize in advance if I either, ask for
> clarification in any responses(again I am new), or mess up again through
> out the course of the tutorial and again reach out to the community. Thank
> you for any help,
> Joseph
>
> --
> 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/CAJGsC5OzcyMwrW%3D-EmU%2B-3o8esQ2JeVQoJScq%3DHy_mtsxKRuKQ%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%2BARzD8BiTZ8Rzfi9twFF7GTzYpBZqpCdpR3K_tGW5b1Rfsdrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Do not render empty fields

2019-03-11 Thread Andréas Kühne
Hi,

First of all I would say that I think you should rethink how you store the
ingredients. What I would do is create a recipe model that has a number of
ingredients (an ingredient model with a foreign key to the recipe).
Therefor you would be able to do this in your template:

Ingredients

{% for ingredient in receta.ingredients %}
 {{ ingredient.name }}


However - if you want to continue with your solution with a fixed number of
ingredients you would be able to do this:
Ingredients

{{ receta.ingrediente_1 }}
{% if receta.ingrediente_2 %}{{
receta.ingrediente_2 }}{%endif%}
{% if receta.ingrediente_3 %}{{
receta.ingrediente_3 }}{%endif%}
{% if receta.ingrediente_4 %}{{
receta.ingrediente_4 }}{%endif%}


This code assumes that at least ONE ingredient should be present in each
recipe. The others are added when needed.

Regards,

Andréas

Den sön 10 mars 2019 kl 15:24 skrev Barkalez XX :

> Hello guys,
>
>  I'm learning django and I have some doubts, I suppose that from now on
> you'll see me a lot here because my doubts are endless :).
>
> I'm doing a simple recipe app, and some recipes have more ingredients than
> others and when I render them, empty fields take up space in the rendered
> HTML. I show you how the HTML is. I also include the repo in github.
>
> https://github.com/barkalez/recetas
>
>
>
> [image: Duda1.png]
>
> --
> 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/2c9c280f-0ae2-4e2d-b9d1-3de7e95369df%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/CAK4qSCc9pLMx6ZW-Opv4oOLNsBSwyYpHyGtF6eNWysFxUe5kFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Error logging in to admin potal in Django 2.1.7

2019-03-11 Thread Rishiraj Saxena
I am new to Django when I try to log in to Django using environment 
variables as the latest version of Django I am unable to log in to admin 
portal of Django with correct username and password that I created using 
"python manage.py createsuperuser". But when I try to do the same thing 
using Django 2.0.7 I am able to log in but then I  can not update the 
objects as i get the error No such table: main.auth_user__old. What should 
i do??

-- 
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/3ea951ca-b65d-4446-9b70-efc66908e666%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using sessions key variables as a url argument

2019-03-11 Thread Perchouli
Not sure I understand about the "pass that session key variable into the
URL argument". But if you want the URL
(http://127.0.0.1:8000/club_home//teams/) works, change this path:

urlpatterns = [
path('/teams/', views.club_home, name='club_home'),
]



On Sun, Mar 10, 2019 at 10:57 PM Gavin Boyle 
wrote:

> Hi all,
>
> I am not sure if this is possible as I could find nothing online but would
> appreciate any alternative solution.
>
>- In my view I obtain a pk which is set as a session key
>- I need to pass that session key variable into the url argument.
>
> e.g. http://127.0.0.1:8000/club_home//teams/
>
> Code below, any other samples of code needed let me know
>
> Thanks
> Gav
>
> *Main Urls*
>
> urlpatterns = [
> url('admin/', admin.site.urls),
> url(r'^club_home/', include('clubkit.clubs.urls'), name='clubs'),
> ]
>
> *Urls.py*
>
> urlpatterns = [
> path('', views.club_home, name='club_home'),
> path('teams/', views.TeamInfo.as_view(), name='teams'),
> path('pitches/', views.PitchInfo.as_view(), name='pitches'),
> ]
>
> *View.py:*
>
> def club_home(request, pk=None):
> if pk:
> request.session['pk'] = pk
> club = ClubInfo.objects.filter(pk=pk)
> club_posts = ClubPosts.objects.filter(club_id=club[0])
> else:
> club_pk = request.session.get('pk')
> club = ClubInfo.objects.filter(pk=club_pk)
> club_posts = ClubPosts.objects.filter(club_id=club[0])
> args = {'club': club,
> 'club_posts': club_posts
> }
> return render(request, 'club_home_page.html', args)
>
>
> *Séanadh Ríomhphoist/Email DisclaimerTá an ríomhphost seo agus aon chomhad
> a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin
> é. Is féidir tuilleadh a léamh anseo.
> 
> This e-mail and any
> files transmitted with it are confidential and are intended solely for use
> by the addressee. Read more here.
>  *
>
> --
> 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/CAHZR7Jfbaf91WFE47EaqqjNch3dqVd-_9%2BLd8FUAPcuNOBFhww%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/CAN%2BSpDJh%3D7k%2B_tmypfvQxp8hyZXNLTGNH4rfAEhqP2L2hc6jEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.