Re: django

2018-07-14 Thread Rohit Keshav
Django doesn't behave like WordPress. There isn't a UI like WordPress.
For more refer -
https://www.djangoproject.com/start/

On Sat, Jul 14, 2018, 10:27 PM jiten amin  wrote:

> Does Django provides UI interface like Wordprees do? How we can develop
> website in django using UI?
>
> --
> 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/CAD%3Dev3Y3hWei0fug_eD%2BXpePd8BMhMStoimBSXaTOg2pRciaXg%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/CAOic_c%3DesUJpuEHSgi2%2B0uPDuE7Tbkga61ea4dvvyXHU_wQ6vQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django

2018-07-14 Thread jiten amin
Does Django provides UI interface like Wordprees do? How we can develop
website in django using UI?

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


Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread 'Anthony Flury' via Django users

On 14/07/18 15:59, Mickael Barbo wrote:

Hi Anthony 


Michael



Thanks for sharing your experience.

"1 file one object doesn't mean what you think it means."

I hope you get the meaning I described 


I understand what you mean - I just don't agree with your analysis of 
one file one object means in practice.


"it normally means (for instance) defining one class (and ALL of it's 
methods' in one file) - not importing methods into class definitions - 
I have never seen anyone suggest that."


A method is a function ? a function an object ? right ?
Strictly speaking a function is an object - but that is a python 
implementation detail. Remember that one object one file originated well 
before python was created. It came from the original OOP days with 
languages such as C++ - where methods are not objects in the OOP sense - 
the normal accepted meaning of 'One file - One Object' is (in terms of 
Python)  'One file - one class'.




My purpose is that *I prefer working on several "small" files 
containing 1 small function/object* and _*NOT*_ *dealing with a "big" 
file* containing all methods of class (for example). It's 
straightforward to find what I look for.


Mixins and inheritance don't really help here - unless you are reusing 
the same method in multiple classes - in which case you might have a 
mixin, or an inheritance situation.

Agree 

