Re: Django deployement Apache

2017-08-26 Thread Vernon Swanepoel
Hello Sarfaraz,

A couple things you could look at:

   1. Are you including both your site-packages (eg 
   python3.6/lib/site-packages) and your django project root (where you 
   actually built the project) in your WSGIPythonPath?  String them together 
   with a clone 
   (/path/to/python3.6/lib/site-packages:/path/to/django/project/myproject)
   2. Your wsgi is within your django app 
   (/path/to/django/project/myproject/myproject/wsgi...).  It sits in the same 
   file as your settings.py.  Make sure it's pointing to the right place, 
   because in your examples above your directory for django and your directory 
   for the wsgi don't match.
   3. Have you set execute permissions all the way down the django app 
   (using chmod +x /all/the/way/up/the/django/project/to/wsgi.py)

Deploying the first time is a frustrating process, and it's hard to get 
specific help because nobody knows exactly what you've got running, but if 
you stick with it, you'll get it working.

Regards,
Vernon

On Saturday, 26 August 2017 21:31:34 UTC+1, sarfaraz ahmed wrote:
>
> Hey Team,
>
> Please someone help.
> I am still getting error
>
> * ImportError: No module named django.core.wsgi*mentioned below is my 
> latest vhost file in ubuntu. 
>
> 
> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
> ServerName firstweb.com
>
> ServerAlias www.firstweb.com
> 
> 
> Require all granted
> 
> 
> CustomLog /var/log/apache2/firstweb-access.log combined
> ErrorLog /var/log/apache2/firstweb-error.log
> 
>
> Earlier I missed WSGIScriptAlias argument.
>
> Regards,
> Sarfaraz Ahmed
>
>
>
> On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>>
>> Hello Friends,
>>
>> Please help me with this. 
>>
>> I am new to linux and I am attempting to deploy my trial app on AWS 
>> ubuntu server.
>>
>> my vhost file looks like this 
>> 
>> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>>
>> WSGIPythonPath /var/www/firstweb
>> ServerName firstweb.com
>>
>> ServerAlias www.firstweb.com
>> 
>> 
>> Require all granted
>> 
>> 
>> 
>>
>> now when I add WSGIPythonPath.. my apache fails to restart. 
>>
>> If I remove that that I get following error when I try to access this 
>> from my computer. 
>> ImportError: No module named django.core.wsgi
>>
>> Now, I searched on the web and found following link
>> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>>  
>> which has some solution which I am not able to understand so far.
>>
>> after wasting my time in attempting to deploy on windows server. everyone 
>> suggested me to deploy on linux.
>>
>> I M NOT USING virualenv. 
>>
>> Thanks in advance. 
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>>
>>
>>
>>

-- 
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/881927b4-dd3a-4ac5-a249-b13db46d6dd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Django Blog

2017-08-26 Thread Vernon Swanepoel
Hello Zayden,

I don't often comment here, but I've build a number of blog type apps, and 
I'm currently looking at building a blog for a Python society in my area, 
so it's something I've been thinking about.

Clearly, there are other options other than Django if your goal is to set 
up a blog easily, as Gerardo mentioned.  So, I assume you do want to dig 
into Django itself.  I'm not sure why you say the Quora page isn't helpful 
- one of the answers there refers to the Djangogirls tutorial 
, which I've heard is one of the 
easiest, and would certainly help get you started.

So, here is my recommendation:
1.  You need to understand basic Django.  The tutorial in the documentation 
 is really, really 
fantastic.  While you don't build a blog in the tutorial, many of the 
concepts you need to master to do so (urls, views, models and forms) are 
all in there.
2.  Build up a basic, minimum feature blog app, without all the bells and 
whistles - you probably want A) a list page that is the home page of your 
blog where you show the first few blog posts (let's say, 5 posts).  B) a 
detailed page - a page for each blog post C) archive pages for older posts, 
D) depending on your URL structure, a list page by year or month, or even 
day if you have a popular, active blog.  I have an old version of my blog 
on github you 
can look at (it might not be the best, it's old and I've learned a lot 
since then, but looking through it should give you a good starting point). 
 To start with, just use the django admin for posting blog posts - later on 
