Create models using raw SQL queries

2019-03-26 Thread cameron hochbrg
hello,

for a project for a database class, we wanted to create a web app using 
django. However, our teacher wants us to use raw SQL queries for everything 
involving the database. As such I was wondering if it was possible to 
create mdoels using raw SQL queries.

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 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/8145efe7-c169-43d6-86e6-e0d64415a764%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create project in windows, but run it in Ubuntu

2019-03-26 Thread Mario R. Osorio
I'm sure you won't regret it.

Dtb/Gby
===
Mario R. Osorio
*Just Choose Python!* 

*SQL programmers don't die, they just ROLLBACK the TRANSACTION.*




On Tue, Mar 26, 2019 at 3:04 PM Chafid Ahmad  wrote:

> Thanks everyone for the suggestions. I ended up using the 3rd solution:
> making my laptop dual boot, Ubuntu and windows
>
> Cheers
>
> On Tue, Mar 26, 2019, 20:34 Mario R. Osorio  wrote:
>
>> Of course you can however, IMHO; it is better to use whatever is closest
>> to the real McCoy. Two options I can think of are:
>>
>> 1) Use Docker images. It is not very hard to work with Docker images
>> however, it does add a bit of difficulty to your workload.
>>
>> 2) Use a Linux image in VirtualBox. It will only take few minutes and I'm
>> sure will make you happier that dealing with Docker images. First, I would
>> use exactly the same Linux version as your server and try to replicate its
>> configuration.
>>
>> 2) If you are a big fan of Linux, you might want to install Linux and
>> leave on a dual boot system. This is what I have. The only problem is
>> though I rarely ever use the Windows boot, probably 3 times a year top,
>> and every time I do I have a looot of updates to make.
>>
>> On Friday, March 22, 2019 at 8:28:54 AM UTC-4, Chafid Ahmad wrote:
>>>
>>> Hi, I have a client who wanted to run a Django project that can run in
>>> Ubuntu. As I don't have a UX machine to developed it, is it possible to
>>> developed the project in Windows, but later export it to Ubuntu? My initial
>>> plan is:
>>> - Developed the project with pycharm in windows
>>> - Upload the project to github
>>> - retrieve the project from github to an ubuntu virtual machine and test
>>> it
>>> The reason I don't want to developed the project in virtual machine is
>>> that my hardware resource is limited, I don't want to share it if I don't
>>> absolutely have to.
>>> Is this possible? If not can anyone help me with another alternative
>>> solution?
>>>
>>> Cheers
>>> Chafid
>>> --
>>>
>>> --
>> 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/b242bc73-a837-43e2-a615-df09ad8d1908%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/fCUBH1LCFoc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADf88xkmoODaGu6xOUvRuR4nEp9iGVr9%3DiYvzHgio5JaS04kuQ%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/CAO2PNV4x%2B3zMH3LOF9_p-nuf8Wy01DC6mdZ1sse2-5BYaONJvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create project in windows, but run it in Ubuntu

2019-03-26 Thread Chafid Ahmad
Thanks everyone for the suggestions. I ended up using the 3rd solution:
making my laptop dual boot, Ubuntu and windows

Cheers

On Tue, Mar 26, 2019, 20:34 Mario R. Osorio  wrote:

> Of course you can however, IMHO; it is better to use whatever is closest
> to the real McCoy. Two options I can think of are:
>
> 1) Use Docker images. It is not very hard to work with Docker images
> however, it does add a bit of difficulty to your workload.
>
> 2) Use a Linux image in VirtualBox. It will only take few minutes and I'm
> sure will make you happier that dealing with Docker images. First, I would
> use exactly the same Linux version as your server and try to replicate its
> configuration.
>
> 2) If you are a big fan of Linux, you might want to install Linux and
> leave on a dual boot system. This is what I have. The only problem is
> though I rarely ever use the Windows boot, probably 3 times a year top,
> and every time I do I have a looot of updates to make.
>
> On Friday, March 22, 2019 at 8:28:54 AM UTC-4, Chafid Ahmad wrote:
>>
>> Hi, I have a client who wanted to run a Django project that can run in
>> Ubuntu. As I don't have a UX machine to developed it, is it possible to
>> developed the project in Windows, but later export it to Ubuntu? My initial
>> plan is:
>> - Developed the project with pycharm in windows
>> - Upload the project to github
>> - retrieve the project from github to an ubuntu virtual machine and test
>> it
>> The reason I don't want to developed the project in virtual machine is
>> that my hardware resource is limited, I don't want to share it if I don't
>> absolutely have to.
>> Is this possible? If not can anyone help me with another alternative
>> solution?
>>
>> Cheers
>> Chafid
>> --
>>
>> --
> 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/b242bc73-a837-43e2-a615-df09ad8d1908%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/CADf88xkmoODaGu6xOUvRuR4nEp9iGVr9%3DiYvzHgio5JaS04kuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I display the result of a query in the template ?

2019-03-26 Thread Suresh Kannan
Hi,

These video tutorials may help you

https://www.youtube.com/watch?v=VZ8NIoLN-yQ

https://www.youtube.com/watch?v=08Oulp3OpJA