If you have one or more methods that provide a useful extra behavior 
to one or many classes (say that you have a set of methods that 
provide extra formatting on some fields, then that would be a mixin

Ok

If you can identify one of your classes being an extension to another 
in some way - so for instance you have a model for Customers, and you 
have a model for your Gold Customers then you might well have an 
inheritance situation - anywhere you can say Model A is a type of 
Model B that is inheritance: Gold Customers are a type of Customer.

Ok

So, for you, *if you would reduce the size of files you are working 
on, how would you do that ?*
If you implement your classes and all of it's methods you can't reduce 
the file size - you can though work to reduce the amount of code on 
screen. Typically you will work on one method at a time, and most good 
code editors have what they call code-folding; code folding allows you 
to collapse individual methods to a few lines (the function signature 
and the doc string), and many good editors will also allow you to fold 
loops, if/else blocks, try/except blocks, and with blocks such that the 
amount of code on screen are reduced. Most good editors will also 
provide a 'contents' type view of your code - so that you can see a list 
of the functions/methods in your file, and jump to them - without 
needing to scroll through your code.


I do understand it doesn't solve your immediate problem as you see it, 
but I think with good quality tools your 'problem' wont actually be a 
problem.


Personally I use PyCharm, which is a very good quality code editor, and 
also entirely free.




For example, let's say you have a Customer class with 15 methods and 
the file is about 1000 lines of code.

How to split this file in smaller files with 1 method per file ?


I wouldn't split it - at all - if you split the methods into files as 
you suggest- you are loosing at least some of the advantages of OOP - it 
is a considerable benefit to have all your code in one place - to be 
able check-in and revert your changes to a single class.


If you do really wish to go down the one function/method one file route, 
then the scheme that you already use is probably the best one(in terms 
of ensuring your code works as you expect); If you do use that strategy 
I would stron





Thanks for your help Anthony, hoping to be as clear as possible.
Regards


2018-07-14 10:56 GMT+02:00 Anthony Flury >:


On 13/07/18 12:44, Mickael Barbo wrote:

Hi !
*
I like working with " 1 file - 1 object " (Object could be
class, function...).*
It simplify visibility, debug etc... and it's easy for me to
*don't pollute my brain* :-)


1 file one object doesn't mean what you think it means.

it normally means (for instance) defining one class (and ALL of
it's methods' in one file) - not importing methods into class
definitions - I have never seen anyone suggest that.

Mixins and inheritance don't really help here - unless you are
reusing the same method in multiple classes - in which case you
might have a mixin, or an inheritance situation.

If you have one or more methods that provide a useful extra
behavior to one or many classes (say that you have a set of
methods that provide extra formatting on some fields, then that
would be a mixin

If you can identify one of your classes being an extension to
another in some way - so for instance you have a model for
Customers, and you have a model for your Gold Customers 

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread 'Anthony Flury' via Django users

On 14/07/18 15:59, Mickael Barbo wrote:

Hi Anthony 


Michael



Thanks for sharing your experience.

"1 file one object doesn't mean what you think it means."

I hope you get the meaning I described 


I understand what you mean - I just don't agree with your analysis of 
one file one object means in practice.


"it normally means (for instance) defining one class (and ALL of it's 
methods' in one file) - not importing methods into class definitions - 
I have never seen anyone suggest that."


A method is a function ? a function an object ? right ?
Strictly speaking a function is an object - but that is a python 
implementation detail. Remember that one object one file originated well 
before python was created. It came from the original OOP days with 
languages such as C++ - where methods are not objects in the OOP sense - 
the normal accepted meaning of 'One file - One Object' is (in terms of 
Python)  'One file - one class'.




My purpose is that *I prefer working on several "small" files 
containing 1 small function/object* and _*NOT*_ *dealing with a "big" 
file* containing all methods of class (for example). It's 
straightforward to find what I look for.


Mixins and inheritance don't really help here - unless you are reusing 
the same method in multiple classes - in which case you might have a 
mixin, or an inheritance situation.

Agree 

If you have one or more methods that provide a useful extra behavior 
to one or many classes (say that you have a set of methods that 
provide extra formatting on some fields, then that would be a mixin

Ok

If you can identify one of your classes being an extension to another 
in some way - so for instance you have a model for Customers, and you 
have a model for your Gold Customers then you might well have an 
inheritance situation - anywhere you can say Model A is a type of 
Model B that is inheritance: Gold Customers are a type of Customer.

Ok

So, for you, *if you would reduce the size of files you are working 
on, how would you do that ?*
If you implement your classes and all of it's methods you can't reduce 
the file size - you can though work to reduce the amount of code on 
screen. Typically you will work on one method at a time, and most good 
code editors have what they call code-folding; code folding allows you 
to collapse individual methods to a few lines (the function signature 
and the doc string), and many good editors will also allow you to fold 
loops, if/else blocks, try/except blocks, and with blocks such that the 
amount of code on screen are reduced. Most good editors will also 
provide a 'contents' type view of your code - so that you can see a list 
of the functions/methods in your file, and jump to them - without 
needing to scroll through your code.


I do understand it doesn't solve your immediate problem as you see it, 
but I think with good quality tools your 'problem' wont actually be a 
problem.


Personally I use PyCharm, which is a very good quality code editor, and 
also entirely free.




For example, let's say you have a Customer class with 15 methods and 
the file is about 1000 lines of code.

How to split this file in smaller files with 1 method per file ?


I wouldn't split it - at all - if you split the methods into files as 
you suggest- you are loosing at least some of the advantages of OOP - it 
is a considerable benefit to have all your code in one place - to be 
able check-in and revert your changes to a single class.


If you do really wish to go down the one function/method one file route, 
then the scheme that you already use is probably the best one(in terms 
of ensuring your code works as you expect); If you do use that strategy 
I would strongly suggest that you keep your dunder_init, and any factory 
methods with your class definition - these are the most important to be 
honest, since they establish the basis of all of your functionality.





Thanks for your help Anthony, hoping to be as clear as possible.
Regards


2018-07-14 10:56 GMT+02:00 Anthony Flury >:


On 13/07/18 12:44, Mickael Barbo wrote:

Hi !
*
I like working with " 1 file - 1 object " (Object could be
class, function...).*
It simplify visibility, debug etc... and it's easy for me to
*don't pollute my brain* :-)


1 file one object doesn't mean what you think it means.

it normally means (for instance) defining one class (and ALL of
it's methods' in one file) - not importing methods into class
definitions - I have never seen anyone suggest that.

Mixins and inheritance don't really help here - unless you are
reusing the same method in multiple classes - in which case you
might have a mixin, or an inheritance situation.

If you have one or more methods that provide a useful extra
behavior to one or many classes (say that you have a set of
methods that provide extra formatting on some fields, then that
would 

Including DetailView context in ListView page in the Order history page using Django

2018-07-14 Thread Simon McConnell
item.product.image from your template points to nothing. Product is a CharField 
so I don't see it having any image attribute.

Try to display some text for item.product or item.price and see how you go.

-- 
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/092f9c42-3f1f-4cef-a7b4-9c6984013255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread Melvyn Sopacua
On vrijdag 13 juli 2018 13:44:21 CEST Mickael Barbo wrote:

> *I like working with " 1 file - 1 object " (Object could be class,
> function...).*
> It simplify visibility, debug etc... and it's easy for me to *don't pollute
> my brain* :-)

It only seems that way.  Debugging is actually much harder, as you jump from 
source file to source file, for the tiniest things.

My assumption is that you come from a php background, where you have single 
inheritance with autoload functionality. In php a lot is implicit, hidden and 
fragmented.

Python is a different animal. Imports are explicit. Sharing imports is a good 
thing. Bunding tiny classes (mixins, utilities) in one file is a good thing. 
Bundling related classes in a single file is a good thing.

When you really want to stick to one file per class, then you sacrifice 
performance. Where you could avoid an import for a related Django model, you 
now have to import the module and depending if you the need to avoid a 
circular import you either cause a runtime import or add extra startup time.

It's better to not adhere to such "one size fits all" rule systems but use your 
brain to construct your modules in a sensible way.

-- 
Melvyn Sopacua

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


Re: Static images are working but static CSS is not working SS attached

2018-07-14 Thread Kasper Laudrup

Hi Param,

On 2018-07-14 09:16, Param Saini wrote:


I just started working on python so copying settings.py file contents 
below :
and regarding production and development server i have no idea ... i 
just run it on my Laptop by using python manage.py runserver command




Then you are running in development mode with the development server.


Settings.py file :


That looks fine to me, but I'm far from an expert on Django. Maybe 
someone else on this list can help?


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 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/a8084af4-63d0-31c3-678b-de8f3b611398%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Including DetailView context in ListView page in the Order history page using Django

2018-07-14 Thread Samir Tendulkar


https://stackoverflow.com/questions/51341215/including-detailview-context-in-listview-page-in-the-order-history-page-using-dj

Hi Djangonauts, 

I would like to add some Order details(DetailView) in the Order history 
page(ListView), See image example below ( I have made the image on 
photoshop). I was able to get the grey part (order list to show) But I am 
not able to get the item details to show in this page. If I click View 
Order Detail it goes to detail page where I can show all this. But I need a 
small summary in the ListPage too see example below 

[image: enter image description here] 

below are my *view.py* 

class OrderHistory(LoginRequiredMixin, ListView):
model = Order
template_name = 'order/order_list.html'

def get_context_data(self, **kwargs):
context = super(OrderHistory, self).get_context_data()
context['order_details'] = 
Order.objects.filter(emailAddress=self.request.user.email)
context['order_items'] = 
OrderItem.objects.filter(order=self.kwargs.get("order"))
return context

I even tried # context['order_items'] = 
OrderItem.objects.filter(order__id=self.kwargs.get("order.id"))

Below are my *models.py* 

from django.db import models
class Order(models.Model):
token = models.CharField(max_length=250, blank=True)
total = models.DecimalField(max_digits=6, decimal_places=2, 
verbose_name='USD Order Total')
emailAddress = models.EmailField(max_length=100, blank=True, 
verbose_name='Email Address')
created = models.DateTimeField(auto_now_add=True)
billingName = models.CharField(max_length=350, blank=True)
billingAddress1 = models.CharField(max_length=350, blank=True)
billingCity = models.CharField(max_length=100, blank=True)
billingZipcode = models.CharField(max_length=10, blank=True)
billingCountry = models.CharField(max_length=50, blank=True)

class OrderItem(models.Model):
product = models.CharField(max_length=250)
quantity = models.IntegerField()
price = models.DecimalField(max_digits=5, decimal_places=2, 
verbose_name='USD Price')
order = models.ForeignKey(Order, on_delete=models.CASCADE)

def sub_total(self):
return self.quantity * self.price



Below are my *templates* Its not needed for this question. I believe I am 
doing something wrong in the views.py . But I have it just in case. 



{% extends 'base.html' %}
{% load staticfiles %}
{% block body %}



Tasting Order Purchase 
History

{% if order_details %}
{% for order in order_details %}


Order Number: 156{{ order.id }}
Order Date: {{ order.created|date:"M d 
Y" }}



Status: Paid
Total items in Order: ()



Order Total: ${{ order.total }}


View Order Details


{% for item in order_items %}


a 



{% endfor %}


{% endfor %}

{% else %}

You do not have any orders yet.
Add 
more recipes

{% endif %}




{% endblock %}

Any advise on how I can make this work 

-- 
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/a1da9927-bb65-40d9-9e27-f1086c10f538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Isomorphic programming in Python & Django research

2018-07-14 Thread Jamesie Pic
Hi all,

this is a copy from our chat that may interrest this mailing list.

I came in here to announce our ReactJS implementation in Python :
https://blog.yourlabs.org/post/175884575803/tbinetruychip

so yeah, @tbinetruy, ReactJS dev with some python experience, is porting
react to python, and said "this kills reactjs", but was very tired ^^

this is what made him say that:
https://github.com/tbinetruy/CHIP/blob/master/chp/chip.py#L66-L69 :

content = [
def_local('x', 'document.getElementById(\'myInput\').value'),
chip_js.log('x'),
assign('document.getElementById(\'demo\').innerHTML', op('+', "'You
selected: '", 'x')),
]

Above, see he's programming JS from Python

We've been pair-programing this in hackaton mode since a few days
the only last thing is replacing that piece of code i pasted above, but a
python function, and use a python 2 js converter


Thus acheiving, isomorphic programing from Python, just like we can in go
(see: https://go.isomorphicgo.org/ )

We're always looking for new friends to participate in open research in our
crazy company. If you're interrested in changing how we Python hackers
relate to client side programming please let me know and we'll hook you up
in our hackaton.

Also note, if you're a known python / django contributor and have an
immediate need for money, we will sponsor some open source contributions in
advance. That might be something that can pay your trip to Djangocon or
something ;)

Have a beautiful day ;)

-- 
∞

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


Re: Re: Beginner

2018-07-14 Thread bitbouncerr
Title: BitBounce Autoresponse




  
  



  
  

  

  

  
  





  
  

  

  
 
 
 
  
  
 
 
 
  

  


  

  Hello! I use a new email filtering service called BitBounce to filter my email. To deliver your email to my inbox, please click the button below and pay the small cryptocurrency fee. Thank you!


$0.05 to deliver your email.


  We’ve never met — I’ll pay your fee.



  I know you — Add me to your whitelist.

  


  

  
 
 
 
  
  
 
 
 
  

  

  
  





  
  

  
BitBounce is powered by
 the Credo cryptocurrency
  
  
I’m from a business — 
what are my delivery options
  
  
BitBounce and Credo are
transacted through CredoEx
  

  
  





  
  

  
Made by Turing Technology Inc. in San Mateo, California Sign Up for BitBounce
  

  
  



  
  





-- 
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/94a55d90d1df431f4024cdef80e0a1e6%40ip-172-31-22-54.us-west-1.compute.internal.
For more options, visit https://groups.google.com/d/optout.


Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread Derek
Not sure I fully understand what you mean by ("How to split this file in
smaller files with 1 method per file") , but if you really want to fragment
your code base, then you could do something like this:


file1.py

def do_stuff(**kwargs):
# process the data passed via kwargs


file2.py

def do_more_stuff(**kwargs):
# process the data passed via kwargs


file3.py

from file1 import do_stuff
from file2 import do_more_stuff

class Short(object):

def __init__(self, *args, **kwargs):
# process the data passed via args & kwargs

def method1(self)
do_stuff(a=1, b=2)

def method2(self)
do_more_stuff(c=1, d=2)


So one function per file, and then the methods of your class are really
short because they call on these external functions to do all the work.

However, I really don't think your code is more readable or maintainable if
you do this.  YMMV.

Derek





On Sat, 14 Jul 2018 at 16:59, Mickael Barbo  wrote:

> Hi Anthony 
>
> Thanks for sharing your experience.
>
> "1 file one object doesn't mean what you think it means."
>
> I hope you get the meaning I described 
>
> "it normally means (for instance) defining one class (and ALL of it's
> methods' in one file) - not importing methods into class definitions - I
> have never seen anyone suggest that."
>
> A method is a function ? a function an object ? right ?
>
> My purpose is that *I prefer working on several "small" files containing
> 1 small function/object* and *NOT* *dealing with a "big" file* containing
> all methods of class (for example). It's straightforward to find what I
> look for.
>
> Mixins and inheritance don't really help here - unless you are reusing the
> same method in multiple classes - in which case you might have a mixin, or
> an inheritance situation.
> Agree 
>
> If you have one or more methods that provide a useful extra behavior to
> one or many classes (say that you have a set of methods that provide extra
> formatting on some fields, then that would be a mixin
> Ok
>
> If you can identify one of your classes being an extension to another in
> some way - so for instance you have a model for Customers, and you have a
> model for your Gold Customers then you might well have an inheritance
> situation - anywhere you can say Model A is a type of Model B that is
> inheritance: Gold Customers are a type of Customer.
> Ok
>
> So, for you, *if you would reduce the size of files you are working on,
> how would you do that ?*
>
> For example, let's say you have a Customer class with 15 methods and the
> file is about 1000 lines of code.
> How to split this file in smaller files with 1 method per file ?
>
>
> Thanks for your help Anthony, hoping to be as clear as possible.
> Regards
>
>
> 2018-07-14 10:56 GMT+02:00 Anthony Flury :
>
>> On 13/07/18 12:44, Mickael Barbo wrote:
>>
>>> Hi !
>>> *
>>> I like working with " 1 file - 1 object " (Object could be class,
>>> function...).*
>>> It simplify visibility, debug etc... and it's easy for me to *don't
>>> pollute my brain* :-)
>>>
>>>
>> 1 file one object doesn't mean what you think it means.
>>
>> it normally means (for instance) defining one class (and ALL of it's
>> methods' in one file) - not importing methods into class definitions - I
>> have never seen anyone suggest that.
>>
>> Mixins and inheritance don't really help here - unless you are reusing
>> the same method in multiple classes - in which case you might have a mixin,
>> or an inheritance situation.
>>
>> If you have one or more methods that provide a useful extra behavior to
>> one or many classes (say that you have a set of methods that provide extra
>> formatting on some fields, then that would be a mixin
>>
>> If you can identify one of your classes being an extension to another in
>> some way - so for instance you have a model for Customers, and you have a
>> model for your Gold Customers then you might well have an inheritance
>> situation - anywhere you can say Model A is a type of Model B that is
>> inheritance: Gold Customers are a type of Customer.
>>
>>
>>> For exemple, I do :
>>>
>>>
>>> In *class_.py file* :
>>>
>>> |
>>> class():
>>> a
>>> b
>>> c
>>>
>>> from.|_method1|importmethod1
>>> from.|_method2| importmethod2
>>> |
>>>
>>>
>>>
>>> and in |*_method1.py file* :
>>> |
>>> |
>>> |
>>> |
>>> |
>>> def|method1(self):
>>> |
>>> "my code"
>>> |
>>> |
>>> |
>>> |
>>> |
>>> |
>>> |
>>> |
>>> |
>>> |
>>> *|It works great, but is there a better way to do that ? is there a
>>> solution to do that "automatically" ?|*
>>> *|
>>> |*
>>> *|
>>> |*
>>>
>>> *||*
>>> |I read lots of thinks about mixin, heritage, etc... but is there a
>>> better way to split code to get a better granularity ?|
>>> |
>>> |
>>>
>>> ||
>>> |Thanks for sharing your point ;-)|
>>> ||*||*
>>>
>>>
>>> --
>>> 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, 

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread Mickael Barbo
Hi Anthony 

Thanks for sharing your experience.

"1 file one object doesn't mean what you think it means."

I hope you get the meaning I described 

"it normally means (for instance) defining one class (and ALL of it's
methods' in one file) - not importing methods into class definitions - I
have never seen anyone suggest that."

A method is a function ? a function an object ? right ?

My purpose is that *I prefer working on several "small" files containing 1
small function/object* and *NOT* *dealing with a "big" file* containing all
methods of class (for example). It's straightforward to find what I look
for.

Mixins and inheritance don't really help here - unless you are reusing the
same method in multiple classes - in which case you might have a mixin, or
an inheritance situation.
Agree 

If you have one or more methods that provide a useful extra behavior to one
or many classes (say that you have a set of methods that provide extra
formatting on some fields, then that would be a mixin
Ok

If you can identify one of your classes being an extension to another in
some way - so for instance you have a model for Customers, and you have a
model for your Gold Customers then you might well have an inheritance
situation - anywhere you can say Model A is a type of Model B that is
inheritance: Gold Customers are a type of Customer.
Ok

So, for you, *if you would reduce the size of files you are working on, how
would you do that ?*

For example, let's say you have a Customer class with 15 methods and the
file is about 1000 lines of code.
How to split this file in smaller files with 1 method per file ?


Thanks for your help Anthony, hoping to be as clear as possible.
Regards


2018-07-14 10:56 GMT+02:00 Anthony Flury :

> On 13/07/18 12:44, Mickael Barbo wrote:
>
>> Hi !
>> *
>> I like working with " 1 file - 1 object " (Object could be class,
>> function...).*
>> It simplify visibility, debug etc... and it's easy for me to *don't
>> pollute my brain* :-)
>>
>>
> 1 file one object doesn't mean what you think it means.
>
> it normally means (for instance) defining one class (and ALL of it's
> methods' in one file) - not importing methods into class definitions - I
> have never seen anyone suggest that.
>
> Mixins and inheritance don't really help here - unless you are reusing the
> same method in multiple classes - in which case you might have a mixin, or
> an inheritance situation.
>
> If you have one or more methods that provide a useful extra behavior to
> one or many classes (say that you have a set of methods that provide extra
> formatting on some fields, then that would be a mixin
>
> If you can identify one of your classes being an extension to another in
> some way - so for instance you have a model for Customers, and you have a
> model for your Gold Customers then you might well have an inheritance
> situation - anywhere you can say Model A is a type of Model B that is
> inheritance: Gold Customers are a type of Customer.
>
>
>> For exemple, I do :
>>
>>
>> In *class_.py file* :
>>
>> |
>> class():
>> a
>> b
>> c
>>
>> from.|_method1|importmethod1
>> from.|_method2| importmethod2
>> |
>>
>>
>>
>> and in |*_method1.py file* :
>> |
>> |
>> |
>> |
>> |
>> def|method1(self):
>> |
>> "my code"
>> |
>> |
>> |
>> |
>> |
>> |
>> |
>> |
>> |
>> |
>> *|It works great, but is there a better way to do that ? is there a
>> solution to do that "automatically" ?|*
>> *|
>> |*
>> *|
>> |*
>>
>> *||*
>> |I read lots of thinks about mixin, heritage, etc... but is there a
>> better way to split code to get a better granularity ?|
>> |
>> |
>>
>> ||
>> |Thanks for sharing your point ;-)|
>> ||*||*
>>
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAPLHwtyEAuCs1UcvLTzt1sXL7jpCQH%3DD_
>> TGBgwiqbq7svc%3DNaQ%40mail.gmail.com > sgid/django-users/CAPLHwtyEAuCs1UcvLTzt1sXL7jpCQH%3DD_
>> TGBgwiqbq7svc%3DNaQ%40mail.gmail.com?utm_medium=email_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> --
> Anthony Flury
> email : *anthony.fl...@btinternet.com*
> Twitter : *@TonyFlury *
>
>

-- 
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 

[django-channels client wrapper] specifying no reconnection attempts

2018-07-14 Thread bit bouncer
Basically, I don't want the websocket to automatically attempt 
reconnections after it has been closed by the server.

I've tried
new WebSocketBridge({maxReconnectAttempts: 1})

and 
const socket = new WebSocketBridge({maxReconnectAttempts: 1})

socket.connect('/ws/', undefined, {maxReconnectAttempts: 1})

but to no avail. 

Am I doing something wrong? 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 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/e4471747-3133-49b7-b98d-cf7ecb64c1db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get and process Input for django-multiselectfield in Django rest framework

2018-07-14 Thread jagruti . mscit16
I have attched the issue related ss also


weekday = MultiSelectField(
choices=WEEK_DAYS_CHOICES, max_length=10, default=True)

WEEK_DAYS_CHOICES = (
('Monday', 'Monday'),
('Tuesday', 'Tuesday'),
('Wednesday', 'Wednesday'),
('Thuersday', 'Thuersday'),
('Friday', 'Friday'),
('Saturday', 'Saturday'),
('Sunday', 'Sunday'),
)


-- 
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/28fc496d-6368-4864-af8c-0b142fb59e16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get and process Input for django-multiselectfield in Django rest framework via form-data

2018-07-14 Thread jagruti . mscit16
WEEK_DAYS_CHOICES = (
('Monday', 'Monday'),
('Tuesday', 'Tuesday'),
('Wednesday', 'Wednesday'),
('Thuersday', 'Thuersday'),
('Friday', 'Friday'),
('Saturday', 'Saturday'),
('Sunday', 'Sunday'),
)

weekday = MultiSelectField(
choices=WEEK_DAYS_CHOICES, max_length=10, default=True)

-- 
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/f7be38d6-1631-4f19-a9f0-5790a3fdfb4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is MySQL syntax for a table changed if I had a ManyToManyField?

2018-07-14 Thread Gerald Brown
When looking at my database it has the 3rd table for the ManyToMany with 
the following:


1. ID auto-generated,

2. Table1.ID

3. Table2.ID.

All fields will be integers.

The 3rd table will be named Table1_Table2 or something like that.

I noticed in your code below that you do not have an ID field on any 
table.  I believe this is required for M2M tables.  Django 
makemigrations & migrate will generate this for you if not defined in 
the model.  Django will also create the third table for you with 
makemigrations/migrate so no need to create it by hand.


What were the problems you were having with makemigrations/migrate?  It 
is supposed to create the tables for all apps in your project but you 
can also specify only 1 app if you want to.


Hope this helps.


On Saturday, 14 July, 2018 07:05 PM, mottaz hejaze wrote:
for many to many relationships between two tables .. you can make a 
third table that only contains the id fields ftom both tables , then 
you can make a third model for this table.


On Fri, 13 Jul 2018, 22:24 , > wrote:


I tried for hours to get django's migrate/makemigrations function
work but miserably couldn't so I created my tables in MySQL. Now
I'm trying to add a ManyToManyField between 2 models but am not
sure how the MySQL syntax is supposed to look like.

This is my current code:

from django.db import models

class Publication(models.Model):
title = models.CharField(max_length=30)

class Article(models.Model):
headline = models.CharField(max_length=100)

and I can create a table as follows in MySQL:

CREATE TABLE publication (
    title varchar(30)
);
CREATE TABLE Article (
    headline varchar(100),
);

I need to add the ManyToManyField like so:
class Article(models.Model):
    headline = models.CharField(max_length=100)
/publications = models.ManyToManyField(Publication)/

I'm really running low on time, could someone assist me with what
the MySQL code is supposed to look like? I will be permanently in
your debt.
-- 
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/6f546243-23f0-4760-806b-9fff01d2afd7%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/CAHV4E-eGQQ3jdwSaa9d9xaxk7rV_Tt-Fqas3OTuhYEYd1%3D8zMA%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/1cc82de7-c0af-527f-93f8-2740c46a9001%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is MySQL syntax for a table changed if I had a ManyToManyField?

2018-07-14 Thread mottaz hejaze
for many to many relationships between two tables .. you can make a third
table that only contains the id fields ftom both tables , then you can make
a third model for this table

On Fri, 13 Jul 2018, 22:24 ,  wrote:

> I tried for hours to get django's migrate/makemigrations function work but
> miserably couldn't so I created my tables in MySQL. Now I'm trying to add a
> ManyToManyField between 2 models but am not sure how the MySQL syntax is
> supposed to look like.
>
> This is my current code:
>
> from django.db import models
>
> class Publication(models.Model):
> title = models.CharField(max_length=30)
>
> class Article(models.Model):
> headline = models.CharField(max_length=100)
>
> and I can create a table as follows in MySQL:
>
> CREATE TABLE publication (
> title varchar(30)
> );
> CREATE TABLE Article (
> headline varchar(100),
> );
>
> I need to add the ManyToManyField like so:
> class Article(models.Model):
> headline = models.CharField(max_length=100)
> *publications = models.ManyToManyField(Publication)*
>
> I'm really running low on time, could someone assist me with what the
> MySQL code is supposed to look like? I will be permanently in your debt.
>
> --
> 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/6f546243-23f0-4760-806b-9fff01d2afd7%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/CAHV4E-eGQQ3jdwSaa9d9xaxk7rV_Tt-Fqas3OTuhYEYd1%3D8zMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't see my models in MySQL db

2018-07-14 Thread ali reza
Hi all,

I attached my Django project as a ZIP file. 
please help me to find and fix the root cause of issue.
Link:
https://ufile.io/ycmut

Thanks in advance

On Wednesday, 4 July 2018 17:50:49 UTC+4:30, ali reza wrote:
>
> Greetings!
>
> *Note:*
> mysite is the name of project.
> django_sb_admin and polls are my apps.
> python version: 3.6.6
>
> I used *inspectdb* for creating *models.py* for *django_sb_admin* 
> application.
> *pyhton3 manage.py inspectdb > models.py*
> # Here inspectdb worked fine.
> then is moved models.py into django_sb_admin app.
>
>
>
> *root@kali:~/PycharmProjects/django/azim_projs# ls*
> db.sqlite3  django_sb_admin  manage.py   mysite  polls
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# cat 
> django_sb_admin/apps.py *
> from django.apps import AppConfig
>
> class DjangoSbAdminConfig(AppConfig):
> name = 'django_sb_admin'
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# cat mysite/settings.py *
> <...skipped.>
> <...skipped.>
> <...skipped.>
>
> INSTALLED_APPS = [
> 'django_sb_admin.apps.DjangoSbAdminConfig',
> 'polls',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> <...skipped.>
> <...skipped.>
> <...skipped.>
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'OPTIONS': {
> 'read_default_file': 
> '/root/PycharmProjects/django/azim_projs/mysite/mySQL.conf',
> },
>   }
> }
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# cat mysite/mySQL.conf *
> [client]
> database = djangoDB
> host = 127.0.0.1
> user = root
> password = "456789"
>
>
> =
>
> =
>
> =
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# python3 manage.py 
> makemigrations django_sb_admin*
> No changes detected in app 'django_sb_admin'
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# python3 manage.py migrate 
> django_sb_admin*
> Operations to perform:
>   Apply all migrations: django_sb_admin
> Running migrations:
>   Applying django_sb_admin.0001_initial... OK
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# python3 manage.py migrate*
> Operations to perform:
>   Apply all migrations: admin, auth, contenttypes, django_sb_admin, 
> sessions
> Running migrations:
>   Applying contenttypes.0001_initial... OK
>   Applying auth.0001_initial... OK
>   Applying admin.0001_initial... OK
>   Applying admin.0002_logentry_remove_auto_add... OK
>   Applying contenttypes.0002_remove_content_type_name... OK
>   Applying auth.0002_alter_permission_name_max_length... OK
>   Applying auth.0003_alter_user_email_max_length... OK
>   Applying auth.0004_alter_user_username_opts... OK
>   Applying auth.0005_alter_user_last_login_null... OK
>   Applying auth.0006_require_contenttypes_0002... OK
>   Applying auth.0007_alter_validators_add_error_messages... OK
>   Applying auth.0008_alter_user_username_max_length... OK
>   Applying auth.0009_alter_user_last_name_max_length... OK
>   Applying sessions.0001_initial... OK
>
>
> =
> *root@kali:~/PycharmProjects/django/azim_projs# python3 manage.py 
> sqlmigrate django_sb_admin 0001*
> BEGIN;
> --
> -- Create model Appp
> --
> --
> -- Create model ApTT
> --
> --
> -- Create model CCnn
> --
> --
> -- Create model CCtt
> --
> --
> -- Create model Lact
> --
> -- Create model Lapt
> --
> --
> -- Create model Laccte
> --
> --
> -- Create model Urmng
> --
> COMMIT;
>
>
> =
> *Note:* see attached picture, I haven't my models as tables in *djangoDB* 
> database.
>
> What's the problem !?
> Why I haven't tables in DB !??!
>
>
>

-- 
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 

Re: Beginner

2018-07-14 Thread 'Anthony Flury' via Django users

On 12/07/18 10:28, Harsh Rawat wrote:
So basically I need to write the documentation regarding what should 
be the apt name for the feature and what packages come installed with 
django initially .


I think the bug report suggests discussing possible options regarding 
new names and packages collections with the python developers.


Documentation of the existing feature sets would be useful too.




On Thu, Jul 12, 2018, 11:41 AM Harsh Rawat > wrote:


Thanks a lot .

On Thu, Jul 12, 2018, 3:11 AM 'Anthony Flury' via Django users
mailto:django-users@googlegroups.com>> wrote:

On 10/07/18 14:06, Harsh Rawat wrote:
> Identifying a useful name means ?
>
Let's say you have identified a great group of packages which
you can
install and provides Django friendly Shopping cart.

It would be better for that group of packages to be installed by :

     pip install Django['shopping-cart']

rather than say :

     pip install Django[anthony]


while 'anthony' is a perfectly fine name (my parents
definitely liked
it), it isn't particularly useful in this case; if you saw
that in an
installation script you would wonder why Django was being
installed
using that option, but 'shopping-cart' is at least helpful in
terms for
describing the functionality you might get.



> --
> 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/785cb34c-4099-4213-9aef-2c81a5a21ef7%40googlegroups.com

>

.
> For more options, visit https://groups.google.com/d/optout.


-- 
-- 
Anthony Flury

email : *anthony.fl...@btinternet.com
*
Twitter : *@TonyFlury *

-- 
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/11a73dce-a6ad-e16e-eec4-8551f088ee54%40btinternet.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/CALd6sVMQr7M9_UuZM28c9McObDiSUv51hugk816KncHxvt6Q_A%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
--
Anthony Flury
email : *anthony.fl...@btinternet.com*
Twitter : *@TonyFlury *

--
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 

Re: Static images are working but static CSS is not working SS attached

2018-07-14 Thread Param Saini



I just started working on python so copying settings.py file contents below 
: 
and regarding production and development server i have no idea ... i just 
run it on my Laptop by using python manage.py runserver command 

Settings.py file :
"""
Django settings for firstproject project.

Generated by 'django-admin startproject' using Django 2.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR=os.path.join(BASE_DIR,"templates")
STATIC_DIR=os.path.join(BASE_DIR,"static")

#print(TEMPLATE_DIR)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@8bm15dgxr#74ao@8i$5p=@7rk(^2%vtcehl*(8#ltz$46g*^v'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'first_app'
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'firstproject.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',

],
},
},
]

WSGI_APPLICATION = 'firstproject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# 
https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT=''
STATICFILES_DIRS = [
STATIC_DIR,
]


wsgi.py
"""
WSGI config for firstproject project.

It exposes the WSGI callable as a module-level variable named 
``application``.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "firstproject.settings")

application = get_wsgi_application()


On Friday, 13 July 2018 22:16:36 UTC+5:30, Kasper Laudrup wrote:
>
> Hi Param, 
>
> On 2018-07-13 16:29, Param Saini wrote: 
> > Static Images are working perfectly in Django .. but when i try to use 
> > static CSS or evev open Django admin panel . CSS is not implemented 
> there 
> > 
>
> Are you running the development server or is this in production? 
>
> If it is in production, have you set up your web server to serve the 
> static files correctly, added the necessary settings to settings.py and 
> run the 'collectstatic' command? 
>
> There's quite a lot of documentation on how to server static files in 
> production out there. A simple google search should give you tons of hits. 
>
> If you need more help, please post your web server configuration as well 
> as your settings.py file. 
>
> 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