you can roll your own or clone one of many others and adapt to your needs. 
 One of the topics you really need to master at this point is model 
queries.  I recommend building models and then just playing around in the 
django shell (python manage.py shell) with the model objects.  Here are the 
docs 
for the models .
3.  If you want to role your own comment system, then next thing you'll 
need to master are the forms 
(including ModelForms).
4. To start having different authors, you'll need to dig into the User 
authentication system .
5. If you want to have your own 'admin' to post from, you'll need some good 
front end skills to implement text editing things (i.e. making text bold) 
using Javascript.  

Basically, with a good understanding of the basics (urls, views, models, 
templates, forms, authentication) it's only up to your creativity from 
there how to implement the rest.  Django's approach is very modular, and so 
I recommend a modular approach to building this up - go step by step, 
adding complexity only after you have the first bit working well.  If you 
take this approach, and learn the bits well, building things with Django 
becomes remarkably simple.

I would highly recommend looking into class based views 
.  They 
have a reputation for being a bit hard to grasp, but I don't think they're 
hard at all if you have the basic concepts down.  And it allows you to use 
inheritance to avoid huge, over complex views.

If you're a developer, I would imagine you do this already, but when I 
build things, I spend a lot of time poking around people's github repos and 
just getting ideas, and then implementing my version of it.  For some 
things you may want to set up a dummy project, clone the repo, and run it 
and play with it so you see how they made it work, even if you're going to 
implement your own.

And, finally, look into testing 
 - if you're 
building something that's going to be growing in complexity, taking a TTD 
approach is going to save you a lot of headaches in the long run.  A fun 
book to work through is "Test-driven development with Django 
", aka, 'Obey The Testing Goat'.

Cheers,
Vernon

On Saturday, 26 August 2017 22:27:52 UTC+1, Zayden Rosario wrote:
>
> Currently, I am a beginner who hardly knows how to create a post, I want 
> to know what are the requirements to create a fully featured blog (Ex: 
> supports edits from multiple users, post can have multiple tags, create my 
> own administration page ..etc)
>
> please keep in mind that I know these resources and* they aren't that 
> helpful*
>
> https://www.youtube.com/playlist?list=PLEsfXFp6DpzQB82YbmKKBy2jKdzpZKczn
> https://www.quora.com/How-do-I-create-a-blog-using-Django
>
> It will be really helpful if the resources are from the Django official 
> documentation.
>
> Thanks,
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving 

Re: Python and Django traing

2017-08-26 Thread Mark Phillips
correction - https://www.obeythetestinggoat.com/

On Sat, Aug 26, 2017 at 5:55 PM, Gerardo Palazuelos Guerrero <
gerardo.palazue...@gmail.com> wrote:

> Hi,
> I'm on the same situation, still learning.
>
> Besides the ones mentioned (I specially liked a lot the DjangoGirls
> tutorial), there quite few others where you can continue your progress.
>
> Let me suggest you to visit the twoscoopofdjango (I hopes name is correct)
> site, then navigate to Resources page. You will find an interesting list
> where some free tutorials are mentioned.
>
> Also in Udemy, check for free tutorials from Justin Mitchell. He have free
> Django courses, it's fantastic.
>
> After doing those, my personal current Django stage is reading the Harry
> Percival's new book --- check is website: obeythetestinggoat.com.
>
> (Note: I have nothing particular nor relation with mentioned sites or
> persons).
>
> I hopes that helps.
> Gerardo.
>
>
>
>
> El 26/08/2017, a las 15:54, Jani Tiainen  escribió:
>
> Hi.
>
> I would suggest to take a look at official tutorial.
>
> Django Girls does have very good tutorial.
>
> 27.8.2017 0.27 "AFSungo"  kirjoitti:
>
>> Hi,
>>
>> I am beginner and want know:
>>
>> Where can I find an online and remote class to learn Django??
>>
>>
>> --
>> 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/ms
>> gid/django-users/0a0f6385-33b1-4d11-b8c7-c2db089cdbb5%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/CAHn91oc%2BzPJPScW1_HEY4_zeTWVBievzLjywwwzah3x7nOAfNA%
> 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/EC21D8BB-2398-4489-B661-3911D25DD5DA%40gmail.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/CAEqej2PkYWaGt6r8RxiuPQNJYCWtvc5g%3D7-cTH-Fz%2BvFLTbenA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python and Django traing

