Re: Tutorial Part 1

2020-05-09 Thread tejasri mamidi
Change mysite.urls ,
Path(' ',include('polls.url'))...

You were not created any polls function your view and and not import any
polls view in your mysite.urls

On Sun, May 10, 2020, 01:15 Randy Zeitvogel 
wrote:

> This is from my mysite/settings.py file:
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> This is from my polls/urls.py
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('', views.details, name='detail'),
> path('/results/', views.results, name='results'),
> path('/vote/', views.vote, name='vote'),
> ]
>
> This is from polls/apps.py
>
> from django.apps import AppConfig
>
>
> class PollsConfig(AppConfig):
> name = 'polls'
>
>
>
> On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu <
> nagarajusingoth...@gmail.com> wrote:
>
>> Dear Sir,
>>
>>First add your app in settings.py,then after
>> URLs.py
>>  from django.urls import path,include
>>  from ur(appname) import views
>>
>> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
>> wrote:
>>
>>> I just started working with Django in the last couple of days.
>>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
>>> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
>>> In both cases after I create the polls app and try it out, I get this:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://localhost:8000/polls/
>>>
>>> Using the URLconf defined in mysite.urls, Django tried these URL
>>> patterns, in this order:
>>>
>>>1. admin/
>>>
>>> The current path, polls/, didn't match any of these.
>>>
>>> You're seeing this error because you have DEBUG = True in your Django
>>> settings file. Change that to False, and Django will display a standard
>>> 404 page.
>>>
>>>
>>> The feedback from the development web server (python manage.py
>>> runserver) is:
>>>
>>>
>>> jango version 3.0.6, using settings 'mysite.settings'
>>> Starting development server at http://127.0.0.1:8000/
>>> Quit the server with CONTROL-C.
>>> Not Found: /polls/
>>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>>>
>>> My mysite/urls.py looks like this:
>>>
>>>
>>> from django.contrib import admin
>>> from django.urls import include, path
>>>
>>> urlpatterns = [
>>> path('polls/', include('polls.urls')),
>>> path('admin/', admin.site.urls),
>>> ]
>>>
>>>
>>> Any help would be appreciated.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP6hVmA0-TCTj%2B%3DqqseEq%2BKjaVtiCo7bbSiLmNKX9-AnSZiCqg%40mail.gmail.com.


Re: No module named 'blog'

2020-05-09 Thread sahil khan
I think blog app is not there where manage.py file. please check and if
your blog app's location is wrong delete blog app and create again app
inside your project with correct  location.

New app command:

Django-admin startapp 

On Sat, 9 May 2020, 7:26 pm sri vishva,  wrote:

> Try creating a new app Blog using
> >>pip install django-admin startapp Blog
> And now replace the existing files with your contents
>
> On Fri, 8 May 2020, 4:22 pm Mukesh Badgujar, 
> wrote:
>
>> First... I... created Project at my machine... then... uploaded to
>> github then from  git i import it to my namecheap shared hosting
>> server, i created python app in that folder, then i run migrations cmds...
>> but apps are not detected by django
>>
>> On Thu, 7 May, 2020, 6:09 pm Mohsen Pahlevanzadeh, <
>> m.pahlevanza...@gmail.com> wrote:
>>
>>> Where did you import your module?
>>>
>>> On Thu, May 7, 2020 at 3:09 PM Mukesh Badgujar <
>>> mukesh.badgujar...@gmail.com> wrote:
>>>
 already added

 'home.apps.HomeConfig',
 'blog.apps.BlogConfig',
 'shop.apps.shopConfig',

 one thing is that, i copied this app folder frm my other project, this
 is not created here


 On Sunday, 9 August 2015 22:43:38 UTC+5:30, Robin Lery wrote:
>
> Did you add your 'blog' app in the installed apps in settings.py?
>
> On Sun, Aug 9, 2015 at 10:35 PM, Maggie Chang 
> wrote:
>
>> hi all,
>> would like to seek for everyone's help.
>> I am following the django girls instruction =>
>> http://tutorial.djangogirls.org/en/django_urls/index.html#your-first-django-url,
>> but encounter the problem.
>> when I connect to 127.0.0.1:8000, I got the No module named 'blog'
>> response.
>> Here's the message on browser.
>> **
>> ImportError at /
>>
>> No module named 'blog'
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>> Django Version: 1.8
>> Exception Type: ImportError
>> Exception Value:
>>
>> No module named 'blog'
>>
>> Exception Location: /usr/lib/python3.4/importlib/__init__.py in
>> import_module, line 109
>> Python Executable: /home/maggie/djangoanywhere/venv/bin/python
>> Python Version: 3.4.0
>> Python Path:
>>
>> ['/home/maggie/djangoanywhere',
>>  '/usr/lib/python3.4',
>>  '/usr/lib/python3.4/plat-x86_64-linux-gnu',
>>  '/usr/lib/python3.4/lib-dynload',
>>  '/home/maggie/djangoanywhere/venv/lib/python3.4/site-packages']
>>
>> Server time: Mon, 10 Aug 2015 00:47:53 +0800
>> **
>>
>> This issue occurred when I add *url(r'', include('blog.urls')), *
>> into *magsite/url.py*
>> **
>> *url.py*
>> **
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>>
>> urlpatterns = [
>> url(r'^admin/', include(admin.site.urls)),
>> url(r'', include('blog.urls')),
>> ]
>> **
>> Any idea about the root cause? :(
>> and any response will be appreciate.
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/0c3ba90d-97d3-448c-8656-0b2ad6becca7%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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/4a25e83a-0f62-4f60-8401-618252682a22%40googlegroups.com
 
 .

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

Django models for user

2020-05-09 Thread Irfan Khan
i am working on a LMS project, so if a tutor signed up and he can upload
his tutorials from his account.
And  when rendering to template each user should have their list of
tutorials. as well as he will upload new tutorials.

How to design it dynamically. Please guide me.

Thank you in advance.

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


Re: Multiple submit for same form refresh the page

2020-05-09 Thread Motaz Hejaze
try this :




On Sun, May 10, 2020 at 1:01 AM Jim Illback  wrote:

> Nirantar, I think you could do this in your class (or even in your
> function if you use that instead):
>   - Override (or use) the get() method
>   - Add a conditional such as this in that get() method:
> if request.GET.get(*‘**wordcloud**’*):
> 
> elif request.GET.get(‘bar’):
> 
> …
>
> Good luck!
> Jim Illback
>
>
> On May 9, 2020, at 6:15 AM, Nirantar Kulkarni  wrote:
>
> html template
>  name="sub_form">
> {% csrf_token %}
>   {{name}}
>"wordcloud">WordCloud
>"bar">Text_Analysis
>   Sentiment
> Analysis
>  
>
> I have multiple submit buttons for same form and each button refreshes the
> page
> I don't want it to refresh as it removes all changes made by one button to
> perform changes made by another 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/14a8c9f5-c949-4caa-a3dd-87af0d4d39c4%40googlegroups.com
> 
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CY4PR04MB11914DFB0F50E1AEB0E25B0A9DA30%40CY4PR04MB1191.namprd04.prod.outlook.com
> 
> .
>

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


Re: Multiple submit for same form refresh the page

2020-05-09 Thread Jim Illback
Nirantar, I think you could do this in your class (or even in your function if 
you use that instead):
  - Override (or use) the get() method
  - Add a conditional such as this in that get() method:
if request.GET.get(‘wordcloud’):

elif request.GET.get(‘bar’):

…

Good luck!
Jim Illback


> On May 9, 2020, at 6:15 AM, Nirantar Kulkarni  wrote:
> 
> html template
>  name="sub_form">
> {% csrf_token %}
>   {{name}}
>"wordcloud">WordCloud
>"bar">Text_Analysis
>   Sentiment 
> Analysis
>  
> 
> I have multiple submit buttons for same form and each button refreshes the 
> page 
> I don't want it to refresh as it removes all changes made by one button to 
> perform changes made by another 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/14a8c9f5-c949-4caa-a3dd-87af0d4d39c4%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CY4PR04MB11914DFB0F50E1AEB0E25B0A9DA30%40CY4PR04MB1191.namprd04.prod.outlook.com.


Re: Tutorial Part 1

2020-05-09 Thread Randy Zeitvogel
This is from my mysite/settings.py file:

# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

This is from my polls/urls.py

from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index'),
path('', views.details, name='detail'),
path('/results/', views.results, name='results'),
path('/vote/', views.vote, name='vote'),
]