On Tue, 26 Mar 2019 at 12:33, Nadhem Zmandar 
wrote:

> I am working on a project  using Django and AngularJS. I have executed a
> query on the python shell. I would like to show the result on the front
> using AngularJS and make it a dynamic query using the "id" .
>
> --
> 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/a5cdd508-fa1f-45da-aeee-6c5b69eb1341%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/CANfVfcARH0-uYrFzyV4_K4CJuYqyqu%3D818vGC_h_V30EEUrhLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How can I display the result of a query in the template ?

2019-03-26 Thread Nadhem Zmandar
I am working on a project  using Django and AngularJS. I have executed a 
query on the python shell. I would like to show the result on the front 
using AngularJS and make it a dynamic query using the "id" . 

-- 
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/a5cdd508-fa1f-45da-aeee-6c5b69eb1341%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create project in windows, but run it in Ubuntu

2019-03-26 Thread Eduardo Cervantes
I developed my django site on windows 10 and published to a ubuntu box
without issues.
Using github or other repository is straightforward and a good idea. The
only thing you need to change is your settings/config since one is dev and
the other will be production but you would have that issue regardless of
the system.

https://eddyizm.github.io/resume/
mobile 714-900-3339



On Fri, Mar 22, 2019 at 5:28 AM Chafid Ahmad  wrote:

> Hi, I have a client who wanted to run a Django project that can run in
> Ubuntu. As I don't have a UX machine to developed it, is it possible to
> developed the project in Windows, but later export it to Ubuntu? My initial
> plan is:
> - Developed the project with pycharm in windows
> - Upload the project to github
> - retrieve the project from github to an ubuntu virtual machine and test it
> The reason I don't want to developed the project in virtual machine is
> that my hardware resource is limited, I don't want to share it if I don't
> absolutely have to.
> Is this possible? If not can anyone help me with another alternative
> solution?
>
> Cheers
> Chafid
> --
>
> --
> 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/CADf88xmVSz9s8Rpg0gGL1Pmswb-DF8Fz_OEo-EDQgaK7F65hAg%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/CALZhWrcmpO2%2B9wJW39jgF%2B%3DG1AAL84Dj8duhiskm_03yKyAsvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Crispy: Helper Layout has no effect on form.

2019-03-26 Thread mohamed khaled
Are you add in setiings.py file  

installed_apps = [
.
'crispy_forms',
]

CRISPY_TEMPLATE_PACK = 'bootstrap4'


 then add this in page template you want to render 

 {% load crispy_forms_tags %}


On Wednesday, 20 March 2019 17:32:31 UTC+2, Mohammad Etemaddar wrote:
>
> Here is my model form which is rendered by crispy.
> When I change the layout, ordering, or adding elements, has no effect on 
> rendered form.
>
> Do you see any problem in the code?
>
> Thank you
>
>
> class FactoryForm(forms.ModelForm):
> class Meta:
> model = Factory
> fields = ('name','field', 'description', 'manager','province','city',
> 'address','phone_number','logo')
>
> province = forms.ModelChoiceField(queryset=Province.objects.all())
>
> def __init__(self, *args, **kwargs):
> super(FactoryForm, self).__init__(*args, **kwargs)
>
> self.helper = FormHelper(self)
> self.helper.form_tag = False
> self.helper.disable_csrf = True
>
> self.helper.layout = Layout(
> Fieldset(
> 'Legend',
> 'name', 'field', 'description', 'manager', 'province', 'city', 'address', 
> 'phone_number',
> HTML(""),
> 'logo',
> )
> )
>
> if self.instance.name:
> self.fields['province'].initial = self.instance.city.province
> self.fields['city'].queryset = City.objects.filter(province=self
> .instance.city.province)
>
>

-- 
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/a23c65c6-6241-4470-a452-2234296cfd00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create project in windows, but run it in Ubuntu

2019-03-26 Thread Mario R. Osorio
Of course you can however, IMHO; it is better to use whatever is closest to 
the real McCoy. Two options I can think of are:

1) Use Docker images. It is not very hard to work with Docker images 
however, it does add a bit of difficulty to your workload.

2) Use a Linux image in VirtualBox. It will only take few minutes and I'm 
sure will make you happier that dealing with Docker images. First, I would 
use exactly the same Linux version as your server and try to replicate its 
configuration.

2) If you are a big fan of Linux, you might want to install Linux and leave 
on a dual boot system. This is what I have. The only problem is though 
I rarely ever use the Windows boot, probably 3 times a year top, and every 
time I do I have a looot of updates to make.

On Friday, March 22, 2019 at 8:28:54 AM UTC-4, Chafid Ahmad wrote:
>
> Hi, I have a client who wanted to run a Django project that can run in 
> Ubuntu. As I don't have a UX machine to developed it, is it possible to 
> developed the project in Windows, but later export it to Ubuntu? My initial 
> plan is:
> - Developed the project with pycharm in windows
> - Upload the project to github
> - retrieve the project from github to an ubuntu virtual machine and test it
> The reason I don't want to developed the project in virtual machine is 
> that my hardware resource is limited, I don't want to share it if I don't 
> absolutely have to. 
> Is this possible? If not can anyone help me with another alternative 
> solution?
>
> Cheers
> Chafid
> -- 
>
>