2017-08-26 Thread Gerardo Palazuelos Guerrero
Hi,
I'm on the same situation, still learning.

Besides the ones mentioned (I specially liked a lot the DjangoGirls tutorial), 
there quite few others where you can continue your progress.

Let me suggest you to visit the twoscoopofdjango (I hopes name is correct) 
site, then navigate to Resources page. You will find an interesting list where 
some free tutorials are mentioned.

Also in Udemy, check for free tutorials from Justin Mitchell. He have free 
Django courses, it's fantastic.

After doing those, my personal current Django stage is reading the Harry 
Percival's new book --- check is website: obeythetestinggoat.com.

(Note: I have nothing particular nor relation with mentioned sites or persons).

I hopes that helps.
Gerardo.




> El 26/08/2017, a las 15:54, Jani Tiainen  escribió:
> 
> Hi.
> 
> I would suggest to take a look at official tutorial.
> 
> Django Girls does have very good tutorial.
> 
> 27.8.2017 0.27 "AFSungo"  kirjoitti:
>> Hi,
>> 
>> I am beginner and want know:
>> 
>> Where can I find an online and remote class to learn Django??
>> 
>> 
>> -- 
>> 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/0a0f6385-33b1-4d11-b8c7-c2db089cdbb5%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/CAHn91oc%2BzPJPScW1_HEY4_zeTWVBievzLjywwwzah3x7nOAfNA%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/EC21D8BB-2398-4489-B661-3911D25DD5DA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Django Blog

2017-08-26 Thread Gerardo Palazuelos Guerrero
Hi Zayden,
I don't have an answer for your question. But seems you need a definition and 
conceptual idea of what a blog should be.

If that is the case, maybe you want to check what the Wordpress Post features 
are or buddy press features.

The are quite few systems providing those features.

Regards.

---
Gerardo Palazuelos
Enviado desde mi iPhone


> El 26/08/2017, a las 14:37, Zayden Rosario  escribió:
> 
> Currently, I am a beginner who hardly knows how to create a post, I want to 
> know what are the requirements to create a fully featured blog (Ex: supports 
> edits from multiple users, post can have multiple tags, create my own 
> administration page ..etc)
> 
> please keep in mind that I know these resources and they aren't that helpful
> 
> https://www.youtube.com/playlist?list=PLEsfXFp6DpzQB82YbmKKBy2jKdzpZKczn
> https://www.quora.com/How-do-I-create-a-blog-using-Django
> 
> It will be really helpful if the resources are from the Django official 
> documentation.
> 
> 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/30f3ee53-8066-4c14-9b4f-956e8d54f5bf%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/5EDEE4E4-7A7B-42CC-9613-F2D47ADE9489%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python and Django traing

2017-08-26 Thread Jani Tiainen
Hi.

I would suggest to take a look at official tutorial.

Django Girls does have very good tutorial.

27.8.2017 0.27 "AFSungo"  kirjoitti:

> Hi,
>
> I am beginner and want know:
>
> Where can I find an online and remote class to learn Django??
>
>
> --
> 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/0a0f6385-33b1-4d11-b8c7-c2db089cdbb5%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/CAHn91oc%2BzPJPScW1_HEY4_zeTWVBievzLjywwwzah3x7nOAfNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python and Django traing