This is from polls/apps.py

from django.apps import AppConfig


class PollsConfig(AppConfig):
name = 'polls'



On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu <
nagarajusingoth...@gmail.com> wrote:

> Dear Sir,
>
>First add your app in settings.py,then after
> URLs.py
>  from django.urls import path,include
>  from ur(appname) import views
>
> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
> wrote:
>
>> I just started working with Django in the last couple of days.
>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
>> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
>> In both cases after I create the polls app and try it out, I get this:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://localhost:8000/polls/
>>
>> Using the URLconf defined in mysite.urls, Django tried these URL
>> patterns, in this order:
>>
>>1. admin/
>>
>> The current path, polls/, didn't match any of these.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>>
>> The feedback from the development web server (python manage.py runserver)
>> is:
>>
>>
>> jango version 3.0.6, using settings 'mysite.settings'
>> Starting development server at http://127.0.0.1:8000/
>> Quit the server with CONTROL-C.
>> Not Found: /polls/
>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>>
>> My mysite/urls.py looks like this:
>>
>>
>> from django.contrib import admin
>> from django.urls import include, path
>>
>> urlpatterns = [
>> path('polls/', include('polls.urls')),
>> path('admin/', admin.site.urls),
>> ]
>>
>>
>> Any help would be appreciated.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com
> 
> .
>

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


Re: Charts view function suggestions

2020-05-09 Thread hajar
thank you so much Motaz Hejaze , 

Le samedi 9 mai 2020 03:05:05 UTC+1, Motaz Hejaze a écrit :
>
> this way you'll query all the 'mail_items' table for each country , which 
> is a time and resource consuming thing to do ..
> i think you need to make a separate model that has 2 columns 'country' , 
> 'mail_items_count' , then you can make a signal when new item saved to 
> 'mail_items' 
> the signal will update the 'country+mail_items_count' increase the 
> 'mail_items_count' by one ...
>
> inside the 'country+mail_items_count' model you'll make a function to sum 
> all counts in the 'mail_item_count' column
>
> in your views make a view that query all countries with their ratio :
>
> make a dictionary ,
> loop throw each object in the query , take the country name as the key in 
> the dictionary , take the counter ( integer ) divided by the output of the 
> sum function to calculate the ratio of each country , append in dictionary 
> ..
> send the response with all countries and ratio dictionary .. 
>
> On Sat, May 9, 2020 at 3:46 AM hajar > 
> wrote:
>
>> hello! thank you so much for your advice , I want to try to use this view 
>> function below ,but  for example if you see my models.py I have the class 
>> mail_items that contains country_origine , I was thinking to do a pie 
>> chart contains in the labels the countries names and in the data I want 
>> to make a count to show "which country send items more than the other one" 
>> I am stack exactly in the data I am still thinking how to this , could you 
>> advice me please about the queryset 
>>
>> def pie_chart(request):
>> labels = []
>> data = []
>> q = mail_items.objects.all() 
>> 
>> for i in q :
>> labels.append()
>> data.append()
>>
>> return render(request, 'dash.html', {
>> 'labels': labels,
>> 'data': data,
>> })
>>
>>
>> Le vendredi 8 mai 2020 23:29:25 UTC+1, _M_A_Y_A_N_K_ a écrit :
>>>
>>> Hi Hajar,
>>>
>>> Though you have multiple model, the main thing is to create a queryset.
>>> Once you have a queryset (which can be from one model or multiple 
>>> model).. you should be able to use that queryset for Pie-Charts or any 
>>> other charts.
>>> Also try to use Django-Chart.js, which is much more easier i feel.
>>>
>>> Hope this helps.
>>> Also let know if you face any issue. You can share the queryset for 
>>> which you need charts.. then probably we can help then.
>>>
>>> Thanks & Regards, 
>>> -
>>> Mayank Tripathi
>>> Mo. +1 615 962 2128
>>> "Do what you can, with what you have, where you are -by Theodore 
>>> Roosevelt"
>>> https://datascience.foundation/datascienceawards
>>>
>>>
>>>
>>> On Fri, May 8, 2020 at 5:20 PM hajar Benjat  wrote:
>>>
 Hello everyone how are you doing ? 

 I need your suggestions > I have to use a specific models , and I want 
 to do a  pie_chart view function based on this models , " but I don't know 
 what to do I saw some view functions examples but they always use one 
 class 
 but here my classes a bit hard and I am really stack and I need your help "

 this is the models I have to use , 

 from django.db import models

 # Create your models here.
 class Country(models.Model):
 Country = models.CharField(max_length=100)

 def __str__(self):
 return '{} '.format(self.Country)

 class Reason(models.Model):
 Reason_cd = models.IntegerField(blank=True)
 Reason_NM = models.CharField(max_length=100, blank=True)
 def __str__(self):
 return '{}'.format(self.Reason_NM)

 class Mesure(models.Model):
 Mesure_cd = models.IntegerField(blank=True)
 Mesure_NM = models.CharField(max_length=100,blank=True)

 def __str__(self):
 return '{}'.format(self.Mesure_NM)

 class Client(models.Model):
 last_name = models.CharField(max_length=250)
 first_name = models.CharField(max_length=250)
 Adresse = models.CharField(max_length=560)
 city = models.CharField(max_length=100)
 code_postal = models.IntegerField()
 phone number = models.IntegerField(blank=True,null=True)
 mail = models.CharField(max_length=100)

 def __str__(self):
 return '{}, {}'.format(self.last_name,self.first_name)

 class Delivery_Agent(models.Model):
 last_name = models.CharField(max_length=250)
 first_name = models.CharField(max_length=250)

 def __str__(self):
 return '{}, {}  '.format(self.last_name,self.first_name)

 class Office(models.Model):
 office_cd = models.CharField(max_length=10)
 office_NM = models.CharField(max_length=50)

 def __str__(self):
   

install Microsoft visual C ++ 14.0 to be able to use mysqlclient in my Django projects

2020-05-09 Thread Anselme SERI


[image: nscreen.jpg]
Hello, I have been struggling for a few days wanting to install Microsoft 
visual C ++ 14.0 to be able to use mysqlclient in my Django projects. I use 
Win10, Python 3.8.2 and Django 3.0.5. Has anyone ever encountered this 
problem and solved it? I need help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0d4593d1-0e31-46fb-8dd2-876cbe8ae689%40googlegroups.com.


Re: Messages not appearing after creating an app for it in Django

2020-05-09 Thread Motaz Hejaze
In templates , you need to loop through marketing_message because its not a
single object its a query result