-- 
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/b242bc73-a837-43e2-a615-df09ad8d1908%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Crispy: Helper Layout has no effect on form.

2019-03-26 Thread Mohammad Etemaddar
Found the answer.
I used crispy like this:
{{ form|crispy }}

*But We should use like this to get form helper effect:*

{% crispy form %}

On Wednesday, March 20, 2019 at 7:02:31 PM UTC+3:30, Mohammad Etemaddar 
wrote:

> Here is my model form which is rendered by crispy.
> When I change the layout, ordering, or adding elements, has no effect on 
> rendered form.
>
> Do you see any problem in the code?
>
> Thank you
>
>
> class FactoryForm(forms.ModelForm):
> class Meta:
> model = Factory
> fields = ('name','field', 'description', 'manager','province','city',
> 'address','phone_number','logo')
>
> province = forms.ModelChoiceField(queryset=Province.objects.all())
>
> def __init__(self, *args, **kwargs):
> super(FactoryForm, self).__init__(*args, **kwargs)
>
> self.helper = FormHelper(self)
> self.helper.form_tag = False
> self.helper.disable_csrf = True
>
> self.helper.layout = Layout(
> Fieldset(
> 'Legend',
> 'name', 'field', 'description', 'manager', 'province', 'city', 'address', 
> 'phone_number',
> HTML(""),
> 'logo',
> )
> )
>
> if self.instance.name:
> self.fields['province'].initial = self.instance.city.province
> self.fields['city'].queryset = City.objects.filter(province=self
> .instance.city.province)
>
>

-- 
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/c9df2370-dfce-4b63-aa50-9766d06c71b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django cms beginner app issue

2019-03-26 Thread Keegen Knapp
so I'm missing a line of code in my models.py?



On Tuesday, March 26, 2019 at 7:09:59 AM UTC-5, Avraham Serour wrote:
>
> you model doesn't have app_config
>
> On Tue, Mar 26, 2019 at 1:07 AM Keegen Knapp  > wrote:
>
>> I'm trying to write a custom app where you can add new plants in the 
>> admin. Then create a list view, category view and detailed view. You can 
>> see my error and code below. Any help is greatly appreciated!!
>>
>> Error - 
>>
>> [image: Screen Shot 2019-03-25 at 11.25.09 AM.png]
>>
>>
>> models.py - 
>>
>> from django.db import models
>> from cms.models.fields import PlaceholderField
>> from django.db.models.signals import pre_save
>>
>> #create a basic species model
>> class Species(models.Model):
>> name = models.CharField(max_length=50, unique=True)
>> def __unicode__(self):
>> return self.name
>>
>> class Plant(models.Model):
>> name = models.CharField(max_length=50, unique=True)
>> #textfield to choose season
>> season = models.TextField()
>> #automatically adds a created date, good for ordering plants by dates etc
>> pub_date = models.DateField(auto_now_add=True)
>> #automatically adds slug, requires Auto slug
>> slug = models.SlugField(max_length=70, unique=True)
>> #FK's to a species model
>> species = models.ForeignKey(Species)
>> #life cycle
>> life_cycle = models.CharField(max_length=60)
>> #add a upload section for specification sheets
>> position = models.TextField()
>> #take advantage of the CMS's placeholders for images, much more flexible 
>> than file_upload
>> image = PlaceholderField('plant_images', related_name="image")
>> #again description, take advantage of the CMS capabilities. 
>> description = PlaceholderField('plant_description', 
>> related_name="description")
>>
>>
>> *views.py*
>>
>> from django.shortcuts import render_to_response
>> from django.template import RequestContext
>>
>> class ProductDetailView(DetailView):
>> model = Plant
>> template_name = 'plants/detail.html'
>>
>>
>> *urls.py*
>> from plants.views import PlantDetailView
>>
>> urlpatterns = patterns('plants.views',
>> url(r'^(?P[\w-]+)/$', PlantDetailView.as_view()),
>> )
>>
>>
>> *cms.app.py  -*
>>
>> from cms.app_base import CMSApp
>> from cms.apphook_pool import apphook_pool
>> from django.utils.translation import ugettext_lazy as _
>>
>> class PlantsApp(CMSApp):
>> name = _("Plants") # give your app a name, this is required
>> urls = ["plants.urls"] # link your app to url configuration(s)
>>
>> def get_urls(self, page=None, language=None, **kwargs):
>> return ["plants.urls"]
>>
>> apphook_pool.register(PlantsApp) # register your app
>>
>> *apps.py - *
>> class PlantsConfig(AppConfig):
>> name = 'plants'
>> verbosename = "Plants"
>>
>> *admin.py - *
>> from django.contrib import admin
>> from .models import Plant, Species
>> from aldryn_apphooks_config.admin import ModelAppHookConfig, 
>> BaseAppHookConfig
>>
>> class PlantAdmin(ModelAppHookConfig, admin.ModelAdmin):
>> search_fields = ['name']
>> readonly_fields = ['slug']
>> ordering = ['name']
>> pass
>> admin.site.register(Plant, PlantAdmin)
>>
>>
>> class SpeciesAdmin(admin.ModelAdmin):
>> search_fields = ['name']
>> ordering = ['name']
>> pass
>> admin.site.register(Species, SpeciesAdmin)
>>
>> -- 
>> 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/f5c0d1e5-3962-48ce-8fdc-a082c37ddba5%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/be2fab33-303c-47c1-a06b-e90d531edc85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I create schemas while writing creating table models.