2017-08-26 Thread yingi keme
Check google and download this pdf

"Definitive Guide to Django". 

But hope you are good in python language?

Yingi Kem

> On 26 Aug 2017, at 10:25 PM, AFSungo  wrote:
> 
> Hi,
> 
> I am beginner and want know:
> 
> Where can I find an online and remote class to learn Django??
> 
> 
> -- 
> 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/0a0f6385-33b1-4d11-b8c7-c2db089cdbb5%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/5B5B3A40-CAA3-471F-BDEB-D41A8CBC00DE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Build Django Blog

2017-08-26 Thread Zayden Rosario
Currently, I am a beginner who hardly knows how to create a post, I want to 
know what are the requirements to create a fully featured blog (Ex: 
supports edits from multiple users, post can have multiple tags, create my 
own administration page ..etc)

please keep in mind that I know these resources and* they aren't that 
helpful*

https://www.youtube.com/playlist?list=PLEsfXFp6DpzQB82YbmKKBy2jKdzpZKczn
https://www.quora.com/How-do-I-create-a-blog-using-Django

It will be really helpful if the resources are from the Django official 
documentation.

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/30f3ee53-8066-4c14-9b4f-956e8d54f5bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python and Django traing

2017-08-26 Thread AFSungo
Hi,

I am beginner and want know:

Where can I find an online and remote class to learn Django??


-- 
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/0a0f6385-33b1-4d11-b8c7-c2db089cdbb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django deployement Apache

2017-08-26 Thread sarfaraz ahmed
Hey Team,

Please someone help.
I am still getting error

* ImportError: No module named django.core.wsgi*mentioned below is my 
latest vhost file in ubuntu. 


WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
ServerName firstweb.com

ServerAlias www.firstweb.com


Require all granted


CustomLog /var/log/apache2/firstweb-access.log combined
ErrorLog /var/log/apache2/firstweb-error.log


Earlier I missed WSGIScriptAlias argument.

Regards,
Sarfaraz Ahmed



On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Friends,
>
> Please help me with this. 
>
> I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
> server.
>
> my vhost file looks like this 
> 
> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>
> WSGIPythonPath /var/www/firstweb
> ServerName firstweb.com
>
> ServerAlias www.firstweb.com
> 
> 
> Require all granted
> 
> 
> 
>
> now when I add WSGIPythonPath.. my apache fails to restart. 
>
> If I remove that that I get following error when I try to access this from 
> my computer. 
> ImportError: No module named django.core.wsgi
>
> Now, I searched on the web and found following link
> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>  
> which has some solution which I am not able to understand so far.
>
> after wasting my time in attempting to deploy on windows server. everyone 
> suggested me to deploy on linux.
>
> I M NOT USING virualenv. 
>
> Thanks in advance. 
>
> Regards,
> Sarfaraz Ahmed
>
>
>
>
>

-- 
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/94766b53-7500-4b9a-9a82-fc99f5af3e8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to implement a more complex user registration/auth flow?

2017-08-26 Thread Eduardo Balbinot
You could do like this: when the user signs in you create the user in the 
database and flags is_active as False, so the user won't be able to log in. In 
your extended User model you could have another flag like has_confirmed_email 
which you also set to False. When the user confirms the email you set 
has_confirmed_email to True so you can have a page that shows the admin which 
users are not active but have confirmed their email addresses. Finally, the 
admin confirms a user which means in the background you set is_active to True 
and then the user is able to log in to your system.

-- 
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/75c0bc0f-d265-4e0d-bf16-a1af60534259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to implement a more complex user registration/auth flow?

2017-08-26 Thread Eduardo Balbinot
You could do like this: when the user signs in you create the user in the 
database and flags is_active as False, so the user won't be able to log in. In 
your extended User model you could haverá 

-- 
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/501f722a-5953-4fba-b1e7-bf936b0db008%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django deployement Apache

2017-08-26 Thread sarfaraz ahmed