On Sat, 9 May 2020, 4:44 pm Ahmed Khairy, 
wrote:

> I created an app called marketing app which customizes messages to be
> written on top of website page. My problem is that these messages are not
> showing when everything is configured and I don't know why is that might be
> the template because {{ marketing_message.message}} is only not showing
>
> This is the model of the Marketing App
>
> class MarketingMessage(models.Model):
> message = models.CharField(max_length=120)
> active = models.BooleanField(default=False)
> featured = models.BooleanField(default=False)
> timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
> updated = models.DateTimeField(auto_now_add=False, auto_now=True)
> start_date = models.DateTimeField(
> auto_now_add=False, auto_now=False, null=True, blank=True)
> end = models.DateTimeField(
> auto_now_add=False, auto_now=False, null=True, blank=True)
>
> def __str__(self):
> return str(self.message[:12])
>
> this is the views for the core app:
>
> class HomeView(ListView):
> model = Item
> paginate_by = 10
> template_name = "home.html"
>
> def get_context_data(self, **kwargs):
> context = super(HomeView, self).get_context_data(**kwargs)
> context['marketing_message'] = MarketingMessage.objects.all()
>
> this is the template:
> {% if marketing_message %}
> 
> ×
> 
> Marketing Message ! :  {{
> marketing_message.message}}
> 
> 
> {% endif  %}
>
> This is the admin.py of marketing
>
> from django.contrib import admin
> from .models import MarketingMessage
> # Register your models here.
>
>
> class MarketingMessageAdmin(admin.ModelAdmin):
> class Meta:
> model = MarketingMessage
>
>
> admin.site.register(MarketingMessage, MarketingMessageAdmin)
>
>
> return context
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a68d848e-6373-41ef-a614-e4333e974e5c%40googlegroups.com
> .
>

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


Re: I am building an open source School Management System

2020-05-09 Thread johnf

Your website was very nice.  I liked the slider over.

Johnf

On 5/9/20 4:08 AM, ola neat wrote:
Mine is for secondary school,  i have it on heroku 
https://dhope-sms.herokuapp.com/my-sms/

Still have somethings to tidy sha

On Sat, May 9, 2020, 11:15 Adedotun Richard > wrote:


@ola neat Can you share let us see what you have done so far?

On Sat, May 9, 2020, 11:11 AM ola neat mailto:tosinayoo...@gmail.com>> wrote:

I can contribute as I've built a sch mgt sys using django last yr

On Fri, May 8, 2020, 21:57 Kasper Laudrup
mailto:laud...@stacktrace.dk>> wrote:

An may Heiðrún provide a constant flow of mead

On 08/05/2020 22.45, Sherif Adigun wrote:
> May Allah make it easy.
> Jazaakumullahu khayran
>
> On Fri, May 8, 2020, 8:24 PM Motaz Hejaze
mailto:trapper...@gmail.com>
> >> wrote:
>
>     I will contribute too insha Allah
>
>     On Fri, 8 May 2020, 5:54 pm Hedrick Godson's,
>     mailto:hedrickgod...@gmail.com>
>> wrote:
>
>         Successful cloned it. Looking forward to build
this with you guys
>
>         On Fri, 8 May 2020, 18:28 Duah Sylvester
>         mailto:duahsylveste...@gmail.com>
>>
>         wrote:
>
>             Thank you very much! I will get it done
>
>             On Fri, May 8, 2020, 15:04 Sherif Adigun
>             mailto:adigunshe...@gmail.com>
>> wrote:
>
>                 Thank you. Let's build on this and
improve it.
>
>                 On Fri, May 8, 2020, 1:02 PM Luqman
Shofuleji
>                 mailto:luqmans...@gmail.com> >> wrote:
>
>                     Hi,
>
>                     I've just forked the repository on
your github account.
>
>                     On Wed, May 6, 2020 at 4:21 PM
Sherif Adigun
>                     mailto:adigunshe...@gmail.com>
>                     >> wrote:
>
>                         Thanks. Checked. Good job. I
think I've got more
>                         features than you.
>
>                         Latest commits now have
authentications
>
>                         On Tuesday, May 5, 2020 at
9:37:26 PM UTC+1,
>                         Sherif Adigun wrote:
>
>                             I am currently building an
open source
>                             school Management System on
django and it's
>                             currently available on GitHub.
>
>
https://github.com/adigunsherif/Django-School-Management-System
>
>                             I need contributors and
collaboration.
>
>                             Feel free to fork me on
GitHub, send a
>                             message and let's build a
solution
>
>                         --
>                         You received this message
because you are
>                         subscribed to the Google Groups
"Django users"
>                         group.
>                         To unsubscribe from this group
and stop
>                         receiving emails from it, send
an email to
> django-users+unsubscr...@googlegroups.com

>                       
 >.
>                         To view this discussion on the
web visit
>

https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com
>                       
 

Messages not appearing after creating an app for it in Django

2020-05-09 Thread Ahmed Khairy
I created an app called marketing app which customizes messages to be written 
on top of website page. My problem is that these messages are not showing when 
everything is configured and I don't know why is that might be the template 
because {{ marketing_message.message}} is only not showing

This is the model of the Marketing App

class MarketingMessage(models.Model):
message = models.CharField(max_length=120)
active = models.BooleanField(default=False)
featured = models.BooleanField(default=False)
timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
updated = models.DateTimeField(auto_now_add=False, auto_now=True)
start_date = models.DateTimeField(
auto_now_add=False, auto_now=False, null=True, blank=True)
end = models.DateTimeField(
auto_now_add=False, auto_now=False, null=True, blank=True)

def __str__(self):
return str(self.message[:12])

this is the views for the core app:

class HomeView(ListView):
model = Item
paginate_by = 10
template_name = "home.html"

def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
context['marketing_message'] = MarketingMessage.objects.all()

this is the template:
{% if marketing_message %}

×

Marketing Message ! :  {{ marketing_message.message}}
   

{% endif  %}

This is the admin.py of marketing

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


class MarketingMessageAdmin(admin.ModelAdmin):
class Meta:
model = MarketingMessage


admin.site.register(MarketingMessage, MarketingMessageAdmin)


return context

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a68d848e-6373-41ef-a614-e4333e974e5c%40googlegroups.com.


Re: Multiple submit for same form refresh the page

2020-05-09 Thread Kasper Laudrup

Hi Nirantar,

On 09/05/2020 15.15, Nirantar Kulkarni wrote:


I have multiple submit buttons for same form and each button refreshes 
the page
I don't want it to refresh as it removes all changes made by one button 
to perform changes made by another please help me




As far as I know, you can only have one action with a plain HTML form. 
It might be possible to have more than one submit button, but I don't 
think that's part of the standard and might be handled differently 
depending on the browser.


If you don't mind the refreshing as long as the data is still there, you 
can prefill the form with the contents submitted. That is all easily 
handled with standard Django.


You probably need some javascript magic to handle multiple submits though.

I would try something like hiding the actual submit button from the form 
and then adding different buttons outside of the form and write some 
javascript handler that would submit the form with an extra field 
depending on which button was pressed. You could also make the same 
javascript action send the data directly to avoid refreshing of the page.