2019-03-26 Thread jgibson
Hi Sushen,

https://www.amvtek.com/blog/posts/2014/Jun/13/accessing-multiple-postgres-schemas-from-django/

This seems to be a rare use case, but that link has some options.  

Good Luck!


On Friday, March 22, 2019 at 8:58:20 PM UTC-4, Sushen Jamwal wrote:
>
> Hi all, 
>
> I am finding it difficult to create tables in different schemas under one 
> database. 
>
> For ex. mydatabase.myschemaone.school (DB.SCHEMA.TABLE) 
>
> and mydatabase.myschematwo.school 
>
> Thanks, 
> Sushen

-- 
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/f618114e-9a03-437f-bb52-2fb44533a116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django cms beginner app issue

2019-03-26 Thread Avraham Serour
you model doesn't have app_config

On Tue, Mar 26, 2019 at 1:07 AM Keegen Knapp  wrote:

> I'm trying to write a custom app where you can add new plants in the
> admin. Then create a list view, category view and detailed view. You can
> see my error and code below. Any help is greatly appreciated!!
>
> Error -
>
> [image: Screen Shot 2019-03-25 at 11.25.09 AM.png]
>
>
> models.py -
>
> from django.db import models
> from cms.models.fields import PlaceholderField
> from django.db.models.signals import pre_save
>
> #create a basic species model
> class Species(models.Model):
> name = models.CharField(max_length=50, unique=True)
> def __unicode__(self):
> return self.name
>
> class Plant(models.Model):
> name = models.CharField(max_length=50, unique=True)
> #textfield to choose season
> season = models.TextField()
> #automatically adds a created date, good for ordering plants by dates etc
> pub_date = models.DateField(auto_now_add=True)
> #automatically adds slug, requires Auto slug
> slug = models.SlugField(max_length=70, unique=True)
> #FK's to a species model
> species = models.ForeignKey(Species)
> #life cycle
> life_cycle = models.CharField(max_length=60)
> #add a upload section for specification sheets
> position = models.TextField()
> #take advantage of the CMS's placeholders for images, much more flexible
> than file_upload
> image = PlaceholderField('plant_images', related_name="image")
> #again description, take advantage of the CMS capabilities.
> description = PlaceholderField('plant_description',
> related_name="description")
>
>
> *views.py*
>
> from django.shortcuts import render_to_response
> from django.template import RequestContext
>
> class ProductDetailView(DetailView):
> model = Plant
> template_name = 'plants/detail.html'
>
>
> *urls.py*
> from plants.views import PlantDetailView
>
> urlpatterns = patterns('plants.views',
> url(r'^(?P[\w-]+)/$', PlantDetailView.as_view()),
> )
>
>
> *cms.app.py  -*
>
> from cms.app_base import CMSApp
> from cms.apphook_pool import apphook_pool
> from django.utils.translation import ugettext_lazy as _
>
> class PlantsApp(CMSApp):
> name = _("Plants") # give your app a name, this is required
> urls = ["plants.urls"] # link your app to url configuration(s)
>
> def get_urls(self, page=None, language=None, **kwargs):
> return ["plants.urls"]
>
> apphook_pool.register(PlantsApp) # register your app
>
> *apps.py - *
> class PlantsConfig(AppConfig):
> name = 'plants'
> verbosename = "Plants"
>
> *admin.py - *
> from django.contrib import admin
> from .models import Plant, Species
> from aldryn_apphooks_config.admin import ModelAppHookConfig,
> BaseAppHookConfig
>
> class PlantAdmin(ModelAppHookConfig, admin.ModelAdmin):
> search_fields = ['name']
> readonly_fields = ['slug']
> ordering = ['name']
> pass
> admin.site.register(Plant, PlantAdmin)
>
>
> class SpeciesAdmin(admin.ModelAdmin):
> search_fields = ['name']
> ordering = ['name']
> pass
> admin.site.register(Species, SpeciesAdmin)
>
> --
> 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/f5c0d1e5-3962-48ce-8fdc-a082c37ddba5%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/CAFWa6tK8hny1LH%3D5JzkrpiD4DRTRF9yk%3DhbeV9eW-w6GTWwSMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to inherit the user model in two apps in django rest,

2019-03-26 Thread jgibson
I'm not exactly sure what is happening with your models but a few places to 
investigate are these:

Since you are using `AbstractBaseUser` rather than `AbstractUser`:

* Looking at your code it seems like you missed assigning the 
*`USERNAME_FIELD`*
* You did not set your identifier (which I assume would be your username) 
to be *`unique=True`*

*https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD
 
*


Good Luck,

Jeremy Gibson
email:  jgib...@caktusgroup.com
website:  http://www.caktusgroup.com/