i have made following changes in my vhost conf file and now services run. 
Also, I don't see any error. But instead of default django page I get 
default apache page.

Here is my new conf file.
-

ServerName firstweb.com
ServerAlias www.firstweb.com


Require all granted





--

I checked for error. I don't see any error. 

Please help


On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Friends,
>
> Please help me with this. 
>
> I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
> server.
>
> my vhost file looks like this 
> 
> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>
> WSGIPythonPath /var/www/firstweb
> ServerName firstweb.com
>
> ServerAlias www.firstweb.com
> 
> 
> Require all granted
> 
> 
> 
>
> now when I add WSGIPythonPath.. my apache fails to restart. 
>
> If I remove that that I get following error when I try to access this from 
> my computer. 
> ImportError: No module named django.core.wsgi
>
> Now, I searched on the web and found following link
> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>  
> which has some solution which I am not able to understand so far.
>
> after wasting my time in attempting to deploy on windows server. everyone 
> suggested me to deploy on linux.
>
> I M NOT USING virualenv. 
>
> Thanks in advance. 
>
> Regards,
> Sarfaraz Ahmed
>
>
>
>
>

-- 
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/cecafa96-463b-4314-97ce-581ef0e89d82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Polls tutorial suggested mysite/mysite/urls.py improvement

2017-08-26 Thread Derek
Mike