In short, I'm fairly certain you cannot achieve what you want without 
writing some kind of client-side javascript :-(


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8b115359-61c8-78c1-297d-73f80a4415eb%40stacktrace.dk.


Multiple submit for same form refresh the page

2020-05-09 Thread Nirantar Kulkarni
html template

{% csrf_token %}
  {{name}}
  WordCloud
  Text_Analysis
  Sentiment 
Analysis
 

I have multiple submit buttons for same form and each button refreshes the 
page 
I don't want it to refresh as it removes all changes made by one button to 
perform changes made by another 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14a8c9f5-c949-4caa-a3dd-87af0d4d39c4%40googlegroups.com.


Re: No module named 'blog'

2020-05-09 Thread sri vishva
Try creating a new app Blog using
>>pip install django-admin startapp Blog
And now replace the existing files with your contents

On Fri, 8 May 2020, 4:22 pm Mukesh Badgujar, 
wrote:

> First... I... created Project at my machine... then... uploaded to
> github then from  git i import it to my namecheap shared hosting
> server, i created python app in that folder, then i run migrations cmds...
> but apps are not detected by django
>
> On Thu, 7 May, 2020, 6:09 pm Mohsen Pahlevanzadeh, <
> m.pahlevanza...@gmail.com> wrote:
>
>> Where did you import your module?
>>
>> On Thu, May 7, 2020 at 3:09 PM Mukesh Badgujar <
>> mukesh.badgujar...@gmail.com> wrote:
>>
>>> already added
>>>
>>> 'home.apps.HomeConfig',
>>> 'blog.apps.BlogConfig',
>>> 'shop.apps.shopConfig',
>>>
>>> one thing is that, i copied this app folder frm my other project, this
>>> is not created here
>>>
>>>
>>> On Sunday, 9 August 2015 22:43:38 UTC+5:30, Robin Lery wrote:

 Did you add your 'blog' app in the installed apps in settings.py?

 On Sun, Aug 9, 2015 at 10:35 PM, Maggie Chang 
 wrote:

> hi all,
> would like to seek for everyone's help.
> I am following the django girls instruction =>
> http://tutorial.djangogirls.org/en/django_urls/index.html#your-first-django-url,
> but encounter the problem.
> when I connect to 127.0.0.1:8000, I got the No module named 'blog'
> response.
> Here's the message on browser.
> **
> ImportError at /
>
> No module named 'blog'
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
> Django Version: 1.8
> Exception Type: ImportError
> Exception Value:
>
> No module named 'blog'
>
> Exception Location: /usr/lib/python3.4/importlib/__init__.py in
> import_module, line 109
> Python Executable: /home/maggie/djangoanywhere/venv/bin/python
> Python Version: 3.4.0
> Python Path:
>
> ['/home/maggie/djangoanywhere',
>  '/usr/lib/python3.4',
>  '/usr/lib/python3.4/plat-x86_64-linux-gnu',
>  '/usr/lib/python3.4/lib-dynload',
>  '/home/maggie/djangoanywhere/venv/lib/python3.4/site-packages']
>
> Server time: Mon, 10 Aug 2015 00:47:53 +0800
> **
>
> This issue occurred when I add *url(r'', include('blog.urls')), *into
> *magsite/url.py*
> **
> *url.py*
> **
> from django.conf.urls import include, url
> from django.contrib import admin
>
>
> urlpatterns = [
> url(r'^admin/', include(admin.site.urls)),
> url(r'', include('blog.urls')),
> ]
> **
> Any idea about the root cause? :(
> and any response will be appreciate.
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0c3ba90d-97d3-448c-8656-0b2ad6becca7%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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4a25e83a-0f62-4f60-8401-618252682a22%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJFFGZLyEOZBqbdVULzD8xR6abjfvy8VoMaO4War133B3FeDXQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: Facing problem in creating login with EMAIL and creating OTP authentication.

2020-05-09 Thread Eric Kamara
Have you tried Django Two-Factor authentication
?

On Sat, 9 May 2020 at 22:10, Utkarsh Gupta  wrote:

> I am doing a project in which I have to create a login app which only
> logins with EMAIL ID. There is permission given to certain email ids and
> only those email ids could login. After the login the user will be provided
> with an OTP on the required email for authentication. So, know how to go
> about it?
> I am fairly new to Django and would love any kind of help?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/71f24c21-cf54-46ff-b40e-525e6f46cc5e%40googlegroups.com
> 
> .
>

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


Re: Tutorial Part 1

2020-05-09 Thread Nagaraju Singothu
Dear Sir,

   First add your app in settings.py,then after
URLs.py
 from django.urls import path,include
 from ur(appname) import views

On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
wrote:

> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
> 
> .
>

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


Re: Tutorial Part 1

2020-05-09 Thread tejasri mamidi
Did ,you place ur appname in installed app in settings

On Sat, May 9, 2020, 05:42 Randy Zeitvogel  wrote:

> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP6hVmBJa%2BQ%2BuS6GkoHuwJvPStWK%2B0SdF6Hk3t%3DdkgcazmNPFA%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-09 Thread ola neat
Check your app url,  does the url match with wath u have on your browser,

On Sat, May 9, 2020, 01:59 Luqman Jr  wrote:

> Hello
> Did you create urls.py under polls app?
> You should have urls.py under polls app which will list all urls fall
> under this app.
> Then share with us polls/urls.py and polls/views.py so that we can help
> more on this.
> On 9 May 2020, 03:11 +0300, Randy Zeitvogel ,
> wrote:
>
> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3baac878-0c7c-4bec-8788-5d04b21b%40Spark
> 
> .
>

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


Re: Deploying Django Project on heroku

2020-05-09 Thread ola neat
Halo, i feel if u follow the step in this article
https://www.codementor.io/@jamesezechukwu/how-to-deploy-django-app-on-heroku-dtsee04d4
u should b good

On Sat, May 9, 2020, 01:15 Sunday Iyanu Ajayi  wrote:

> Hi Motaz,
> Thank you so much.
> Is today cool?
> What time (in GMT+1) will be cool for you?
>
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
>
>
> On Sun, May 3, 2020 at 11:05 PM Motaz Hejaze  wrote:
>
>> Let us have a zoom meeting to fix it
>>
>> On Sun, 3 May 2020, 11:45 pm Sunday Iyanu Ajayi, 
>> wrote:
>>
>>> I have but it keeps telling  that it is misconfigured
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunnexaj...@gmail.com *
>>>
>>>
>>>
>>> On Sat, Apr 25, 2020 at 3:17 PM sagar ninave 
>>> wrote:
>>>
 Do you installed whitenoise package
 If not then run this command
 Pip insatll whitenoise

 On Sat, 25 Apr 2020 at 7:43 PM, Sunday Iyanu Ajayi <
 sunnexaj...@gmail.com> wrote:

> I have spent over 2weeks on deploying a django project to heroku but I
> keep getting error messages such as :
>
> My WhiteNoise is not configured  and I have followed all the tutorials
> recommended  and yet same thing.
>
> Please who has a guide I can follow that is very updated.
> Thank you.
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKYSAw2PsC452Sk5_1e_sMy3HuZ3zWrFh5p6CVn6K-KsVF1Rqg%40mail.gmail.com
> 
> .
>
 --

 
 sagar ninave
 about.me/sagarninave
 

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAA6pdZ9fsGj3y%3DNVVQ_oCX9hY5DbLHtPVLM-nPhWYxpE4Qsi7w%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAKYSAw2hYQGRYYZRB%3D7ZNJJJ-1OY2ykShsPam9xiRc-8M4BQJg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHV4E-dLr30ycFTo9tccTmKW74rvDA%3D0Oks8NqAVez0Tiyzocg%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKYSAw2PWEmow%3DbA3wAZ6MnTKkRdMAbq7SN%3D6L4gAcSS0gw1eA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn72g5u_Hj-Pq0KHUr4kXEz8vtefXNOMQP1SMLoaEa7F%3DuQ%40mail.gmail.com.


Facing problem in creating login with EMAIL and creating OTP authentication.

2020-05-09 Thread Utkarsh Gupta
I am doing a project in which I have to create a login app which only 
logins with EMAIL ID. There is permission given to certain email ids and 
only those email ids could login. After the login the user will be provided 
with an OTP on the required email for authentication. So, know how to go 
about it? 
I am fairly new to Django and would love any kind of help?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71f24c21-cf54-46ff-b40e-525e6f46cc5e%40googlegroups.com.


Re: I am building an open source School Management System

2020-05-09 Thread Milos Miljkovic
Do you need any ui/ux/web design assistance on this? if yes, send any 
comments/ideas/needs you have in mind, I would love to contribute!

Τη Τρίτη, 5 Μαΐου 2020 - 11:37:26 μ.μ. UTC+3, ο χρήστης Sherif Adigun 
έγραψε:
>
> I am currently building an open source school Management System on django 
> and it's currently available on GitHub.
>
> https://github.com/adigunsherif/Django-School-Management-System
>
> I need contributors and collaboration.
>
> Feel free to fork me on GitHub, send a message and let's build a solution
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c394d2a-8d41-4d89-a8ee-024d09ba4e42%40googlegroups.com.


Re: I am building an open source School Management System

2020-05-09 Thread ola neat
Mine is for secondary school,  i have it on heroku
https://dhope-sms.herokuapp.com/my-sms/
Still have somethings to tidy sha

On Sat, May 9, 2020, 11:15 Adedotun Richard  wrote:

> @ola neat Can you share let us see what you have done so far?
>
> On Sat, May 9, 2020, 11:11 AM ola neat  wrote:
>
>> I can contribute as I've built a sch mgt sys using django last yr
>>
>> On Fri, May 8, 2020, 21:57 Kasper Laudrup  wrote:
>>
>>> An may Heiðrún provide a constant flow of mead
>>>
>>> On 08/05/2020 22.45, Sherif Adigun wrote:
>>> > May Allah make it easy.
>>> > Jazaakumullahu khayran
>>> >
>>> > On Fri, May 8, 2020, 8:24 PM Motaz Hejaze >> > > wrote:
>>> >
>>> > I will contribute too insha Allah
>>> >
>>> > On Fri, 8 May 2020, 5:54 pm Hedrick Godson's,
>>> > mailto:hedrickgod...@gmail.com>> wrote:
>>> >
>>> > Successful cloned it. Looking forward to build this with you
>>> guys
>>> >
>>> > On Fri, 8 May 2020, 18:28 Duah Sylvester
>>> > mailto:duahsylveste...@gmail.com>>
>>> > wrote:
>>> >
>>> > Thank you very much! I will get it done
>>> >
>>> > On Fri, May 8, 2020, 15:04 Sherif Adigun
>>> > mailto:adigunshe...@gmail.com>>
>>> wrote:
>>> >
>>> > Thank you. Let's build on this and improve it.
>>> >
>>> > On Fri, May 8, 2020, 1:02 PM Luqman Shofuleji
>>> > mailto:luqmans...@gmail.com>>
>>> wrote:
>>> >
>>> > Hi,
>>> >
>>> > I've just forked the repository on your github
>>> account.
>>> >
>>> > On Wed, May 6, 2020 at 4:21 PM Sherif Adigun
>>> > >> > > wrote:
>>> >
>>> > Thanks. Checked. Good job. I think I've got
>>> more
>>> > features than you.
>>> >
>>> > Latest commits now have authentications
>>> >
>>> > On Tuesday, May 5, 2020 at 9:37:26 PM UTC+1,
>>> > Sherif Adigun wrote:
>>> >
>>> > I am currently building an open source
>>> > school Management System on django and it's
>>> > currently available on GitHub.
>>> >
>>> >
>>> https://github.com/adigunsherif/Django-School-Management-System
>>> >
>>> > I need contributors and collaboration.
>>> >
>>> > Feel free to fork me on GitHub, send a
>>> > message and let's build a solution
>>> >
>>> > --
>>> > 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
>>> > >> django-users+unsubscr...@googlegroups.com>.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com
>>> > <
>>> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com?utm_medium=email_source=footer
>>> >.
>>> >
>>> > --
>>> > 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/JGKrFx5sFuM/unsubscribe.
>>> > To unsubscribe from this group and all its topics,
>>> > send an email to
>>> > django-users+unsubscr...@googlegroups.com
>>> > >> >.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com
>>> > <
>>> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com?utm_medium=email_source=footer
>>> >.
>>> >
>>> > --
>>> > You received this message because you are subscribed to
>>> > the Google Groups "Django users" group.
>>> > To unsubscribe from this group and stop receiving
>>> emails
>>> > from it, send an email to
>>> > django-users+unsubscr...@googlegroups.com
>>> > .
>>> > To view this discussion 

Re: I am building an open source School Management System

2020-05-09 Thread Adedotun Richard
@ola neat Can you share let us see what you have done so far?

On Sat, May 9, 2020, 11:11 AM ola neat  wrote:

> I can contribute as I've built a sch mgt sys using django last yr
>
> On Fri, May 8, 2020, 21:57 Kasper Laudrup  wrote:
>
>> An may Heiðrún provide a constant flow of mead
>>
>> On 08/05/2020 22.45, Sherif Adigun wrote:
>> > May Allah make it easy.
>> > Jazaakumullahu khayran
>> >
>> > On Fri, May 8, 2020, 8:24 PM Motaz Hejaze > > > wrote:
>> >
>> > I will contribute too insha Allah
>> >
>> > On Fri, 8 May 2020, 5:54 pm Hedrick Godson's,
>> > mailto:hedrickgod...@gmail.com>> wrote:
>> >
>> > Successful cloned it. Looking forward to build this with you
>> guys
>> >
>> > On Fri, 8 May 2020, 18:28 Duah Sylvester
>> > mailto:duahsylveste...@gmail.com>>
>> > wrote:
>> >
>> > Thank you very much! I will get it done
>> >
>> > On Fri, May 8, 2020, 15:04 Sherif Adigun
>> > mailto:adigunshe...@gmail.com>>
>> wrote:
>> >
>> > Thank you. Let's build on this and improve it.
>> >
>> > On Fri, May 8, 2020, 1:02 PM Luqman Shofuleji
>> > mailto:luqmans...@gmail.com>>
>> wrote:
>> >
>> > Hi,
>> >
>> > I've just forked the repository on your github
>> account.
>> >
>> > On Wed, May 6, 2020 at 4:21 PM Sherif Adigun
>> > > > > wrote:
>> >
>> > Thanks. Checked. Good job. I think I've got more
>> > features than you.
>> >
>> > Latest commits now have authentications
>> >
>> > On Tuesday, May 5, 2020 at 9:37:26 PM UTC+1,
>> > Sherif Adigun wrote:
>> >
>> > I am currently building an open source
>> > school Management System on django and it's
>> > currently available on GitHub.
>> >
>> >
>> https://github.com/adigunsherif/Django-School-Management-System
>> >
>> > I need contributors and collaboration.
>> >
>> > Feel free to fork me on GitHub, send a
>> > message and let's build a solution
>> >
>> > --
>> > 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
>> > > django-users+unsubscr...@googlegroups.com>.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com
>> > <
>> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com?utm_medium=email_source=footer
>> >.
>> >
>> > --
>> > 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/JGKrFx5sFuM/unsubscribe.
>> > To unsubscribe from this group and all its topics,
>> > send an email to
>> > django-users+unsubscr...@googlegroups.com
>> > .
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com
>> > <
>> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com?utm_medium=email_source=footer
>> >.
>> >
>> > --
>> > You received this message because you are subscribed to
>> > the Google Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails
>> > from it, send an email to
>> > django-users+unsubscr...@googlegroups.com
>> > .
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CACP0aXighwO6SB3Qdh7mZJQmV7hNGcp52hH04c8vm6E4h_cPZQ%40mail.gmail.com
>> > <
>> 

Re: I am building an open source School Management System

2020-05-09 Thread ola neat
I can contribute as I've built a sch mgt sys using django last yr

On Fri, May 8, 2020, 21:57 Kasper Laudrup  wrote:

> An may Heiðrún provide a constant flow of mead
>
> On 08/05/2020 22.45, Sherif Adigun wrote:
> > May Allah make it easy.
> > Jazaakumullahu khayran
> >
> > On Fri, May 8, 2020, 8:24 PM Motaz Hejaze  > > wrote:
> >
> > I will contribute too insha Allah
> >
> > On Fri, 8 May 2020, 5:54 pm Hedrick Godson's,
> > mailto:hedrickgod...@gmail.com>> wrote:
> >
> > Successful cloned it. Looking forward to build this with you guys
> >
> > On Fri, 8 May 2020, 18:28 Duah Sylvester
> > mailto:duahsylveste...@gmail.com>>
> > wrote:
> >
> > Thank you very much! I will get it done
> >
> > On Fri, May 8, 2020, 15:04 Sherif Adigun
> > mailto:adigunshe...@gmail.com>>
> wrote:
> >
> > Thank you. Let's build on this and improve it.
> >
> > On Fri, May 8, 2020, 1:02 PM Luqman Shofuleji
> > mailto:luqmans...@gmail.com>>
> wrote:
> >
> > Hi,
> >
> > I've just forked the repository on your github
> account.
> >
> > On Wed, May 6, 2020 at 4:21 PM Sherif Adigun
> >  > > wrote:
> >
> > Thanks. Checked. Good job. I think I've got more
> > features than you.
> >
> > Latest commits now have authentications
> >
> > On Tuesday, May 5, 2020 at 9:37:26 PM UTC+1,
> > Sherif Adigun wrote:
> >
> > I am currently building an open source
> > school Management System on django and it's
> > currently available on GitHub.
> >
> >
> https://github.com/adigunsherif/Django-School-Management-System
> >
> > I need contributors and collaboration.
> >
> > Feel free to fork me on GitHub, send a
> > message and let's build a solution
> >
> > --
> > 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
> >  django-users+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/django-users/06798eec-0e61-4149-9315-9d95cf7aec65%40googlegroups.com?utm_medium=email_source=footer
> >.
> >
> > --
> > 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/JGKrFx5sFuM/unsubscribe.
> > To unsubscribe from this group and all its topics,
> > send an email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/django-users/CAHyB84ps0YCQz72SYbXKHcj_BYQiuOXQVHGNQpag8vHT4FA2dA%40mail.gmail.com?utm_medium=email_source=footer
> >.
> >
> > --
> > You received this message because you are subscribed to
> > the Google Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails
> > from it, send an email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CACP0aXighwO6SB3Qdh7mZJQmV7hNGcp52hH04c8vm6E4h_cPZQ%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/django-users/CACP0aXighwO6SB3Qdh7mZJQmV7hNGcp52hH04c8vm6E4h_cPZQ%40mail.gmail.com?utm_medium=email_source=footer
> >.
> >
> > --
> > You received this message because you are subscribed to the
> > Google Groups "Django users" group.
> > To unsubscribe from this group and stop receiving 

Re: Additional data added to the HTTP Get Request.

2020-05-09 Thread Eric Kamara
Hi Ronald,

I don't think you are quoting your data-url tag properly in the html form.
If you notice, you are missing the closing quotation(") which causes the
 to be added to the url.

Regards,

On Sat, 9 May 2020 at 18:58, Ronald Kamulegeya <
ronald.kamulegeya.2...@gmail.com> wrote:

> Hello Members.
>
> I am a django beginner and i am going trough online tutorials.
>
> I have the following view functions:
>
> # Create your views here.
> def save_tenant_form(request, form, template_name):
> data = dict()
> if request.method == 'POST':
> if form.is_valid():
> form.save()
> data['form_is_valid'] = True
> tenants = Tenants.objects.all()
> data['html_tenant_list'] = render_to_string(
> 'rentals/tenant_partial_list.html', {
> 'tenant_list': tenants
> })
> else:
> data['form_is_valid'] = False
> context = {'form': form}
> data['html_form'] = render_to_string(template_name, context, request=
> request)
> return JsonResponse(data)
>
>
>
>
> def createTenant(request):
> if request.method == 'POST':
> form = TenantsForm(request.POST)
> else:
> form = TenantsForm()
>
> return save_tenant_form(request, form,
> 'rentals/partial_tenant_create.html')
>
> Here is the url for the create function
> path("tenants/add/",views.createTenant, name='createTenant'),
>
> There is some java script to load the modal form shown below:
> $(function () {
>
>
>   /* Functions */
>
>
>   var loadForm = function () {
> var btn = $(this);
> $.ajax({
>   url: btn.attr("data-url"),
>   type: 'get',
>   dataType: 'json',
>   beforeSend: function () {
> $("#modal-tenant .modal-content").html("");
> $("#modal-tenant").modal("show");
>   },
>   success: function (data) {
> $("#modal-tenant .modal-content").html(data.html_form);
>   }
> });
>   };
>
>
>   var saveForm = function () {
> var form = $(this);
> $.ajax({
>   url: form.attr("action"),
>   data: form.serialize(),
>   type: form.attr("method"),
>   dataType: 'json',
>   success: function (data) {
> if (data.form_is_valid) {
>   $("#tenant-table tbody").html(data.html_book_list);
>   $("#modal-tenant").modal("hide");
> }
> else {
>   $("#modal-tenant .modal-content").html(data.html_form);
> }
>   }
> });
> return false;
>   };
>
>
>
>
>   /* Binding */
>
>
>   // Create tenant
>   $(".js-create-tenant").click(loadForm);
>   $("#modal-tenant").on("submit", ".js-tenant-create-form", saveForm);
>
> In the html form, i  try to load the modal form by clicking on this button
> 
>  data-url="{% url 'rentals:createTenant' %}>
>   
>   New Tenant
> 
>
>   
> I get a strange response shown below
> [09/May/2020 11:38:58] "GET
> /tenants/add/%3E%20%20%20%20%20%20%3Cspan%20class= HTTP/1.1" 404 2789
>
> I need the "GET /tenants/add/ part only. I do not know how the additional
> data is added to the Get request!
> Any bug in my code causing the strange data to be added?
>
> Ronald
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2c8f5ac8-2109-49b4-ad8a-d75c2350a21c%40googlegroups.com
> 
> .
>

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


Re: Additional data added to the HTTP Get Request.

2020-05-09 Thread Ronald Kamulegeya
It is true!

I have spend whole morning trouble shooting it!

Thanks so much!

On Sat, May 9, 2020 at 12:10 PM Shaheed Haque 
wrote:

> I think you are missing a closing double quote on your data-url.
>
> On Sat, 9 May 2020, 09:59 Ronald Kamulegeya, <
> ronald.kamulegeya.2...@gmail.com> wrote:
>
>> Hello Members.
>>
>> I am a django beginner and i am going trough online tutorials.
>>
>> I have the following view functions:
>>
>> # Create your views here.
>> def save_tenant_form(request, form, template_name):
>> data = dict()
>> if request.method == 'POST':
>> if form.is_valid():
>> form.save()
>> data['form_is_valid'] = True
>> tenants = Tenants.objects.all()
>> data['html_tenant_list'] = render_to_string(
>> 'rentals/tenant_partial_list.html', {
>> 'tenant_list': tenants
>> })
>> else:
>> data['form_is_valid'] = False
>> context = {'form': form}
>> data['html_form'] = render_to_string(template_name, context, request=
>> request)
>> return JsonResponse(data)
>>
>>
>>
>>
>> def createTenant(request):
>> if request.method == 'POST':
>> form = TenantsForm(request.POST)
>> else:
>> form = TenantsForm()
>>
>> return save_tenant_form(request, form,
>> 'rentals/partial_tenant_create.html')
>>
>> Here is the url for the create function
>> path("tenants/add/",views.createTenant, name='createTenant'),
>>
>> There is some java script to load the modal form shown below:
>> $(function () {
>>
>>
>>   /* Functions */
>>
>>
>>   var loadForm = function () {
>> var btn = $(this);
>> $.ajax({
>>   url: btn.attr("data-url"),
>>   type: 'get',
>>   dataType: 'json',
>>   beforeSend: function () {
>> $("#modal-tenant .modal-content").html("");
>> $("#modal-tenant").modal("show");
>>   },
>>   success: function (data) {
>> $("#modal-tenant .modal-content").html(data.html_form);
>>   }
>> });
>>   };
>>
>>
>>   var saveForm = function () {
>> var form = $(this);
>> $.ajax({
>>   url: form.attr("action"),
>>   data: form.serialize(),
>>   type: form.attr("method"),
>>   dataType: 'json',
>>   success: function (data) {
>> if (data.form_is_valid) {
>>   $("#tenant-table tbody").html(data.html_book_list);
>>   $("#modal-tenant").modal("hide");
>> }
>> else {
>>   $("#modal-tenant .modal-content").html(data.html_form);
>> }
>>   }
>> });
>> return false;
>>   };
>>
>>
>>
>>
>>   /* Binding */
>>
>>
>>   // Create tenant
>>   $(".js-create-tenant").click(loadForm);
>>   $("#modal-tenant").on("submit", ".js-tenant-create-form", saveForm);
>>
>> In the html form, i  try to load the modal form by clicking on this button
>> 
>> > data-url="{% url 'rentals:createTenant' %}>
>>   
>>   New Tenant
>> 
>>
>>   
>> I get a strange response shown below
>> [09/May/2020 11:38:58] "GET
>> /tenants/add/%3E%20%20%20%20%20%20%3Cspan%20class= HTTP/1.1" 404 2789
>>
>> I need the "GET /tenants/add/ part only. I do not know how the additional
>> data is added to the Get request!
>> Any bug in my code causing the strange data to be added?
>>
>> Ronald
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/2c8f5ac8-2109-49b4-ad8a-d75c2350a21c%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHAc2jcsy6iacB-Yyo8mz1T_X%3DCq8WkZ02M4Tiv091JzGbONqQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALV1ZJ1kN-3LL-s6sNQKxk_dJ5L30LvtYF-A02W-kFtCtPdrTQ%40mail.gmail.com.


Re: Additional data added to the HTTP Get Request.

2020-05-09 Thread Ronald Kamulegeya
Found out the cause of my troubles


  New Tenant


  
I was missing " ...OMG...now working!

On Sat, May 9, 2020 at 11:58 AM Ronald Kamulegeya <
ronald.kamulegeya.2...@gmail.com> wrote:

> Hello Members.
>
> I am a django beginner and i am going trough online tutorials.
>
> I have the following view functions:
>
> # Create your views here.
> def save_tenant_form(request, form, template_name):
> data = dict()
> if request.method == 'POST':
> if form.is_valid():
> form.save()
> data['form_is_valid'] = True
> tenants = Tenants.objects.all()
> data['html_tenant_list'] = render_to_string(
> 'rentals/tenant_partial_list.html', {
> 'tenant_list': tenants
> })
> else:
> data['form_is_valid'] = False
> context = {'form': form}
> data['html_form'] = render_to_string(template_name, context, request=
> request)
> return JsonResponse(data)
>
>
>
>
> def createTenant(request):
> if request.method == 'POST':
> form = TenantsForm(request.POST)
> else:
> form = TenantsForm()
>
> return save_tenant_form(request, form,
> 'rentals/partial_tenant_create.html')
>
> Here is the url for the create function
> path("tenants/add/",views.createTenant, name='createTenant'),
>
> There is some java script to load the modal form shown below:
> $(function () {
>
>
>   /* Functions */
>
>
>   var loadForm = function () {
> var btn = $(this);
> $.ajax({
>   url: btn.attr("data-url"),
>   type: 'get',
>   dataType: 'json',
>   beforeSend: function () {
> $("#modal-tenant .modal-content").html("");
> $("#modal-tenant").modal("show");
>   },
>   success: function (data) {
> $("#modal-tenant .modal-content").html(data.html_form);
>   }
> });
>   };
>
>
>   var saveForm = function () {
> var form = $(this);
> $.ajax({
>   url: form.attr("action"),
>   data: form.serialize(),
>   type: form.attr("method"),
>   dataType: 'json',
>   success: function (data) {
> if (data.form_is_valid) {
>   $("#tenant-table tbody").html(data.html_book_list);
>   $("#modal-tenant").modal("hide");
> }
> else {
>   $("#modal-tenant .modal-content").html(data.html_form);
> }
>   }
> });
> return false;
>   };
>
>
>
>
>   /* Binding */
>
>
>   // Create tenant
>   $(".js-create-tenant").click(loadForm);
>   $("#modal-tenant").on("submit", ".js-tenant-create-form", saveForm);
>
> In the html form, i  try to load the modal form by clicking on this button
> 
>  data-url="{% url 'rentals:createTenant' %}>
>   
>   New Tenant
> 
>
>   
> I get a strange response shown below
> [09/May/2020 11:38:58] "GET
> /tenants/add/%3E%20%20%20%20%20%20%3Cspan%20class= HTTP/1.1" 404 2789
>
> I need the "GET /tenants/add/ part only. I do not know how the additional
> data is added to the Get request!
> Any bug in my code causing the strange data to be added?
>
> Ronald
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2c8f5ac8-2109-49b4-ad8a-d75c2350a21c%40googlegroups.com
> 
> .
>

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


Re: Additional data added to the HTTP Get Request.

2020-05-09 Thread Shaheed Haque
I think you are missing a closing double quote on your data-url.

On Sat, 9 May 2020, 09:59 Ronald Kamulegeya, <
ronald.kamulegeya.2...@gmail.com> wrote:

> Hello Members.
>
> I am a django beginner and i am going trough online tutorials.
>
> I have the following view functions:
>
> # Create your views here.
> def save_tenant_form(request, form, template_name):
> data = dict()
> if request.method == 'POST':
> if form.is_valid():
> form.save()
> data['form_is_valid'] = True
> tenants = Tenants.objects.all()
> data['html_tenant_list'] = render_to_string(
> 'rentals/tenant_partial_list.html', {
> 'tenant_list': tenants
> })
> else:
> data['form_is_valid'] = False
> context = {'form': form}
> data['html_form'] = render_to_string(template_name, context, request=
> request)
> return JsonResponse(data)
>
>
>
>
> def createTenant(request):
> if request.method == 'POST':
> form = TenantsForm(request.POST)
> else:
> form = TenantsForm()
>
> return save_tenant_form(request, form,
> 'rentals/partial_tenant_create.html')
>
> Here is the url for the create function
> path("tenants/add/",views.createTenant, name='createTenant'),
>
> There is some java script to load the modal form shown below:
> $(function () {
>
>
>   /* Functions */
>
>
>   var loadForm = function () {
> var btn = $(this);
> $.ajax({
>   url: btn.attr("data-url"),
>   type: 'get',
>   dataType: 'json',
>   beforeSend: function () {
> $("#modal-tenant .modal-content").html("");
> $("#modal-tenant").modal("show");
>   },
>   success: function (data) {
> $("#modal-tenant .modal-content").html(data.html_form);
>   }
> });
>   };
>
>
>   var saveForm = function () {
> var form = $(this);
> $.ajax({
>   url: form.attr("action"),
>   data: form.serialize(),
>   type: form.attr("method"),
>   dataType: 'json',
>   success: function (data) {
> if (data.form_is_valid) {
>   $("#tenant-table tbody").html(data.html_book_list);
>   $("#modal-tenant").modal("hide");
> }
> else {
>   $("#modal-tenant .modal-content").html(data.html_form);
> }
>   }
> });
> return false;
>   };
>
>
>
>
>   /* Binding */
>
>
>   // Create tenant
>   $(".js-create-tenant").click(loadForm);
>   $("#modal-tenant").on("submit", ".js-tenant-create-form", saveForm);
>
> In the html form, i  try to load the modal form by clicking on this button
> 
>  data-url="{% url 'rentals:createTenant' %}>
>   
>   New Tenant
> 
>
>   
> I get a strange response shown below
> [09/May/2020 11:38:58] "GET
> /tenants/add/%3E%20%20%20%20%20%20%3Cspan%20class= HTTP/1.1" 404 2789
>
> I need the "GET /tenants/add/ part only. I do not know how the additional
> data is added to the Get request!
> Any bug in my code causing the strange data to be added?
>
> Ronald
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2c8f5ac8-2109-49b4-ad8a-d75c2350a21c%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHAc2jcsy6iacB-Yyo8mz1T_X%3DCq8WkZ02M4Tiv091JzGbONqQ%40mail.gmail.com.


Additional data added to the HTTP Get Request.

2020-05-09 Thread Ronald Kamulegeya
Hello Members.

I am a django beginner and i am going trough online tutorials.

I have the following view functions:

# Create your views here.
def save_tenant_form(request, form, template_name):
data = dict()
if request.method == 'POST':
if form.is_valid():
form.save()
data['form_is_valid'] = True
tenants = Tenants.objects.all()
data['html_tenant_list'] = render_to_string(
'rentals/tenant_partial_list.html', {
'tenant_list': tenants
})
else:
data['form_is_valid'] = False
context = {'form': form}
data['html_form'] = render_to_string(template_name, context, request=
request)
return JsonResponse(data)




def createTenant(request):
if request.method == 'POST':
form = TenantsForm(request.POST)
else:
form = TenantsForm()
   
return save_tenant_form(request, form, 
'rentals/partial_tenant_create.html')

Here is the url for the create function
path("tenants/add/",views.createTenant, name='createTenant'), 

There is some java script to load the modal form shown below:
$(function () {


  /* Functions */


  var loadForm = function () {
var btn = $(this);
$.ajax({
  url: btn.attr("data-url"),
  type: 'get',
  dataType: 'json',
  beforeSend: function () {
$("#modal-tenant .modal-content").html("");
$("#modal-tenant").modal("show");
  },
  success: function (data) {
$("#modal-tenant .modal-content").html(data.html_form);
  }
});
  };


  var saveForm = function () {
var form = $(this);
$.ajax({
  url: form.attr("action"),
  data: form.serialize(),
  type: form.attr("method"),
  dataType: 'json',
  success: function (data) {
if (data.form_is_valid) {
  $("#tenant-table tbody").html(data.html_book_list);
  $("#modal-tenant").modal("hide");
}
else {
  $("#modal-tenant .modal-content").html(data.html_form);
}
  }
});
return false;
  };




  /* Binding */


  // Create tenant
  $(".js-create-tenant").click(loadForm);
  $("#modal-tenant").on("submit", ".js-tenant-create-form", saveForm);

In the html form, i  try to load the modal form by clicking on this button


  New Tenant


  
I get a strange response shown below
[09/May/2020 11:38:58] "GET 
/tenants/add/%3E%20%20%20%20%20%20%3Cspan%20class= HTTP/1.1" 404 2789

I need the "GET /tenants/add/ part only. I do not know how the additional 
data is added to the Get request!
Any bug in my code causing the strange data to be added?

Ronald

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c8f5ac8-2109-49b4-ad8a-d75c2350a21c%40googlegroups.com.


Re: Domain Names and Web Servers

2020-05-09 Thread Vladimir Knobel
Have a look at divio.com, if you are in NZ perhaps not an option

On Sat, May 9, 2020, 07:40 David Merrick  wrote:

> Ok to rephrase the Question whats a typical set up for Django Web for say
> Website
> Web Servers and Domain Name Servers.
>
> For example for Rails I could use Heroku fro the Hosting
> https://www.heroku.com/
> For the Domain Name Server I could use Domains4less
> https://www.domains4less.co.nz/
> but Domain4less can't use Dynamic IP address so the two are related sorry.
>
> On Sat, May 9, 2020 at 10:14 AM Kasper Laudrup 
> wrote:
>
>> Hi David,
>>
>> On 08/05/2020 23.18, David Merrick wrote:
>> > Hi, I am interested in what web servers can be used for Django Web Apps
>> > and whether the Domain Name Servers are Static or Dynamic. Static
>> Domain
>> > Name Servers (DNS) the IP Address doesn't change and Dynamic (DNS) IP
>> > Address does change.
>> >
>>
>> That is really two completely unrelated questions.
>>
>> For deployment you can use quite a few different web servers, but it
>> really depends on your requirements:
>>
>> https://docs.djangoproject.com/en/3.0/howto/deployment/
>>
>> Django doesn't know anything about domain servers, that's not really
>> related at all.
>>
>> To be a bit pedantic, there really isn't any difference between a
>> dynamic and a static DNS server. DNS just resolves host names to IP
>> addresses (and more, but that's not relevant). Some DNS records just
>> have a low TTL meaning that the information provided changes more often
>> making them more "dynamic".
>>
>> How you decide to handle that also depends on your requirements and most
>> likely how you decide to host your Django application.
>>
>> Hope that helps.
>>
>> Kind regards,
>>
>> Kaspr Laudrup
>>
>> --
>> 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/2Tx8UU5K-n0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/c94d816f-b88b-feab-0a61-cd08718bc70f%40stacktrace.dk
>> .
>>
>
>
> --
> Dave Merrick
>
> TutorInvercargill
>
> http://tutorinvercargill.co.nz
>
> Daves Web Designs
>
> Website http://www.daveswebdesigns.co.nz
>
> Email merrick...@gmail.com
>
> Ph   03 216 2053
>
> Cell 027 3089 169
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B%3DMcKZm7hSGRE_Wa7%2BDhJM%3D9LBdixuXL6qmUWamaf-9OXTm2A%40mail.gmail.com
> 
> .
>

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