On Tuesday, March 26, 2019 at 7:25:58 AM UTC-4, Shubham Joshi wrote:
>
> I want to create 2 separate signup form 1 for teacher and 1 for a student 
> for that I created 2 apps and its respective models but it gives an error 
>
>
> https://github.com/shubham1507/school
>
> ==
> ERRORS:
> auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
> with reverse accessor for 'studentRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.groups' or 'studentRegistration.groups'.
> auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
> with reverse accessor for 'teacherRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.groups' or 'teacherRegistration.groups'.
> auth.User.user_permissions: (fields.E304) Reverse accessor for 
> 'User.user_permissions' clashes with reverse accessor for 
> 'studentRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.user_permissions' or 'studentRegistration.user_permissions'.
> auth.User.user_permissions: (fields.E304) Reverse accessor for 
> 'User.user_permissions' clashes with reverse accessor for 
> 'teacherRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'User.user_permissions' or 'teacherRegistration.user_permissions'.
> student.studentRegistration.groups: (fields.E304) Reverse accessor for 
> 'studentRegistration.groups' clashes with reverse accessor for 
> 'User.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.groups' or 'User.groups'.
> student.studentRegistration.groups: (fields.E304) Reverse accessor for 
> 'studentRegistration.groups' clashes with reverse accessor for 
> 'teacherRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.groups' or 'teacherRegistration.groups'.
> student.studentRegistration.image: (fields.E210) Cannot use ImageField 
> because Pillow is not installed.
> HINT: Get Pillow at https://pypi.org/project/Pillow/ or run 
> command "pip install Pillow".
> student.studentRegistration.parents_name: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> student.studentRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'studentRegistration.user_permissions' clashes with reverse 
> accessor for 'User.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.user_permissions' or 'User.user_permissions'.
> student.studentRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'studentRegistration.user_permissions' clashes with reverse 
> accessor for 'teacherRegistration.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'studentRegistration.user_permissions' or 
> 'teacherRegistration.user_permissions'.
> teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
> 'teacherRegistration.groups' clashes with reverse accessor for 
> 'User.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.groups' or 'User.groups'.
> teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
> 'teacherRegistration.groups' clashes with reverse accessor for 
> 'studentRegistration.groups'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.groups' or 'studentRegistration.groups'.
> teacher.teacherRegistration.qualification: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> teacher.teacherRegistration.subjectExperty: (fields.E120) CharFields must 
> define a 'max_length' attribute.
> teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
> accessor for 'teacherRegistration.user_permissions' clashes with reverse 
> accessor for 'User.user_permissions'.
> HINT: Add or change a related_name argument to the definition for 
> 'teacherRegistration.user_permissions' or 'User.user_permissions'.
> teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
> 

Re: django cms beginner app issue

2019-03-26 Thread Keegen Knapp
sorry, that doesn't make sense. maybe that was meant for a different post?

On Monday, March 25, 2019 at 6:58:01 PM UTC-5, LIGHTNING OMEGA 2 636 wrote:
>
> Just letting you know that, I've read msg and reviewed you code.  Although 
> these are interview objects, it uses word tokens.   Key words such as those 
> used in this code are handled well by utilizing Natural Language Processing 
> (NLP) methods.   Mapping and Regular Expressions (Regex) do alot of the 
> work in Python, R, React JavaScript etc.  Now I need to see if Turbo Pascal 
> supports these libraries of code.   If it's okay, maybe Tomorrow or Thurs 
> will work as far as meeting is concerned.
>
> On Mon, Mar 25, 2019 at 7:07 PM Keegen Knapp  > wrote:
>
>> I'm trying to write a custom app where you can add new plants in the 
>> admin. Then create a list view, category view and detailed view. You can 
>> see my error and code below. Any help is greatly appreciated!!
>>
>> Error - 
>>
>> [image: Screen Shot 2019-03-25 at 11.25.09 AM.png]
>>
>>
>> models.py - 
>>
>> from django.db import models
>> from cms.models.fields import PlaceholderField
>> from django.db.models.signals import pre_save
>>
>> #create a basic species model
>> class Species(models.Model):
>> name = models.CharField(max_length=50, unique=True)
>> def __unicode__(self):
>> return self.name
>>
>> class Plant(models.Model):
>> name = models.CharField(max_length=50, unique=True)
>> #textfield to choose season
>> season = models.TextField()
>> #automatically adds a created date, good for ordering plants by dates etc
>> pub_date = models.DateField(auto_now_add=True)
>> #automatically adds slug, requires Auto slug
>> slug = models.SlugField(max_length=70, unique=True)
>> #FK's to a species model
>> species = models.ForeignKey(Species)
>> #life cycle
>> life_cycle = models.CharField(max_length=60)
>> #add a upload section for specification sheets
>> position = models.TextField()
>> #take advantage of the CMS's placeholders for images, much more flexible 
>> than file_upload
>> image = PlaceholderField('plant_images', related_name="image")
>> #again description, take advantage of the CMS capabilities. 
>> description = PlaceholderField('plant_description', 
>> related_name="description")
>>
>>
>> *views.py*
>>
>> from django.shortcuts import render_to_response
>> from django.template import RequestContext
>>
>> class ProductDetailView(DetailView):
>> model = Plant
>> template_name = 'plants/detail.html'
>>
>>
>> *urls.py*
>> from plants.views import PlantDetailView
>>
>> urlpatterns = patterns('plants.views',
>> url(r'^(?P[\w-]+)/$', PlantDetailView.as_view()),
>> )
>>
>>
>> *cms.app.py  -*
>>
>> from cms.app_base import CMSApp
>> from cms.apphook_pool import apphook_pool
>> from django.utils.translation import ugettext_lazy as _
>>
>> class PlantsApp(CMSApp):
>> name = _("Plants") # give your app a name, this is required
>> urls = ["plants.urls"] # link your app to url configuration(s)
>>
>> def get_urls(self, page=None, language=None, **kwargs):
>> return ["plants.urls"]
>>
>> apphook_pool.register(PlantsApp) # register your app
>>
>> *apps.py - *
>> class PlantsConfig(AppConfig):
>> name = 'plants'
>> verbosename = "Plants"
>>
>> *admin.py - *
>> from django.contrib import admin
>> from .models import Plant, Species
>> from aldryn_apphooks_config.admin import ModelAppHookConfig, 
>> BaseAppHookConfig
>>
>> class PlantAdmin(ModelAppHookConfig, admin.ModelAdmin):
>> search_fields = ['name']
>> readonly_fields = ['slug']
>> ordering = ['name']
>> pass
>> admin.site.register(Plant, PlantAdmin)
>>
>>
>> class SpeciesAdmin(admin.ModelAdmin):
>> search_fields = ['name']
>> ordering = ['name']
>> pass
>> admin.site.register(Species, SpeciesAdmin)
>>
>> -- 
>> 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/f5c0d1e5-3962-48ce-8fdc-a082c37ddba5%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 

