Re: Django deployement Apache

2017-08-28 Thread Vernon Swanepoel
You can just copy the static files out of Django and into the static files in 
your project itself.

-- 
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/d8a9ded1-6956-4293-a355-dc25d16cdca0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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