Not sure what your github skill level is; but have you considered making a 
clone of the docs (https://github.com/django/django/blob/master/docs/), 
changing that page 
(https://github.com/django/django/blob/master/docs/intro/tutorial01.txt) 
and then submitting your changes as a new pull request?

I may be speaking out of turn, as I am not a maintainer; but I am sure if 
you add the above explanation to your submission it will be favorably 
considered.

Derek

On Saturday, 26 August 2017 09:51:51 UTC+2, Mike Dewhirst wrote:
>
> A potential new Django user (a programmer of many decades experience) 
> tried Django at my suggestion and struck a problem. Eventually he 
> tracked me down and challenged me to prove the problem. 
>
> I found the problem and feel that the Polls tutorial docs can be easily 
> improved. 
>
> https://docs.djangoproject.com/en/1.11/intro/tutorial01/ 
>
> In the "Write your first view" section it says ... 
>
> The next step is to point the root URLconf at the |polls.urls| module. 
> In |mysite/urls.py|, add an import for |django.conf.urls.include| and 
> insert an |include()| 
>  
>
> in the |urlpatterns| list, so you have: 
>
> mysite/urls.py 
>
> from  django.conf.urls  import  include,  url from django.contrib  
> import  admin 
>
> urlpatterns  =  [ 
>   url(r'^polls/',  include('polls.urls')), 
>   url(r'^admin/',  admin.site.urls), 
> ] 
>
>
> The problem is we have two mysite dirs. The docs are helpful in 
> suggesting you copy code to paste into urls.py so the focus is on the 
> code rather than where to put it. On not finding a urls.py in the outer 
> mysite dir he created one. 
>
> The suggestion for improving the docs here is to change the heading line 
> above from 
>   mysite/urls.py 
> to 
>   mysite/mysite/urls.py 
>
> Alternatively, make a pointed reference to the earlier section in the 
> page where startproject created the *inner* mysite dir containing the 
> target urls.py. For example, by adding words to the effect that the 
> inner mysite/urls.py file will be instrumental in the "hello world" step 
> later in the tutorial. 
>
> Cheers 
>
> Mike 
>

-- 
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/7ae8d6e4-0760-4441-8a5a-e8bcdd9e0d0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django deployement Apache

2017-08-26 Thread sarfaraz ahmed
Hello Friends,

Please help me with this. 

I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
server.

my vhost file looks like this 

WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py

WSGIPythonPath /var/www/firstweb
ServerName firstweb.com

ServerAlias www.firstweb.com


Require all granted




now when I add WSGIPythonPath.. my apache fails to restart. 

If I remove that that I get following error when I try to access this from 
my computer. 
ImportError: No module named django.core.wsgi

Now, I searched on the web and found following link
https://www.webforefront.com/django/setupapachewebserverwsgi.html
 
which has some solution which I am not able to understand so far.

after wasting my time in attempting to deploy on windows server. everyone 
suggested me to deploy on linux.

I M NOT USING virualenv. 

Thanks in advance. 

Regards,
Sarfaraz Ahmed




-- 
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/e54887bd-2a1e-4a5a-b2e5-2fea53ab9cad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Polls tutorial suggested mysite/mysite/urls.py improvement

2017-08-26 Thread Jim Fuqua
I agree.  Anyone experienced in Django would not be confused.  I have been 
away from Python for over ten years and totally new to Django.  There are a 
number of such issues in the tutorial that got me "off track".   

A useful feature for the total novice would be a link to a folder with 
a correct copy of all "mysite" files at the end of each section.  If the 
novice fails to include a file or made some other simple mistake they could 
get back "on track".  I did not get "off track" on this one but I did on 
several others. They were careless mistakes, but for a novice, the only way 
out is usually to completely start over.

The tutorial says "*When starting your first real project, however, you may 
want to use a more scalable database like PostgreSQL, to avoid 
database-switching headaches down the road.*". That is an invitation to the 
novice to simultaneously take a much more complex path.  A link to some 
basic PostgreSQL issues like how to drop the "mysite" PostgresSQL database 
and start over would be helpful.  With sqlite3 it is easy to 
erase everything and start over.  With Postgres, the changes to the 
database are not so easily undone. I finally figured out how to change the 
"mysite" user and drop the database, but it was not easy. A simple "DROP 
DATABASE "mysite"; does not do the job without changing the database owner 
and killing other users of the database before dropping the database.

Simple UX comments from novices concerning the Tutorial could make the life 
of those who follow much easier.  No expert is a good UX judge of any 
tutorial from the perspective of a novice.

jimfuqua

On Saturday, August 26, 2017 at 2:51:51 AM UTC-5, Mike Dewhirst wrote:
>
> A potential new Django user (a programmer of many decades experience) 
> tried Django at my suggestion and struck a problem. Eventually he 
> tracked me down and challenged me to prove the problem. 
>
> I found the problem and feel that the Polls tutorial docs can be easily 
> improved. 
>
> https://docs.djangoproject.com/en/1.11/intro/tutorial01/ 
>
> In the "Write your first view" section it says ... 
>
> The next step is to point the root URLconf at the |polls.urls| module. 
> In |mysite/urls.py|, add an import for |django.conf.urls.include| and 
> insert an |include()| 
>  
>
> in the |urlpatterns| list, so you have: 
>
> mysite/urls.py 
>
> from  django.conf.urls  import  include,  url from django.contrib  
> import  admin 
>
> urlpatterns  =  [ 
>   url(r'^polls/',  include('polls.urls')), 
>   url(r'^admin/',  admin.site.urls), 
> ] 
>
>
> The problem is we have two mysite dirs. The docs are helpful in 
> suggesting you copy code to paste into urls.py so the focus is on the 
> code rather than where to put it. On not finding a urls.py in the outer 
> mysite dir he created one. 
>
> The suggestion for improving the docs here is to change the heading line 
> above from 
>   mysite/urls.py 
> to 
>   mysite/mysite/urls.py 
>
> Alternatively, make a pointed reference to the earlier section in the 
> page where startproject created the *inner* mysite dir containing the 
> target urls.py. For example, by adding words to the effect that the 
> inner mysite/urls.py file will be instrumental in the "hello world" step 
> later in the tutorial. 
>
> Cheers 
>
> Mike 
>

-- 
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/e613b227-cc88-46ce-927c-d635ac1c51f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is some problem in field options 'null'?

2017-08-26 Thread Jinwen
I read the document 
 
about field options 'null'.

It is said that.

If True, Django will store empty values as NULL in the database. Default is 
> False.
>
> Avoid using null 
> 
>  on 
> string-based fields such as CharField 
> 
>  and TextField 
> .
>  
> If a string-based field has null=True, that means it has two possible 
> values for “no data”: NULL, and the empty string.
>

Then I try make a field have "null=True", just save it to database.

like that.

>>> from backend.models import Scrapyd as S
>>> s = S()
>>> s.comment
>>> type(s.comment)

>>> s.save()
>>> b  = S.objects.all().last()
>>> b

>>> b.comment
>>> type(b.comment)



*What my question is why the value not like the document  
said is 
empty string ''?*

*I am confused.*

-- 
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/1b239340-78d6-4df2-a12d-9531dfe7912d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Best practices on running functional tests against the staging server when data initialization is needed?

2017-08-26 Thread Jad Sayegh
I'm working on writing functional tests for an web application I'm 
building. I'm fairly new to testing and trying to get to grips with best 
practices. The application has a moderate amount of complexity, and I'm 
trying to write a functional test for a process that is part of a bigger 
process. 

*The wider process:*
user does A -> user does B (using the DB data generated from A) -> user 
does C (using the DB data generated from A and B)

*The process I want to test:*
user does B  (using the DB data generated from A) -> generates the data 
required for C

*An example scenario to illustrate:*
Let's use the following example: An app that generates email templates for 
the user 
A : user has registered and entered their personal data
B : user logs in and generates a template email with their name, address in 
the right places
 

When I'm testing on my local PC, I'm using LiveServerTestCase to create the 
DB and run a server I can test against with Selenium, and in the setup of 
my functional test, I create the appropriate initial data using my model 
code.
When I'm testing on staging, I'm using my local PC to interact with the 
up-and-running live server on the staging server, and not the one generated 
using LiveServerTestCase. 

*My questions:*
1) Is it good practice to set up initial data for functional tests using 
model code (given it's supposed to be a black box test)?
2) During the staging test, how would I populate the DB with the required 
data? The only way I can think of now is by using Fabric to launch `python 
manage.py shell` but I feel it might not be the best way





-- 
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/82ca423b-85a0-4023-a810-25cd8f44b026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Add Web Service Reference Django project

2017-08-26 Thread Anar Novruzaliyev
I need to add web reference and use it in my Django project , How I can do 
it or it is possible?

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


Polls tutorial suggested mysite/mysite/urls.py improvement

2017-08-26 Thread Mike Dewhirst
A potential new Django user (a programmer of many decades experience) 
tried Django at my suggestion and struck a problem. Eventually he 
tracked me down and challenged me to prove the problem.


I found the problem and feel that the Polls tutorial docs can be easily 
improved.


https://docs.djangoproject.com/en/1.11/intro/tutorial01/

In the "Write your first view" section it says ...

The next step is to point the root URLconf at the |polls.urls| module.
In |mysite/urls.py|, add an import for |django.conf.urls.include| and 
insert an |include()| 


in the |urlpatterns| list, so you have:

mysite/urls.py

from  django.conf.urls  import  include,  url from django.contrib  
import  admin


urlpatterns  =  [
 url(r'^polls/',  include('polls.urls')),
 url(r'^admin/',  admin.site.urls),
]


The problem is we have two mysite dirs. The docs are helpful in 
suggesting you copy code to paste into urls.py so the focus is on the 
code rather than where to put it. On not finding a urls.py in the outer 
mysite dir he created one.


The suggestion for improving the docs here is to change the heading line 
above from

 mysite/urls.py
to
 mysite/mysite/urls.py

Alternatively, make a pointed reference to the earlier section in the 
page where startproject created the *inner* mysite dir containing the 
target urls.py. For example, by adding words to the effect that the 
inner mysite/urls.py file will be instrumental in the "hello world" step 
later in the tutorial.


Cheers

Mike

--
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/4aacac6c-a045-6327-ecec-4edf24bc37f9%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.