How to inherit the user model in two apps in django rest,

2019-03-26 Thread Shubham Joshi
I want to create 2 separate signup form 1 for teacher and 1 for a student 
for that I created 2 apps and its respective models but it gives an error 


https://github.com/shubham1507/school

==
ERRORS:
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
with reverse accessor for 'studentRegistration.groups'.
HINT: Add or change a related_name argument to the definition for 
'User.groups' or 'studentRegistration.groups'.
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes 
with reverse accessor for 'teacherRegistration.groups'.
HINT: Add or change a related_name argument to the definition for 
'User.groups' or 'teacherRegistration.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 
'User.user_permissions' clashes with reverse accessor for 
'studentRegistration.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'User.user_permissions' or 'studentRegistration.user_permissions'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 
'User.user_permissions' clashes with reverse accessor for 
'teacherRegistration.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'User.user_permissions' or 'teacherRegistration.user_permissions'.
student.studentRegistration.groups: (fields.E304) Reverse accessor for 
'studentRegistration.groups' clashes with reverse accessor for 
'User.groups'.
HINT: Add or change a related_name argument to the definition for 
'studentRegistration.groups' or 'User.groups'.
student.studentRegistration.groups: (fields.E304) Reverse accessor for 
'studentRegistration.groups' clashes with reverse accessor for 
'teacherRegistration.groups'.
HINT: Add or change a related_name argument to the definition for 
'studentRegistration.groups' or 'teacherRegistration.groups'.
student.studentRegistration.image: (fields.E210) Cannot use ImageField 
because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command 
"pip install Pillow".
student.studentRegistration.parents_name: (fields.E120) CharFields must 
define a 'max_length' attribute.
student.studentRegistration.user_permissions: (fields.E304) Reverse 
accessor for 'studentRegistration.user_permissions' clashes with reverse 
accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'studentRegistration.user_permissions' or 'User.user_permissions'.
student.studentRegistration.user_permissions: (fields.E304) Reverse 
accessor for 'studentRegistration.user_permissions' clashes with reverse 
accessor for 'teacherRegistration.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'studentRegistration.user_permissions' or 
'teacherRegistration.user_permissions'.
teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
'teacherRegistration.groups' clashes with reverse accessor for 
'User.groups'.
HINT: Add or change a related_name argument to the definition for 
'teacherRegistration.groups' or 'User.groups'.
teacher.teacherRegistration.groups: (fields.E304) Reverse accessor for 
'teacherRegistration.groups' clashes with reverse accessor for 
'studentRegistration.groups'.
HINT: Add or change a related_name argument to the definition for 
'teacherRegistration.groups' or 'studentRegistration.groups'.
teacher.teacherRegistration.qualification: (fields.E120) CharFields must 
define a 'max_length' attribute.
teacher.teacherRegistration.subjectExperty: (fields.E120) CharFields must 
define a 'max_length' attribute.
teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
accessor for 'teacherRegistration.user_permissions' clashes with reverse 
accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'teacherRegistration.user_permissions' or 'User.user_permissions'.
teacher.teacherRegistration.user_permissions: (fields.E304) Reverse 
accessor for 'teacherRegistration.user_permissions' clashes with reverse 
accessor for 'studentRegistration.user_permissions'.
HINT: Add or change a related_name argument to the definition for 
'teacherRegistration.user_permissions' or 
'studentRegistration.user_permissions'.

-- 
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/ff5b75ee-9f50-4895-8d66-7a99d9beb5c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: add Image Field in model

2019-03-26 Thread 'Amitesh Sahay' via Django users
Hello Omar, 
When creating a model you need to use "ImageField"
example
abc = models.ImageFields()
I hope thats what you are looking for. If you have any specific requirements do 
let me know.Sorry for the delayed response.


Regards,
Amitesh Sahay 

On Wednesday, 13 March, 2019, 5:55:15 pm IST, omar ahmed 
 wrote:  
 
 i installed it 
thanks Amitesh
but what about creating image field in model

On Wednesday, March 13, 2019 at 10:58:50 AM UTC+2, Amitesh Sahay wrote:
Hello Omar, 
You need to install "pillow" python module in order to work with image files.


Regards,
Amitesh Sahay91-750 797 8619 

On Tuesday, 12 March, 2019, 6:51:09 pm IST, omar ahmed  
wrote:  
 
 helloi want to add image field in my modeli typed :
 image = models.ImageField()but :
 Cannot use ImageField because Pillow is not installed


-- 
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/6101b636- 925a-4f22-9637-13678d2ecaf0% 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/905656a7-ae5c-406e-967a-1183ad23e728%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/1237613.10482874.1553597463667%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help Needed For .Error Solving

2019-03-26 Thread Manas Nikam
Where is the error at response from paytm or at your request for payment
information?

On Tue, Mar 26, 2019, 6:57 AM Mike Dewhirst  wrote:

> On 26/03/2019 4:35 am, Kumar Ashirwad Mishra wrote:
> > I am trying to send a request to paytm gateway checkout api for online
> > transaction so I have created a form that has hidden values for
> > request. So how to solve the csrf_token problem .. Thankyou
>
> You need to include the CSRF token immediately after the form action
>
>  
>  {% csrf_token %}
>
> ... so if that occurs in card2.htm that's where it should be.
>
> hth
>
>
> > --
> > 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/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/django-users/1ccd4a76-e64c-4aab-8b08-5a1feee0fff1%40googlegroups.com?utm_medium=email_source=footer
> >.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5f2b5f04-0129-a669-06c8-8c1345293c0d%40dewhirst.com.au
> .
> 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/CAF%2BYYc5E4U_8j_vZ_ge6CaLqXhih8QyLjqr7uEpkeWpsZXUXjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Translation doesn't work?

2019-03-26 Thread ANi
Oooops, it's a typo. Thanks!

Gourav Sardana於 2019年3月26日星期二 UTC+8下午2時04分11秒寫道:
>
> Use the correct spelling in your html
> Its {%trans%}
> Please use this. Hope so this will fine working !
> Have a good day!
>
> On Tue, 26 Mar 2019, 11:29 am ANi, > 
> wrote:
>
>> Does anyone have clue about it? 
>> I'll appreciate your help!
>>
>> ANi於 2019年3月22日星期五 UTC+8上午11時12分07秒寫道:
>>>
>>> Hello.
>>> The only word that has been translated is "name", but it seems that it 
>>> is the default one in Django.
>>> So basically my translation does not work at all..
>>> please help 
>>>
>>> Here is what I've done so far...
>>>
>>> settings.py
>>> MIDDLEWARE = [
>>>  ...
>>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>>  'django.middleware.locale.LocaleMiddleware',
>>>  ...
>>> ]
>>>
>>>
>>> LANGUAGE = [
>>>  ('en-us', 'English'), 
>>>  ('zh-Hant','繁體中文'), 
>>> ]
>>>
>>>
>>> LANGUAGE_CODE = 'zh-Hant'
>>>
>>>
>>> USE_I18N = True
>>>
>>> USE_L10N = True
>>>
>>> ...
>>>
>>>
>>> LANGUAGE_PATHS = os.path.join(BASE_DIR, "locale")
>>>
>>>
>>> part of django.po
>>>
>>> #: .\main\models\center.py:43 .\main\models\company.py:18
>>> #: .\main\models\company.py:33 .\main\models\log.py:70
>>> #: .\main\models\select.py:17 .\main\models\select.py:33
>>> #: .\main\models\item.py:95 .\templates\main\main.html:11
>>> msgid "name"
>>> msgstr "名稱"
>>>
>>>
>>> #: .\main\models\item.py:98 .\templates\main\main.html:13
>>> msgid "value"
>>> msgstr "價值"
>>>
>>>
>>> #: .\main\models\item.py:102 .\main\models\log.py:98
>>> msgid "currency"
>>> msgstr "幣別"
>>>
>>>
>>>
>>> part of main.html
>>> {% load static %}
>>> {% load filters %}
>>> {% load i18n %}
>>> {% block container %}
>>>  
>>>  
>>>  
>>>  {% trans 'name' %}
>>>  {% tans 'value' %}
>>>  ...
>>>
>>>
>>> part of item.py
>>> from django.utils.translation import gettext_lazy as _
>>> ...
>>>
>>> class Asset(models.Model):
>>>  name = models.CharField(_('name'), max_length=255)
>>>  value = models.IntegerField(_('value'))
>>>  currency = models.ForeignKey(Currency,
>>>   null=True,
>>>   on_delete=models.SET_NULL,
>>>verbose_name=_('currency'))
>>>  ...
>>>
>>> filte structure
>>> myproject
>>>  - main_app
>>>  - common-statics
>>>  - templates
>>>  - myproject
>>>  - locale
>>>  - zh-hant
>>>-LC_MESSAGES
>>>  - django.mo
>>>  - django.po
>>>
>>>
>>> thanks!
>>>
>>>
>>> -- 
>> 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/91f4655c-a0d0-4069-8411-155f06d9d01b%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/0f78093b-14fb-4b19-b97f-fa781011a504%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django REST custom registration

2019-03-26 Thread Shubham Joshi
thanks


On Tue, Mar 26, 2019 at 8:33 AM Sam W  wrote:

> Similar question  in Stackoverflow:
>
>
> https://stackoverflow.com/questions/24791110/django-allauth-how-to-set-user-to-active-only-after-e-mail-verification/24809190
>
> On Monday, March 25, 2019 at 4:17:11 AM UTC-5, shubham joshi wrote:
>>
>> How can I create sign up form in such a way that..once a form has been
>> filled and submitted by user (teacher / student) . The form should be sent
>> to the Admins email id , once s/he verified the sign up form , the user
>> should able log in
>>
> --
> 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/121d6dda-fd92-48e9-b5f8-cdd6ad84a8b6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*Shubham Joshi*
Business Developer | Terse Software
M: 8390246938

E: shub...@tersesoft.com 
www.tersesoft.com
[image: linkedin]  [image:
github] 

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


Re: Web Push Notification in Django

2019-03-26 Thread Sam W
This one is very simple:

https://www.pushbots.help/install-pushbots-in-your-app-or-website/web-pages/add-pushbots-to-your-web-page

On Monday, March 25, 2019 at 11:28:43 AM UTC-5, Aayush Bhattarai wrote:
>
> *I am working on blog project and I wanted to add Web Push Notification in 
> Django. I have researched a lot. I have not found proper answer on it.*
> *Looking for good answer. Thank You.*
>

-- 
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/ed736569-2d1c-4ec7-b46e-c47e5670bd40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Translation doesn't work?

2019-03-26 Thread Gourav Sardana
Use the correct spelling in your html
Its {%trans%}
Please use this. Hope so this will fine working !
Have a good day!

On Tue, 26 Mar 2019, 11:29 am ANi,  wrote:

> Does anyone have clue about it?
> I'll appreciate your help!
>
> ANi於 2019年3月22日星期五 UTC+8上午11時12分07秒寫道:
>>
>> Hello.
>> The only word that has been translated is "name", but it seems that it is
>> the default one in Django.
>> So basically my translation does not work at all..
>> please help
>>
>> Here is what I've done so far...
>>
>> settings.py
>> MIDDLEWARE = [
>>  ...
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.locale.LocaleMiddleware',
>>  ...
>> ]
>>
>>
>> LANGUAGE = [
>>  ('en-us', 'English'),
>>  ('zh-Hant','繁體中文'),
>> ]
>>
>>
>> LANGUAGE_CODE = 'zh-Hant'
>>
>>
>> USE_I18N = True
>>
>> USE_L10N = True
>>
>> ...
>>
>>
>> LANGUAGE_PATHS = os.path.join(BASE_DIR, "locale")
>>
>>
>> part of django.po
>>
>> #: .\main\models\center.py:43 .\main\models\company.py:18
>> #: .\main\models\company.py:33 .\main\models\log.py:70
>> #: .\main\models\select.py:17 .\main\models\select.py:33
>> #: .\main\models\item.py:95 .\templates\main\main.html:11
>> msgid "name"
>> msgstr "名稱"
>>
>>
>> #: .\main\models\item.py:98 .\templates\main\main.html:13
>> msgid "value"
>> msgstr "價值"
>>
>>
>> #: .\main\models\item.py:102 .\main\models\log.py:98
>> msgid "currency"
>> msgstr "幣別"
>>
>>
>>
>> part of main.html
>> {% load static %}
>> {% load filters %}
>> {% load i18n %}
>> {% block container %}
>>  
>>  
>>  
>>  {% trans 'name' %}
>>  {% tans 'value' %}
>>  ...
>>
>>
>> part of item.py
>> from django.utils.translation import gettext_lazy as _
>> ...
>>
>> class Asset(models.Model):
>>  name = models.CharField(_('name'), max_length=255)
>>  value = models.IntegerField(_('value'))
>>  currency = models.ForeignKey(Currency,
>>   null=True,
>>   on_delete=models.SET_NULL,
>>verbose_name=_('currency'))
>>  ...
>>
>> filte structure
>> myproject
>>  - main_app
>>  - common-statics
>>  - templates
>>  - myproject
>>  - locale
>>  - zh-hant
>>-LC_MESSAGES
>>  - django.mo
>>  - django.po
>>
>>
>> thanks!
>>
>>
>> --
> 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/91f4655c-a0d0-4069-8411-155f06d9d01b%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/CACdXjQKaHxiK1sUGRkPVo%3DcEK%2Brs-mhvY8BfS-7AS5Fc6ckRYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.